| 85 | } |
| 86 | |
| 87 | void QNapiApp::createTrayIcon() { |
| 88 | getAction = new QAction(tr("Download subtitles"), 0); |
| 89 | connect(getAction, SIGNAL(triggered()), this, SLOT(showOpenDialog())); |
| 90 | |
| 91 | scanAction = new QAction(tr("Scan directories"), 0); |
| 92 | connect(scanAction, SIGNAL(triggered()), this, SLOT(showScanDialog())); |
| 93 | |
| 94 | convertAction = new QAction(tr("Convert subtitles"), 0); |
| 95 | connect(convertAction, SIGNAL(triggered()), this, SLOT(showConvertDialog())); |
| 96 | |
| 97 | napiGetAction = new QAction(tr("Download subtitles"), 0); |
| 98 | connect(napiGetAction, &QAction::triggered, |
| 99 | [this] { showOpenDialog("NapiProjekt"); }); |
| 100 | |
| 101 | napiCreateUserAction = new QAction(tr("Create an account"), 0); |
| 102 | connect(napiCreateUserAction, &QAction::triggered, |
| 103 | [this] { showCreateAccount("NapiProjekt"); }); |
| 104 | |
| 105 | osGetAction = new QAction(tr("Download subtitles"), 0); |
| 106 | connect(osGetAction, &QAction::triggered, |
| 107 | [this] { showOpenDialog("OpenSubtitles"); }); |
| 108 | |
| 109 | osAddAction = new QAction(tr("Upload subtitles"), 0); |
| 110 | connect(osAddAction, SIGNAL(triggered()), this, SLOT(showOSUploadDialog())); |
| 111 | |
| 112 | osCreateUserAction = new QAction(tr("Create an account"), 0); |
| 113 | connect(osCreateUserAction, &QAction::triggered, |
| 114 | [this] { showCreateAccount("OpenSubtitles"); }); |
| 115 | |
| 116 | napisy24GetAction = new QAction(tr("Download subtitles"), 0); |
| 117 | connect(napisy24GetAction, &QAction::triggered, |
| 118 | [this] { showOpenDialog("Napisy24"); }); |
| 119 | |
| 120 | napisy24CreateUserAction = new QAction(tr("Create an account"), 0); |
| 121 | connect(napisy24CreateUserAction, &QAction::triggered, |
| 122 | [this] { showCreateAccount("OpenSNapisy24ubtitles"); }); |
| 123 | |
| 124 | settingsAction = new QAction(tr("Settings"), 0); |
| 125 | connect(settingsAction, SIGNAL(triggered()), this, SLOT(showSettings())); |
| 126 | |
| 127 | aboutAction = new QAction(tr("About"), 0); |
| 128 | connect(aboutAction, SIGNAL(triggered()), this, SLOT(showAbout())); |
| 129 | |
| 130 | quitAction = new QAction(tr("Quit"), 0); |
| 131 | connect(quitAction, SIGNAL(triggered()), this, SLOT(tryQuit())); |
| 132 | |
| 133 | napiSubMenu = new QMenu(0); |
| 134 | napiSubMenu->setTitle(tr("NapiProjekt")); |
| 135 | napiSubMenu->addAction(napiGetAction); |
| 136 | napiSubMenu->addAction(napiCreateUserAction); |
| 137 | |
| 138 | osSubMenu = new QMenu(0); |
| 139 | osSubMenu->setTitle(tr("OpenSubtitles")); |
| 140 | osSubMenu->addAction(osGetAction); |
| 141 | osSubMenu->addAction(osAddAction); |
| 142 | osSubMenu->addAction(osCreateUserAction); |
| 143 | |
| 144 | napisy24SubMenu = new QMenu(0); |