GUI improvements: naming and better user experience during shutdown

This commit is contained in:
Klaus Basan
2015-04-21 01:28:31 +02:00
committed by Mathew Sutcliffe
parent 7b1beaf02d
commit 32e65669a3
2 changed files with 29 additions and 23 deletions

View File

@@ -54,7 +54,7 @@
<string>Network</string> <string>Network</string>
</property> </property>
<property name="text"> <property name="text">
<string>nt.</string> <string>net</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -73,7 +73,7 @@
<string>Simulator</string> <string>Simulator</string>
</property> </property>
<property name="text"> <property name="text">
<string>sm.</string> <string>sim</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -93,7 +93,7 @@
<string>Mappings ready</string> <string>Mappings ready</string>
</property> </property>
<property name="text"> <property name="text">
<string>mp.</string> <string>map</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -71,32 +71,12 @@ void SwiftGuiStd::mousePressEvent(QMouseEvent *event)
void SwiftGuiStd::performGracefulShutdown() void SwiftGuiStd::performGracefulShutdown()
{ {
// clean up GUI
this->ui->comp_MainInfoArea->dockAllWidgets();
this->ui->comp_InvisibleInfoArea->dockAllWidgets();
// close info window
if (this->m_compInfoWindow)
{
this->m_compInfoWindow->close();
this->m_compInfoWindow = nullptr;
}
if (!this->m_init) { return; } if (!this->m_init) { return; }
this->m_init = false; this->m_init = false;
// tell GUI components to shut down
emit requestGracefulShutdown();
// shut down all timers // shut down all timers
this->stopAllTimers(true); this->stopAllTimers(true);
// tell context GUI is going down
if (this->getIContextApplication())
{
this->getIContextApplication()->notifyAboutComponentChange(IContextApplication::ApplicationGui, IContextApplication::ApplicationStops);
}
// if we have a context, we shut some things down // if we have a context, we shut some things down
if (this->m_contextNetworkAvailable) if (this->m_contextNetworkAvailable)
{ {
@@ -111,6 +91,32 @@ void SwiftGuiStd::performGracefulShutdown()
this->getIContextNetwork()->disconnect(this); // avoid any status update signals, etc. this->getIContextNetwork()->disconnect(this); // avoid any status update signals, etc.
} }
} }
// clean up GUI
this->ui->comp_MainInfoArea->dockAllWidgets();
this->ui->comp_InvisibleInfoArea->dockAllWidgets();
// close info window
if (this->m_compInfoWindow)
{
this->m_compInfoWindow->close();
this->m_compInfoWindow = nullptr;
}
// allow some other parts to react
QApplication::processEvents(QEventLoop::AllEvents, 100);
// tell GUI components to shut down
emit requestGracefulShutdown();
// tell context GUI is going down
if (this->getIContextApplication())
{
this->getIContextApplication()->notifyAboutComponentChange(IContextApplication::ApplicationGui, IContextApplication::ApplicationStops);
}
// allow some other parts to react
QApplication::processEvents(QEventLoop::AllEvents, 100);
} }
void SwiftGuiStd::closeEvent(QCloseEvent *event) void SwiftGuiStd::closeEvent(QCloseEvent *event)