MCPcopy Create free account
hub / github.com/ckaiser/Lightscreen / closingWithoutTray

Method closingWithoutTray

lightscreenwindow.cpp:241–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241bool LightscreenWindow::closingWithoutTray()
242{
243 if (settings()->value("options/disableHideAlert", false).toBool()) {
244 return false;
245 }
246
247 QMessageBox msgBox;
248 msgBox.setWindowTitle(tr("Lightscreen"));
249 msgBox.setText(tr("You have chosen to hide Lightscreen when there's no system tray icon, so you will not be able to access the program <b>unless you have selected a hotkey to do so</b>.<br>What do you want to do?"));
250 msgBox.setIcon(QMessageBox::Warning);
251
252 msgBox.setStyleSheet("QPushButton { padding: 4px 8px; }");
253
254 auto enableButton = msgBox.addButton(tr("Hide but enable tray"), QMessageBox::ActionRole);
255 auto enableQuietButton = msgBox.addButton(tr("Hide and don't warn"), QMessageBox::ActionRole);
256 auto hideButton = msgBox.addButton(tr("Just hide"), QMessageBox::ActionRole);
257 auto abortButton = msgBox.addButton(QMessageBox::Cancel);
258
259 Q_UNUSED(abortButton);
260
261 msgBox.exec();
262
263 if (msgBox.clickedButton() == hideButton) {
264 return true;
265 } else if (msgBox.clickedButton() == enableQuietButton) {
266 settings()->setValue("options/disableHideAlert", true);
267 applySettings();
268 return true;
269 } else if (msgBox.clickedButton() == enableButton) {
270 settings()->setValue("options/tray", true);
271 applySettings();
272 return true;
273 }
274
275 return false; // Cancel.
276}
277
278void LightscreenWindow::createUploadMenu()
279{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected