refs #693, integrated GUI close dialog

* utility function in CGuiApplication containing the logic (dialog needed, ..)
* closeEvent function
This commit is contained in:
Klaus Basan
2016-06-30 03:12:59 +02:00
parent 6650f18e57
commit 18112a0394
8 changed files with 125 additions and 26 deletions

View File

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