Don't bother showing a status message when returning to the system tray,

but still show a one time tray message to indicate to the user that the
program is still running in the tray if they triggered the window manager
close button.

Signed-off-by: Kel Modderman <kel@otaku42.de>
This commit is contained in:
Kel Modderman 2008-09-26 15:42:12 +03:00 committed by Jouni Malinen
parent d70028d337
commit 89f97a1c8d

View File

@ -1156,6 +1156,7 @@ void WpaGui::trayActivated(QSystemTrayIcon::ActivationReason how)
/* use close() here instead of hide() and allow the /* use close() here instead of hide() and allow the
* custom closeEvent handler take care of children */ * custom closeEvent handler take care of children */
case QSystemTrayIcon::Trigger: case QSystemTrayIcon::Trigger:
ackTrayIcon = true;
if (isVisible()) if (isVisible())
close(); close();
else else
@ -1241,21 +1242,24 @@ void WpaGui::closeEvent(QCloseEvent *event)
if (tray_icon && tray_icon->isVisible()) { if (tray_icon && tray_icon->isVisible()) {
/* give user a visual hint that the tray icon exists */ /* give user a visual hint that the tray icon exists */
if (QSystemTrayIcon::supportsMessages()) { if (!ackTrayIcon && QSystemTrayIcon::supportsMessages()) {
hide(); hide();
QTimer::singleShot(1 * 1000, this, showTrayMessage(QSystemTrayIcon::Information, 3,
SLOT(showTrayStatus())); qAppName() + " will keep running in "
"the system tray.");
} else if (!ackTrayIcon) { } else if (!ackTrayIcon) {
QMessageBox::information(this, qAppName() + " systray", QMessageBox::information(this, qAppName() + " systray",
"The program will keep " "The program will keep "
"running in the system tray." "running in the system "
" To terminate the program, " "tray.");
"choose <b>Quit</b> in the "
"context menu of the system "
"tray icon.");
ackTrayIcon = true;
hide(); hide();
} }
if (ackTrayIcon)
hide();
else
ackTrayIcon = true;
event->ignore(); event->ignore();
return; return;
} }