diff options
author | Kel Modderman <kel@otaku42.de> | 2008-10-01 09:44:58 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2008-10-01 09:44:58 +0300 |
commit | 66897ae779173065b45d6d0bdc0e931bfd43c225 (patch) | |
tree | c7db00a161c58381e2bee1f534d1d3a8026b3ae5 /wpa_supplicant/wpa_gui-qt4/wpagui.cpp | |
parent | 6241fcb165c940cc07ad4fa3b08cc64494d5ac95 (diff) | |
download | external_wpa_supplicant_8_ti-66897ae779173065b45d6d0bdc0e931bfd43c225.zip external_wpa_supplicant_8_ti-66897ae779173065b45d6d0bdc0e931bfd43c225.tar.gz external_wpa_supplicant_8_ti-66897ae779173065b45d6d0bdc0e931bfd43c225.tar.bz2 |
wpa_gui-qt4: clean up closeEvent handler
When the system tray icon is created, qApp's setQuitOnLastWindowClosed
property is set to false, therefore do _not_ ignore widget close events, or
else wpa_gui will refuse to exit when the window manager is logging out.
While at it, remove WpaGui::fileExit() and connect fileExitAction to
quit().
Signed-off-by: Kel Modderman <kel@otaku42.de>
Diffstat (limited to 'wpa_supplicant/wpa_gui-qt4/wpagui.cpp')
-rw-r--r-- | wpa_supplicant/wpa_gui-qt4/wpagui.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp index 957173f..8715267 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp +++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp @@ -37,7 +37,7 @@ WpaGui::WpaGui(QWidget *parent, const char *, Qt::WFlags) SLOT(eventHistory())); connect(fileSaveConfigAction, SIGNAL(triggered()), this, SLOT(saveConfig())); - connect(fileExitAction, SIGNAL(triggered()), this, SLOT(fileExit())); + connect(fileExitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(networkAddAction, SIGNAL(triggered()), this, SLOT(addNetwork())); connect(networkEditAction, SIGNAL(triggered()), this, @@ -1214,11 +1214,6 @@ void WpaGui::showTrayStatus() showTrayMessage(QSystemTrayIcon::Information, 10, msg); } -void WpaGui::fileExit() -{ - qApp->quit(); -} - void WpaGui::closeEvent(QCloseEvent *event) { @@ -1240,29 +1235,21 @@ void WpaGui::closeEvent(QCloseEvent *event) udr = NULL; } - if (tray_icon && tray_icon->isVisible()) { + if (tray_icon && !ackTrayIcon) { /* give user a visual hint that the tray icon exists */ - if (!ackTrayIcon && QSystemTrayIcon::supportsMessages()) { + if (QSystemTrayIcon::supportsMessages()) { hide(); showTrayMessage(QSystemTrayIcon::Information, 3, qAppName() + " will keep running in " "the system tray."); - } else if (!ackTrayIcon) { + } else { QMessageBox::information(this, qAppName() + " systray", "The program will keep " "running in the system " "tray."); - hide(); } - - if (ackTrayIcon) - hide(); - else - ackTrayIcon = true; - - event->ignore(); - return; + ackTrayIcon = true; } - qApp->quit(); + event->accept(); } |