| 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 "qnapiapp.h"cxx . . $ `<file>/gui/src/qnapiapp.h`/ |
| 16 | |
| 17 | #include "libqnapi.h"cxx . . $ `<file>/libqnapi/src/libqnapi.h`/ |
| 18 | |
| 19 | QNapiAppcxx . . $ QNapiApp#::QNapiAppcxx . . $ QNapiApp#QNapiApp(75dd2bf67067255f).(int &argc, char **argv, bool useGui, const QStringcxx . . $ QString# &appName) |
| 20 | : QSingleApplicationcxx . . $ QSingleApplication#(argc, argv, useGui, appName), |
| 21 | creationDTcxx . . $ QNapiApp#creationDT.(QDateTimecxx . . $ QDateTime#::currentDateTimecxx . . $ QDateTime#currentDateTime(bf5129c8228c71c0).()), |
| 22 | enginesRegistrycxx . . $ QNapiApp#enginesRegistry.(LibQNapicxx . . $ LibQNapi#::subtitleDownloadEngineRegistrycxx . . $ LibQNapi#subtitleDownloadEngineRegistry(c62bee4899d08222).()) { |
| 23 | setAttributecxx . . $ QCoreApplication#setAttribute(5f5acd6019f3e3ca).(Qtcxx . . $ Qt/::AA_UseHighDpiPixmapscxx . . $ Qt/AA_UseHighDpiPixmaps., true); |
| 24 | |
| 25 | openDialogcxx . . $ QNapiApp#openDialog. = 0; |
| 26 | |
| 27 | f_progresscxx . . $ QNapiApp#f_progress. = 0; |
| 28 | f_optionscxx . . $ QNapiApp#f_options. = 0; |
| 29 | f_aboutcxx . . $ QNapiApp#f_about. = 0; |
| 30 | f_scancxx . . $ QNapiApp#f_scan. = 0; |
| 31 | f_convertcxx . . $ QNapiApp#f_convert. = 0; |
| 32 | |
| 33 | getActioncxx . . $ QNapiApp#getAction. = 0; |
| 34 | scanActioncxx . . $ QNapiApp#scanAction. = 0; |
| 35 | convertActioncxx . . $ QNapiApp#convertAction. = 0; |
| 36 | napiGetActioncxx . . $ QNapiApp#napiGetAction. = 0; |
| 37 | napiCreateUserActioncxx . . $ QNapiApp#napiCreateUserAction. = 0; |
| 38 | osGetActioncxx . . $ QNapiApp#osGetAction. = 0; |
| 39 | osAddActioncxx . . $ QNapiApp#osAddAction. = 0; |
| 40 | settingsActioncxx . . $ QNapiApp#settingsAction. = 0; |
| 41 | aboutActioncxx . . $ QNapiApp#aboutAction. = 0; |
| 42 | quitActioncxx . . $ QNapiApp#quitAction. = 0; |
| 43 | |
| 44 | napiSubMenucxx . . $ QNapiApp#napiSubMenu. = 0; |
| 45 | osSubMenucxx . . $ QNapiApp#osSubMenu. = 0; |
| 46 | trayIconMenucxx . . $ QNapiApp#trayIconMenu. = 0; |
| 47 | trayIconcxx . . $ QNapiApp#trayIcon. = 0; |
| 48 | } |
| 49 | |
| 50 | QNapiAppcxx . . $ QNapiApp#::~cxx . . $ QNapiApp#`~QNapiApp`(49f6e7a06ebc5aa8).QNapiAppcxx . . $ QNapiApp#() { |
| 51 | if (openDialogcxx . . $ QNapiApp#openDialog.) delete openDialogcxx . . $ QNapiApp#openDialog.; |
| 52 | |
| 53 | if (f_progresscxx . . $ QNapiApp#f_progress.) delete f_progresscxx . . $ QNapiApp#f_progress.; |
| 54 | if (f_optionscxx . . $ QNapiApp#f_options.) delete f_optionscxx . . $ QNapiApp#f_options.; |
| 55 | if (f_aboutcxx . . $ QNapiApp#f_about.) delete f_aboutcxx . . $ QNapiApp#f_about.; |
| 56 | if (f_scancxx . . $ QNapiApp#f_scan.) delete f_scancxx . . $ QNapiApp#f_scan.; |
| 57 | if (f_convertcxx . . $ QNapiApp#f_convert.) delete f_convertcxx . . $ QNapiApp#f_convert.; |
| 58 | |
| 59 | if (getActioncxx . . $ QNapiApp#getAction.) delete getActioncxx . . $ QNapiApp#getAction.; |
| 60 | if (scanActioncxx . . $ QNapiApp#scanAction.) delete scanActioncxx . . $ QNapiApp#scanAction.; |
| 61 | if (convertActioncxx . . $ QNapiApp#convertAction.) delete convertActioncxx . . $ QNapiApp#convertAction.; |
| 62 | if (napiGetActioncxx . . $ QNapiApp#napiGetAction.) delete napiGetActioncxx . . $ QNapiApp#napiGetAction.; |
| 63 | if (napiCreateUserActioncxx . . $ QNapiApp#napiCreateUserAction.) delete napiCreateUserActioncxx . . $ QNapiApp#napiCreateUserAction.; |
| 64 | if (osGetActioncxx . . $ QNapiApp#osGetAction.) delete osGetActioncxx . . $ QNapiApp#osGetAction.; |
| 65 | if (osAddActioncxx . . $ QNapiApp#osAddAction.) delete osAddActioncxx . . $ QNapiApp#osAddAction.; |
| 66 | if (settingsActioncxx . . $ QNapiApp#settingsAction.) delete settingsActioncxx . . $ QNapiApp#settingsAction.; |
| 67 | if (aboutActioncxx . . $ QNapiApp#aboutAction.) delete aboutActioncxx . . $ QNapiApp#aboutAction.; |
| 68 | if (quitActioncxx . . $ QNapiApp#quitAction.) delete quitActioncxx . . $ QNapiApp#quitAction.; |
| 69 | |
| 70 | if (napiSubMenucxx . . $ QNapiApp#napiSubMenu.) delete napiSubMenucxx . . $ QNapiApp#napiSubMenu.; |
| 71 | if (trayIconMenucxx . . $ QNapiApp#trayIconMenu.) delete trayIconMenucxx . . $ QNapiApp#trayIconMenu.; |
| 72 | if (trayIconcxx . . $ QNapiApp#trayIcon.) delete trayIconcxx . . $ QNapiApp#trayIcon.; |
| 73 | } |
| 74 | |
| 75 | frmProgresscxx . . $ frmProgress# *QNapiAppcxx . . $ QNapiApp#::progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).() { |
| 76 | if (!f_progresscxx . . $ QNapiApp#f_progress.) { |
| 77 | f_progresscxx . . $ QNapiApp#f_progress. = new frmProgresscxx . . $ frmProgress#(); |
| 78 | if (!f_progresscxx . . $ QNapiApp#f_progress.) abort(); |
| 79 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(request(QString)), f_progresscxx . . $ QNapiApp#f_progress., |
| 80 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(receiveRequest(QString))); |
| 81 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(downloadFile(const QString &)), f_progresscxx . . $ QNapiApp#f_progress., |
| 82 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(receiveRequest(const QString &))); |
| 83 | } |
| 84 | return f_progresscxx . . $ QNapiApp#f_progress.; |
| 85 | } |
| 86 | |
| 87 | void QNapiAppcxx . . $ QNapiApp#::createTrayIconcxx . . $ QNapiApp#createTrayIcon(49f6e7a06ebc5aa8).() { |
| 88 | getActioncxx . . $ QNapiApp#getAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Download subtitles"), 0); |
| 89 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(getActioncxx . . $ QNapiApp#getAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(showOpenDialog())); |
| 90 | |
| 91 | scanActioncxx . . $ QNapiApp#scanAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Scan directories"), 0); |
| 92 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(scanActioncxx . . $ QNapiApp#scanAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(showScanDialog())); |
| 93 | |
| 94 | convertActioncxx . . $ QNapiApp#convertAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Convert subtitles"), 0); |
| 95 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(convertActioncxx . . $ QNapiApp#convertAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(showConvertDialog())); |
| 96 | |
| 97 | napiGetActioncxx . . $ QNapiApp#napiGetAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Download subtitles"), 0); |
| 98 | connectcxx . . $ QObject#connect(799f219bacec96aa).(napiGetActioncxx . . $ QNapiApp#napiGetAction., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., |
| 99 | [this] { showOpenDialogcxx . . $ QNapiApp#showOpenDialog(7dc6c9a0b6a7270f).("NapiProjekt"cxx . . $ QString#QString(e1217c004a86c950).); }); |
| 100 | |
| 101 | napiCreateUserActioncxx . . $ QNapiApp#napiCreateUserAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Create an account"), 0); |
| 102 | connectcxx . . $ QObject#connect(799f219bacec96aa).(napiCreateUserActioncxx . . $ QNapiApp#napiCreateUserAction., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., |
| 103 | [this] { showCreateAccountcxx . . $ QNapiApp#showCreateAccount(7fba01612ab56717).("NapiProjekt"cxx . . $ QString#QString(85c52e162fed56f9).); }); |
| 104 | |
| 105 | osGetActioncxx . . $ QNapiApp#osGetAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Download subtitles"), 0); |
| 106 | connectcxx . . $ QObject#connect(799f219bacec96aa).(osGetActioncxx . . $ QNapiApp#osGetAction., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., |
| 107 | [this] { showOpenDialogcxx . . $ QNapiApp#showOpenDialog(7dc6c9a0b6a7270f).("OpenSubtitles"cxx . . $ QString#QString(e1217c004a86c950).); }); |
| 108 | |
| 109 | osAddActioncxx . . $ QNapiApp#osAddAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Upload subtitles"), 0); |
| 110 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(osAddActioncxx . . $ QNapiApp#osAddAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(showOSUploadDialog())); |
| 111 | |
| 112 | osCreateUserActioncxx . . $ QNapiApp#osCreateUserAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Create an account"), 0); |
| 113 | connectcxx . . $ QObject#connect(799f219bacec96aa).(osCreateUserActioncxx . . $ QNapiApp#osCreateUserAction., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., |
| 114 | [this] { showCreateAccountcxx . . $ QNapiApp#showCreateAccount(7fba01612ab56717).("OpenSubtitles"cxx . . $ QString#QString(85c52e162fed56f9).); }); |
| 115 | |
| 116 | napisy24GetActioncxx . . $ QNapiApp#napisy24GetAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Download subtitles"), 0); |
| 117 | connectcxx . . $ QObject#connect(799f219bacec96aa).(napisy24GetActioncxx . . $ QNapiApp#napisy24GetAction., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., |
| 118 | [this] { showOpenDialogcxx . . $ QNapiApp#showOpenDialog(7dc6c9a0b6a7270f).("Napisy24"cxx . . $ QString#QString(e1217c004a86c950).); }); |
| 119 | |
| 120 | napisy24CreateUserActioncxx . . $ QNapiApp#napisy24CreateUserAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Create an account"), 0); |
| 121 | connectcxx . . $ QObject#connect(799f219bacec96aa).(napisy24CreateUserActioncxx . . $ QNapiApp#napisy24CreateUserAction., &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., |
| 122 | [this] { showCreateAccountcxx . . $ QNapiApp#showCreateAccount(7fba01612ab56717).("OpenSNapisy24ubtitles"cxx . . $ QString#QString(85c52e162fed56f9).); }); |
| 123 | |
| 124 | settingsActioncxx . . $ QNapiApp#settingsAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Settings"), 0); |
| 125 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(settingsActioncxx . . $ QNapiApp#settingsAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(showSettings())); |
| 126 | |
| 127 | aboutActioncxx . . $ QNapiApp#aboutAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("About"), 0); |
| 128 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(aboutActioncxx . . $ QNapiApp#aboutAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(showAbout())); |
| 129 | |
| 130 | quitActioncxx . . $ QNapiApp#quitAction. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Quit"), 0); |
| 131 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(quitActioncxx . . $ QNapiApp#quitAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(tryQuit())); |
| 132 | |
| 133 | napiSubMenucxx . . $ QNapiApp#napiSubMenu. = new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(0); |
| 134 | napiSubMenucxx . . $ QNapiApp#napiSubMenu.->setTitlecxx . . $ QMenu#setTitle(3520e46b33348bf6).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("NapiProjekt")); |
| 135 | napiSubMenucxx . . $ QNapiApp#napiSubMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(napiGetActioncxx . . $ QNapiApp#napiGetAction.); |
| 136 | napiSubMenucxx . . $ QNapiApp#napiSubMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(napiCreateUserActioncxx . . $ QNapiApp#napiCreateUserAction.); |
| 137 | |
| 138 | osSubMenucxx . . $ QNapiApp#osSubMenu. = new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(0); |
| 139 | osSubMenucxx . . $ QNapiApp#osSubMenu.->setTitlecxx . . $ QMenu#setTitle(3520e46b33348bf6).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("OpenSubtitles")); |
| 140 | osSubMenucxx . . $ QNapiApp#osSubMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(osGetActioncxx . . $ QNapiApp#osGetAction.); |
| 141 | osSubMenucxx . . $ QNapiApp#osSubMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(osAddActioncxx . . $ QNapiApp#osAddAction.); |
| 142 | osSubMenucxx . . $ QNapiApp#osSubMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(osCreateUserActioncxx . . $ QNapiApp#osCreateUserAction.); |
| 143 | |
| 144 | napisy24SubMenucxx . . $ QNapiApp#napisy24SubMenu. = new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(0); |
| 145 | napisy24SubMenucxx . . $ QNapiApp#napisy24SubMenu.->setTitlecxx . . $ QMenu#setTitle(3520e46b33348bf6).(trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Napisy24")); |
| 146 | napisy24SubMenucxx . . $ QNapiApp#napisy24SubMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(napisy24GetActioncxx . . $ QNapiApp#napisy24GetAction.); |
| 147 | napisy24SubMenucxx . . $ QNapiApp#napisy24SubMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(napisy24CreateUserActioncxx . . $ QNapiApp#napisy24CreateUserAction.); |
| 148 | |
| 149 | trayIconMenucxx . . $ QNapiApp#trayIconMenu. = new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(0); |
| 150 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(getActioncxx . . $ QNapiApp#getAction.); |
| 151 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(scanActioncxx . . $ QNapiApp#scanAction.); |
| 152 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(convertActioncxx . . $ QNapiApp#convertAction.); |
| 153 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addSeparatorcxx . . $ QMenu#addSeparator(a590eff9f1ec9a95).(); |
| 154 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addMenucxx . . $ QMenu#addMenu(e6260eb8882b953).(napiSubMenucxx . . $ QNapiApp#napiSubMenu.); |
| 155 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addMenucxx . . $ QMenu#addMenu(e6260eb8882b953).(osSubMenucxx . . $ QNapiApp#osSubMenu.); |
| 156 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addMenucxx . . $ QMenu#addMenu(e6260eb8882b953).(napisy24SubMenucxx . . $ QNapiApp#napisy24SubMenu.); |
| 157 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addSeparatorcxx . . $ QMenu#addSeparator(a590eff9f1ec9a95).(); |
| 158 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(settingsActioncxx . . $ QNapiApp#settingsAction.); |
| 159 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(aboutActioncxx . . $ QNapiApp#aboutAction.); |
| 160 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addSeparatorcxx . . $ QMenu#addSeparator(a590eff9f1ec9a95).(); |
| 161 | trayIconMenucxx . . $ QNapiApp#trayIconMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(quitActioncxx . . $ QNapiApp#quitAction.); |
| 162 | |
| 163 | trayIconcxx . . $ QNapiApp#trayIcon. = new QSystemTrayIconcxx . . $ QSystemTrayIcon#(0); |
| 164 | trayIconcxx . . $ QNapiApp#trayIcon.->setContextMenucxx . . $ QSystemTrayIcon#setContextMenu(cb52c12b49e9b51b).(trayIconMenucxx . . $ QNapiApp#trayIconMenu.); |
| 165 | |
| 166 | trayIconcxx . . $ QNapiApp#trayIcon.->setIconcxx . . $ QSystemTrayIcon#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/icon/qnapi.png"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 167 | |
| 168 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(trayIconcxx . . $ QNapiApp#trayIcon., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(activated(QSystemTrayIcon::ActivationReason)), this, |
| 169 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(trayIconActivated(QSystemTrayIcon::ActivationReason))); |
| 170 | |
| 171 | trayIconcxx . . $ QNapiApp#trayIcon.->showcxx . . $ QSystemTrayIcon#show(49f6e7a06ebc5aa8).(); |
| 172 | } |
| 173 | |
| 174 | void QNapiAppcxx . . $ QNapiApp#::showTrayMessagecxx . . $ QNapiApp#showTrayMessage(3458fe3960d5051).(QStringcxx . . $ QString# title, QStringcxx . . $ QString# msg) { |
| 175 | trayIconcxx . . $ QNapiApp#trayIcon.->showMessagecxx . . $ QSystemTrayIcon#showMessage(d234e6c04c1013f3).(title, msg); |
| 176 | } |
| 177 | |
| 178 | bool QNapiAppcxx . . $ QNapiApp#::showOpenDialogcxx . . $ QNapiApp#showOpenDialog(7dc6c9a0b6a7270f).(QStringcxx . . $ QString# engine) { |
| 179 | QStringListcxx . . $ QStringList# fileListcxx . . $ QStringList#QStringList(49f6e7a06ebc5aa8).; |
| 180 | |
| 181 | if (!openDialogcxx . . $ QNapiApp#openDialog.) { |
| 182 | QStringcxx . . $ QString# initDir = LibQNapicxx . . $ QString#QString(e1217c004a86c950).::loadConfigcxx . . $ LibQNapi#loadConfig(915c3b8a74517b7e).().lastOpenedDircxx . . $ QNapiConfig#lastOpenedDir(6ef7b6c27b00b43d).(); |
| 183 | |
| 184 | if (!QFileInfocxx . . $ QFileInfo#(initDir).isDircxx . . $ QFileInfo#isDir(50ce9a9e25b4a850).()) { |
| 185 | initDir =cxx . . $ QString#`operator=`(7b76e6691bca1027). QDircxx . . $ QDir#::homePathcxx . . $ QDir#homePath(4365c3963150523e).(); |
| 186 | } |
| 187 | |
| 188 | openDialogcxx . . $ QNapiApp#openDialog. = new QNapiOpenDialogcxx . . $ QNapiOpenDialog#( |
| 189 | 0, trcxx . . $ QNapiApp#tr(75d9f1c324b4579d).("Select one or more video files to download subtitles for"), |
| 190 | initDir, QNapiOpenDialogcxx . . $ QNapiOpenDialog#::Moviescxx . . $ QNapiOpenDialog#Movies.); |
| 191 | } else if (openDialogcxx . . $ QNapiApp#openDialog.) { |
| 192 | openDialogcxx . . $ QNapiApp#openDialog.->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).(); |
| 193 | return true; |
| 194 | } else if (f_progresscxx . . $ QNapiApp#f_progress.) { |
| 195 | f_progresscxx . . $ QNapiApp#f_progress.->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).(); |
| 196 | return true; |
| 197 | } |
| 198 | |
| 199 | if (openDialogcxx . . $ QNapiApp#openDialog.->selectFilescxx . . $ QNapiOpenDialog#selectFiles(c9857a73d68e59ba).()) { |
| 200 | fileList =cxx . . $ QStringList#`operator=`(99dcbe54f9ac14fc). openDialogcxx . . $ QNapiApp#openDialog.->selectedFilescxx . . $ QFileDialog#selectedFiles(e1dbd5c4feadc8f5).(); |
| 201 | |
| 202 | if (!fileList.isEmptycxx . . $ QList#isEmpty(50ce9a9e25b4a850).()) { |
| 203 | QStringcxx . . $ QString# dialogPath = QFileInfocxx . . $ QString#QString(e1217c004a86c950).(fileList.firstcxx . . $ QList#first(19b2b6f17af048b).()).absolutePathcxx . . $ QFileInfo#absolutePath(6ef7b6c27b00b43d).(); |
| 204 | auto newConfig = LibQNapicxx . . $ LibQNapi#::loadConfigcxx . . $ LibQNapi#loadConfig(915c3b8a74517b7e).().setLastOpenedDircxx . . $ QNapiConfig#setLastOpenedDir(7a63b8618ea6a356).(dialogPath); |
| 205 | LibQNapicxx . . $ LibQNapi#::writeConfigcxx . . $ LibQNapi#writeConfig(64b8fa5c398f1122).(newConfig); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | delete openDialogcxx . . $ QNapiApp#openDialog.; |
| 210 | openDialogcxx . . $ QNapiApp#openDialog. = 0; |
| 211 | |
| 212 | if (!fileList.isEmptycxx . . $ QList#isEmpty(50ce9a9e25b4a850).()) { |
| 213 | if (!engine.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 214 | progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->setSpecificEnginecxx . . $ frmProgress#setSpecificEngine(7df51288a9ebd664).(enginecxx . . $ QString#QString(3520e46b33348bf6).); |
| 215 | } else { |
| 216 | progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->clearSpecificEnginecxx . . $ frmProgress#clearSpecificEngine(49f6e7a06ebc5aa8).(); |
| 217 | } |
| 218 | |
| 219 | progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->enqueueFilescxx . . $ frmProgress#enqueueFiles(631c0101495f0328).(fileList); |
| 220 | progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->downloadcxx . . $ frmProgress#download(c9857a73d68e59ba).(); |
| 221 | } else if (progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->isBatchModecxx . . $ frmProgress#isBatchMode(c9857a73d68e59ba).()) { |
| 222 | return false; |
| 223 | } |
| 224 | |
| 225 | return true; |
| 226 | } |
| 227 | |
| 228 | bool QNapiAppcxx . . $ QNapiApp#::showScanDialogcxx . . $ QNapiApp#showScanDialog(7dc6c9a0b6a7270f).(QStringcxx . . $ QString# init_dir) { |
| 229 | if (!f_scancxx . . $ QNapiApp#f_scan.) f_scancxx . . $ QNapiApp#f_scan. = new frmScancxx . . $ frmScan#(); |
| 230 | |
| 231 | if (f_scancxx . . $ QNapiApp#f_scan.->isVisiblecxx . . $ QWidget#isVisible(50ce9a9e25b4a850).()) { |
| 232 | f_scancxx . . $ QNapiApp#f_scan.->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).(); |
| 233 | return false; |
| 234 | } |
| 235 | |
| 236 | f_scancxx . . $ QNapiApp#f_scan.->setInitDircxx . . $ frmScan#setInitDir(3520e46b33348bf6).(init_dir); |
| 237 | |
| 238 | bool result = false; |
| 239 | |
| 240 | if (f_scancxx . . $ QNapiApp#f_scan.->execcxx . . $ QDialog#exec(b126dc7c1de90089).() == QDialogcxx . . $ QDialog#::Acceptedcxx . . $ QDialog#Accepted.) { |
| 241 | result = true; |
| 242 | progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->enqueueFilescxx . . $ frmProgress#enqueueFiles(631c0101495f0328).(f_scancxx . . $ QNapiApp#f_scan.->getSelectedFilescxx . . $ frmScan#getSelectedFiles(669a05bc42dd57cc).()); |
| 243 | progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->downloadcxx . . $ frmProgress#download(c9857a73d68e59ba).(); |
| 244 | } |
| 245 | |
| 246 | delete f_scancxx . . $ QNapiApp#f_scan.; |
| 247 | f_scancxx . . $ QNapiApp#f_scan. = 0; |
| 248 | return result; |
| 249 | } |
| 250 | |
| 251 | void QNapiAppcxx . . $ QNapiApp#::showConvertDialogcxx . . $ QNapiApp#showConvertDialog(49f6e7a06ebc5aa8).() { |
| 252 | if (!f_convertcxx . . $ QNapiApp#f_convert.) f_convertcxx . . $ QNapiApp#f_convert. = new frmConvertcxx . . $ frmConvert#(); |
| 253 | |
| 254 | if (f_convertcxx . . $ QNapiApp#f_convert.->isVisiblecxx . . $ QWidget#isVisible(50ce9a9e25b4a850).()) { |
| 255 | f_convertcxx . . $ QNapiApp#f_convert.->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).(); |
| 256 | return; |
| 257 | } |
| 258 | |
| 259 | f_convertcxx . . $ QNapiApp#f_convert.->execcxx . . $ QDialog#exec(b126dc7c1de90089).(); |
| 260 | |
| 261 | delete f_scancxx . . $ QNapiApp#f_scan.; |
| 262 | f_scancxx . . $ QNapiApp#f_scan. = 0; |
| 263 | } |
| 264 | |
| 265 | void QNapiAppcxx . . $ QNapiApp#::showCreateAccountcxx . . $ QNapiApp#showCreateAccount(7fba01612ab56717).(const QStringcxx . . $ QString# &engineName) const { |
| 266 | Maybecxx . . $ Maybe#<QUrlcxx . . $ QUrl#> maybeRegistrationUrl = |
| 267 | enginesRegistrycxx . . $ QNapiApp#enginesRegistry.->cxx . . $ QSharedPointer#`operator->`(5a2a78a048fb49a8).engineMetadatacxx . . $ SubtitleDownloadEnginesRegistry#engineMetadata(b33a41f6a1dd084a).(engineName).registrationUrlcxx . . $ SubtitleDownloadEngineMetadata#registrationUrl(1c6366afc3889e94).(); |
| 268 | |
| 269 | if (maybeRegistrationUrl) { |
| 270 | QDesktopServicescxx . . $ QDesktopServices#::openUrlcxx . . $ QDesktopServices#openUrl(3c1e6c2c1d0bcefc).(maybeRegistrationUrl.valuecxx . . $ Maybe#value(8f5363d873dd4781).()); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | void QNapiAppcxx . . $ QNapiApp#::showOSUploadDialogcxx . . $ QNapiApp#showOSUploadDialog(83f5f38750778ac8).() const { |
| 275 | QDesktopServicescxx . . $ QDesktopServices#::openUrlcxx . . $ QDesktopServices#openUrl(3c1e6c2c1d0bcefc).(QUrlcxx . . $ QUrl#QUrl(ea1f3831e370f1cb).("http://www.opensubtitles.org/upload"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 276 | } |
| 277 | |
| 278 | void QNapiAppcxx . . $ QNapiApp#::showSettingscxx . . $ QNapiApp#showSettings(49f6e7a06ebc5aa8).() { |
| 279 | if (!f_optionscxx . . $ QNapiApp#f_options.) { |
| 280 | f_optionscxx . . $ QNapiApp#f_options. = new frmOptionscxx . . $ frmOptions#(); |
| 281 | f_optionscxx . . $ QNapiApp#f_options.->readConfigcxx . . $ frmOptions#readConfig(64b8fa5c398f1122).(LibQNapicxx . . $ LibQNapi#::loadConfigcxx . . $ LibQNapi#loadConfig(915c3b8a74517b7e).()); |
| 282 | } |
| 283 | |
| 284 | if (f_optionscxx . . $ QNapiApp#f_options.->isVisiblecxx . . $ QWidget#isVisible(50ce9a9e25b4a850).()) { |
| 285 | f_optionscxx . . $ QNapiApp#f_options.->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).(); |
| 286 | return; |
| 287 | } |
| 288 | |
| 289 | if (f_optionscxx . . $ QNapiApp#f_options.->execcxx . . $ QDialog#exec(b126dc7c1de90089).() == QDialogcxx . . $ QDialog#::Acceptedcxx . . $ QDialog#Accepted.) f_optionscxx . . $ QNapiApp#f_options.->writeConfigcxx . . $ frmOptions#writeConfig(49f6e7a06ebc5aa8).(); |
| 290 | |
| 291 | delete f_optionscxx . . $ QNapiApp#f_options.; |
| 292 | f_optionscxx . . $ QNapiApp#f_options. = 0; |
| 293 | } |
| 294 | |
| 295 | void QNapiAppcxx . . $ QNapiApp#::showAboutcxx . . $ QNapiApp#showAbout(49f6e7a06ebc5aa8).() { |
| 296 | if (!f_aboutcxx . . $ QNapiApp#f_about.) f_aboutcxx . . $ QNapiApp#f_about. = new frmAboutcxx . . $ frmAbout#(); |
| 297 | if (f_aboutcxx . . $ QNapiApp#f_about.->isVisiblecxx . . $ QWidget#isVisible(50ce9a9e25b4a850).()) { |
| 298 | f_aboutcxx . . $ QNapiApp#f_about.->raisecxx . . $ QWidget#raise(49f6e7a06ebc5aa8).(); |
| 299 | return; |
| 300 | } |
| 301 | f_aboutcxx . . $ QNapiApp#f_about.->execcxx . . $ QDialog#exec(b126dc7c1de90089).(); |
| 302 | delete f_aboutcxx . . $ QNapiApp#f_about.; |
| 303 | f_aboutcxx . . $ QNapiApp#f_about. = 0; |
| 304 | } |
| 305 | |
| 306 | void QNapiAppcxx . . $ QNapiApp#::tryQuitcxx . . $ QNapiApp#tryQuit(49f6e7a06ebc5aa8).() { |
| 307 | if (progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->isVisiblecxx . . $ QWidget#isVisible(50ce9a9e25b4a850).() && !progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->closecxx . . $ QWidget#close(c9857a73d68e59ba).()) return; |
| 308 | quitcxx . . $ QCoreApplication#quit(49f6e7a06ebc5aa8).(); |
| 309 | } |
| 310 | |
| 311 | void QNapiAppcxx . . $ QNapiApp#::trayIconActivatedcxx . . $ QNapiApp#trayIconActivated(dc7279b31293a212).(QSystemTrayIconcxx . . $ QSystemTrayIcon#::ActivationReasoncxx . . $ QSystemTrayIcon#ActivationReason# reason) { |
| 312 | if (reason == QSystemTrayIconcxx . . $ QSystemTrayIcon#::Triggercxx . . $ QSystemTrayIcon#Trigger.) |
| 313 | #ifndef Q_OS_MAC |
| 314 | showOpenDialogcxx . . $ QNapiApp#showOpenDialog(7dc6c9a0b6a7270f).() |
| 315 | #endif |
| 316 | ; |
| 317 | } |
| 318 | |
| 319 | bool QNapiAppcxx . . $ QNapiApp#::eventcxx . . $ QNapiApp#event(f123fa2ce489f0bd).(QEventcxx . . $ QEvent# *ev) { |
| 320 | if (ev->typecxx . . $ QEvent#type(916a8de57f4d422b).() == QEventcxx . . $ QEvent#::FileOpencxx . . $ QEvent#FileOpen.) { |
| 321 | bool batchMode = creationDTcxx . . $ QNapiApp#creationDT..secsTocxx . . $ QDateTime#secsTo(a9fc96cd501c18ab).(QDateTimecxx . . $ QDateTime#::currentDateTimecxx . . $ QDateTime#currentDateTime(bf5129c8228c71c0).()) <= 1; |
| 322 | progresscxx . . $ QNapiApp#progress(cdabfe46e21630f8).()->setBatchModecxx . . $ frmProgress#setBatchMode(b45ddcbc8423892c).(batchMode); |
| 323 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! downloadFilecxx . . $ QNapiApp#downloadFile(3520e46b33348bf6).(static_cast<QFileOpenEventcxx . . $ QFileOpenEvent# *>(ev)->filecxx . . $ QFileOpenEvent#file(6ef7b6c27b00b43d).()); |
| 324 | } else { |
| 325 | return QApplicationcxx . . $ QApplication#::eventcxx . . $ QApplication#event(f123fa2ce489f0bd).(ev); |
| 326 | } |
| 327 | |
| 328 | return true; |
| 329 | } |