mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +08:00
refs #693, integrated GUI close dialog
* utility function in CGuiApplication containing the logic (dialog needed, ..) * closeEvent function
This commit is contained in:
@@ -131,9 +131,20 @@ void SwiftGuiStd::performGracefulShutdown()
|
||||
|
||||
void SwiftGuiStd::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
if (sGui)
|
||||
{
|
||||
if (sGui->getIContextNetwork() && sGui->getIContextNetwork()->isConnected())
|
||||
{
|
||||
// we do not just logoff, but give the user a chance to respond
|
||||
event->ignore();
|
||||
QTimer::singleShot(500, this, &SwiftGuiStd::ps_loginRequested);
|
||||
return;
|
||||
}
|
||||
|
||||
// save settings
|
||||
if (sGui->showCloseDialog(this, event) == QDialog::Rejected) { return; }
|
||||
}
|
||||
this->performGracefulShutdown();
|
||||
CGuiApplication::exit();
|
||||
}
|
||||
|
||||
void SwiftGuiStd::changeEvent(QEvent *event)
|
||||
|
||||
Reference in New Issue
Block a user