diff --git a/wpa_supplicant/wpa_gui-qt4/main.cpp b/wpa_supplicant/wpa_gui-qt4/main.cpp index eeeda399d..64aa7e9f4 100644 --- a/wpa_supplicant/wpa_gui-qt4/main.cpp +++ b/wpa_supplicant/wpa_gui-qt4/main.cpp @@ -33,7 +33,6 @@ int main(int argc, char *argv[]) #endif /* CONFIG_NATIVE_WINDOWS */ w.show(); - app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); ret = app.exec(); #ifdef CONFIG_NATIVE_WINDOWS diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp index ba11a8307..dfec128d3 100644 --- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp +++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp @@ -595,9 +595,6 @@ void WpaGui::scan() delete scanres; } - if (!isVisible()) - show(); - scanres = new ScanResults(); if (scanres == NULL) return; @@ -614,9 +611,6 @@ void WpaGui::eventHistory() delete eh; } - if (!isVisible()) - show(); - eh = new EventHistory(); if (eh == NULL) return; @@ -1093,6 +1087,8 @@ void WpaGui::selectAdapter( const QString & sel ) void WpaGui::createTrayIcon() { + QApplication::setQuitOnLastWindowClosed(false); + tray_icon = new QSystemTrayIcon(this); tray_icon->setToolTip(qAppName() + " - wpa_supplicant user interface"); tray_icon->setIcon(QIcon(":/icons/wpa_gui.svg")); @@ -1219,10 +1215,7 @@ void WpaGui::showTrayStatus() void WpaGui::fileExit() { - if (tray_icon) - tray_icon->hide(); - - close(); + qApp->quit(); } @@ -1267,5 +1260,5 @@ void WpaGui::closeEvent(QCloseEvent *event) return; } - event->accept(); + qApp->quit(); }