wpa_gui-qt4: remove lastWindowClosed() signal handler

Do not connect lastWindowClosed() to quit(), instead explicitly close the
application if File->Exit or window manager close button is activated.
This allows the tray app to avoid being closed with last visible window,
and launch scan and event history windows individually.

Signed-off-by: Kel Modderman <kel@otaku42.de>
This commit is contained in:
Kel Modderman 2008-09-25 21:12:08 +03:00 committed by Jouni Malinen
parent 1019a696a7
commit d70028d337
2 changed files with 4 additions and 12 deletions

View file

@ -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

View file

@ -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();
}