| 1 | /***************************************************************************** |
| 2 | ** QNapi |
| 3 | ** Copyright (C) 2008-2017 Piotr KrzemiĆski <[email protected]> |
| 4 | ** |
| 5 | ** This program is free software; you can redistribute it and/or modify |
| 6 | ** it under the terms of the GNU General Public License as published by |
| 7 | ** the Free Software Foundation; either version 2 of the License, or |
| 8 | ** (at your option) any later version. |
| 9 | ** |
| 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
| 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | ** |
| 13 | *****************************************************************************/ |
| 14 | |
| 15 | #include <QDesktopServices> |
| 16 | #include <QDesktopWidget> |
| 17 | |
| 18 | #include "engines/napiprojektdownloadengine.h"cxx . . $ `<file>/libqnapi/src/engines/napiprojektdownloadengine.h`/ |
| 19 | #include "frmnapiprojektconfig.h"cxx . . $ `<file>/gui/src/forms/frmnapiprojektconfig.h`/ |
| 20 | |
| 21 | frmNapiProjektConfigcxx . . $ frmNapiProjektConfig#::frmNapiProjektConfigcxx . . $ frmNapiProjektConfig#frmNapiProjektConfig(1e9734ae4de8c102).(const EngineConfigcxx . . $ EngineConfig# &config, |
| 22 | QWidgetcxx . . $ QWidget# *parent, Qtcxx . . $ Qt/::WindowFlagscxx . . $ Qt/WindowFlags# f) |
| 23 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent, f), configcxx . . $ frmNapiProjektConfig#config.(config) { |
| 24 | uicxx . . $ frmNapiProjektConfig#ui..setupUicxx . . $ Ui_frmNapiProjektConfig#setupUi(d194de0c0f68c28b).(this); |
| 25 | |
| 26 | uicxx . . $ frmNapiProjektConfig#ui..leNickcxx . . $ Ui_frmNapiProjektConfig#leNick.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(config.nickcxx . . $ EngineConfig#nick(6ef7b6c27b00b43d).()); |
| 27 | uicxx . . $ frmNapiProjektConfig#ui..lePasscxx . . $ Ui_frmNapiProjektConfig#lePass.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(config.passwordcxx . . $ EngineConfig#password(6ef7b6c27b00b43d).()); |
| 28 | |
| 29 | QIconcxx . . $ QIcon# napiProjektIcon = QIconcxx . . $ QIcon#QIcon(47c487586538d025).(QPixmapcxx . . $ QPixmap#QPixmap(ac4b840ac9fbb56d).(NapiProjektDownloadEnginecxx . . $ NapiProjektDownloadEngine#::pixmapDatacxx . . $ NapiProjektDownloadEngine#pixmapData.)); |
| 30 | setWindowIconcxx . . $ QWidget#setWindowIcon(71dcdac178620ed6).(napiProjektIcon); |
| 31 | |
| 32 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ frmNapiProjektConfig#ui..pbRegistercxx . . $ Ui_frmNapiProjektConfig#pbRegister., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(pbRegisterClicked())); |
| 33 | |
| 34 | QRectcxx . . $ QRect# position = frameGeometrycxx . . $ QWidget#frameGeometry(d857385bac04cbf7).(); |
| 35 | position.moveCentercxx . . $ QRect#moveCenter(4f9e9534be445c03).(QDesktopWidgetcxx . . $ QDesktopWidget#QDesktopWidget(49f6e7a06ebc5aa8).().availableGeometrycxx . . $ QDesktopWidget#availableGeometry(b336661e7197c5cf).().centercxx . . $ QRect#center(75d69cfbd3c4b2dd).()); |
| 36 | movecxx . . $ QWidget#move(4f9e9534be445c03).(position.topLeftcxx . . $ QRect#topLeft(75d69cfbd3c4b2dd).()); |
| 37 | } |
| 38 | |
| 39 | EngineConfigcxx . . $ EngineConfig# frmNapiProjektConfigcxx . . $ frmNapiProjektConfig#::getConfigcxx . . $ frmNapiProjektConfig#getConfig(bbd16875014b2b7e).() const { return configcxx . . $ frmNapiProjektConfig#config.; } |
| 40 | |
| 41 | void frmNapiProjektConfigcxx . . $ frmNapiProjektConfig#::acceptcxx . . $ frmNapiProjektConfig#accept(49f6e7a06ebc5aa8).() { |
| 42 | configcxx . . $ frmNapiProjektConfig#config. =cxx . . $ EngineConfig#`operator=`(bb8f522a4c7a1efc). configcxx . . $ frmNapiProjektConfig#config..setNickcxx . . $ EngineConfig#setNick(201551da88e991cf).(uicxx . . $ frmNapiProjektConfig#ui..leNickcxx . . $ Ui_frmNapiProjektConfig#leNick.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()).setPasswordcxx . . $ EngineConfig#setPassword(201551da88e991cf).(uicxx . . $ frmNapiProjektConfig#ui..lePasscxx . . $ Ui_frmNapiProjektConfig#lePass.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()); |
| 43 | QDialogcxx . . $ QDialog#::acceptcxx . . $ QDialog#accept(49f6e7a06ebc5aa8).(); |
| 44 | } |
| 45 | |
| 46 | void frmNapiProjektConfigcxx . . $ frmNapiProjektConfig#::pbRegisterClickedcxx . . $ frmNapiProjektConfig#pbRegisterClicked(49f6e7a06ebc5aa8).() { |
| 47 | Maybecxx . . $ Maybe#<QUrlcxx . . $ QUrl#> maybeRegistrationUrl = |
| 48 | NapiProjektDownloadEnginecxx . . $ NapiProjektDownloadEngine#::metadatacxx . . $ NapiProjektDownloadEngine#metadata..registrationUrlcxx . . $ SubtitleDownloadEngineMetadata#registrationUrl(1c6366afc3889e94).(); |
| 49 | |
| 50 | if (maybeRegistrationUrl) { |
| 51 | QDesktopServicescxx . . $ QDesktopServices#::openUrlcxx . . $ QDesktopServices#openUrl(3c1e6c2c1d0bcefc).(maybeRegistrationUrl.valuecxx . . $ Maybe#value(8f5363d873dd4781).()); |
| 52 | } |
| 53 | } |