X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=wpa_supplicant%2Fwpa_gui-qt4%2Fwpagui.cpp;h=957173f9099930ab223ad1ec90e2a503169926d0;hb=89f97a1c8d333790332ce98e75ea59e39897e611;hp=dfec128d33ee3bd2235c912689d315e076e3fce1;hpb=d70028d337ca150c22e2c439dacbee1d6b122e1c;p=libeap.git diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp index dfec128..957173f 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp +++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp @@ -1156,6 +1156,7 @@ void WpaGui::trayActivated(QSystemTrayIcon::ActivationReason how) /* use close() here instead of hide() and allow the * custom closeEvent handler take care of children */ case QSystemTrayIcon::Trigger: + ackTrayIcon = true; if (isVisible()) close(); else @@ -1241,21 +1242,24 @@ void WpaGui::closeEvent(QCloseEvent *event) if (tray_icon && tray_icon->isVisible()) { /* give user a visual hint that the tray icon exists */ - if (QSystemTrayIcon::supportsMessages()) { + if (!ackTrayIcon && QSystemTrayIcon::supportsMessages()) { hide(); - QTimer::singleShot(1 * 1000, this, - SLOT(showTrayStatus())); + showTrayMessage(QSystemTrayIcon::Information, 3, + qAppName() + " will keep running in " + "the system tray."); } else if (!ackTrayIcon) { QMessageBox::information(this, qAppName() + " systray", "The program will keep " - "running in the system tray." - " To terminate the program, " - "choose Quit in the " - "context menu of the system " - "tray icon."); - ackTrayIcon = true; + "running in the system " + "tray."); hide(); } + + if (ackTrayIcon) + hide(); + else + ackTrayIcon = true; + event->ignore(); return; }