mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
GUI improvements: naming and better user experience during shutdown
This commit is contained in:
committed by
Mathew Sutcliffe
parent
7b1beaf02d
commit
32e65669a3
@@ -54,7 +54,7 @@
|
||||
<string>Network</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>nt.</string>
|
||||
<string>net</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -73,7 +73,7 @@
|
||||
<string>Simulator</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>sm.</string>
|
||||
<string>sim</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -93,7 +93,7 @@
|
||||
<string>Mappings ready</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>mp.</string>
|
||||
<string>map</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -71,32 +71,12 @@ void SwiftGuiStd::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
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; }
|
||||
this->m_init = false;
|
||||
|
||||
// tell GUI components to shut down
|
||||
emit requestGracefulShutdown();
|
||||
|
||||
// shut down all timers
|
||||
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 (this->m_contextNetworkAvailable)
|
||||
{
|
||||
@@ -111,6 +91,32 @@ void SwiftGuiStd::performGracefulShutdown()
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user