MCPcopy Create free account
hub / github.com/YACReader/yacreader / handleCloseToTrayIcon

Method handleCloseToTrayIcon

YACReaderLibrary/trayicon_controller.cpp:69–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69bool TrayIconController::handleCloseToTrayIcon(QCloseEvent *event)
70{
71#ifdef Q_OS_MACOS
72 if (!event->spontaneous() || !window->isVisible()) {
73 return false;
74 }
75#endif
76 if (trayIcon.isVisible()) {
77 if (!settings->value(CLOSE_TO_TRAY_NOTIFIED, false).toBool()) {
78 QMessageBox::information(window, tr("Systray"),
79 tr("YACReaderLibrary will keep running in the "
80 "system tray. To terminate the program, "
81 "choose <b>Quit</b> in the context menu "
82 "of the system tray icon."));
83 settings->setValue(CLOSE_TO_TRAY_NOTIFIED, true);
84 }
85#ifdef Q_OS_MACOS
86 OSXHideDockIcon();
87#endif
88 window->hide();
89 event->ignore();
90 return true;
91 } else {
92 return false;
93 }
94}
95
96void TrayIconController::showWindow()
97{

Callers 1

closeEventMethod · 0.80

Calls 2

setValueMethod · 0.80
hideMethod · 0.80

Tested by

no test coverage detected