mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-15 03:45:41 +08:00
Fixes in GUI: start/stop timers
This commit is contained in:
@@ -73,17 +73,7 @@ void MainWindow::gracefulShutdown()
|
||||
}
|
||||
|
||||
// shut down all timers
|
||||
this->stopUpdateTimers(true);
|
||||
if (this->m_timerContextWatchdog)
|
||||
{
|
||||
this->m_timerContextWatchdog->stop();
|
||||
this->m_timerContextWatchdog->disconnect(this);
|
||||
}
|
||||
if (this->m_timerCollectedCockpitUpdates)
|
||||
{
|
||||
this->m_timerCollectedCockpitUpdates->stop();
|
||||
this->m_timerCollectedCockpitUpdates->disconnect(this);
|
||||
}
|
||||
this->stopAllTimers(true);
|
||||
|
||||
// if we have a context, we shut some things down
|
||||
if (this->m_contextNetworkAvailable)
|
||||
@@ -253,6 +243,7 @@ bool MainWindow::isContextAudioAvailableCheck()
|
||||
*/
|
||||
void MainWindow::displayStatusMessage(const CStatusMessage &statusMessage)
|
||||
{
|
||||
if (!this->m_init) return;
|
||||
this->ui->sb_MainStatusBar->show();
|
||||
this->m_timerStatusBar->start(3000);
|
||||
this->m_statusBarIcon->setPixmap(statusMessage.toIcon());
|
||||
@@ -271,7 +262,7 @@ void MainWindow::displayStatusMessage(const CStatusMessage &statusMessage)
|
||||
*/
|
||||
void MainWindow::displayStatusMessages(const CStatusMessageList &messages)
|
||||
{
|
||||
if (messages.isEmpty()) return;
|
||||
if (!this->m_init || messages.isEmpty()) return;
|
||||
foreach(CStatusMessage msg, messages)
|
||||
{
|
||||
this->displayStatusMessage(msg);
|
||||
|
||||
@@ -232,6 +232,12 @@ private:
|
||||
*/
|
||||
void stopUpdateTimers(bool disconnect = false);
|
||||
|
||||
/*!
|
||||
* \brief Stop all timers
|
||||
* \param disconnect also disconnect signal/slots
|
||||
*/
|
||||
void stopAllTimers(bool disconnect);
|
||||
|
||||
//! Currently selected SELCAL code
|
||||
QString getSelcalCode() const;
|
||||
|
||||
@@ -244,7 +250,6 @@ private:
|
||||
//! Update simulator page with latest user aircraft data
|
||||
void updateSimulatorData();
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
//
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "blackgui/atcstationlistmodel.h"
|
||||
#include "blackgui/keyboardkeylistmodel.h"
|
||||
#include "blackmisc/avselcal.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QSizeGrip>
|
||||
#include <QHBoxLayout>
|
||||
@@ -325,12 +326,24 @@ void MainWindow::stopUpdateTimers(bool disconnect)
|
||||
this->m_timerUpdateAircraftsInRange->stop();
|
||||
this->m_timerUpdateAtcStationsOnline->stop();
|
||||
this->m_timerUpdateUsers->stop();
|
||||
this->m_timerAudioTests->stop();
|
||||
this->m_timerSimulator->stop();
|
||||
if (!disconnect) return;
|
||||
this->disconnect(this->m_timerUpdateAircraftsInRange);
|
||||
this->disconnect(this->m_timerUpdateAtcStationsOnline);
|
||||
this->disconnect(this->m_timerUpdateUsers);
|
||||
}
|
||||
|
||||
void MainWindow::stopAllTimers(bool disconnect)
|
||||
{
|
||||
this->m_timerStatusBar->stop();
|
||||
this->m_timerContextWatchdog->stop();
|
||||
this->m_timerCollectedCockpitUpdates->stop();
|
||||
this->m_timerAudioTests->stop();
|
||||
this->m_timerSimulator->stop();
|
||||
this->stopUpdateTimers(disconnect);
|
||||
if (!disconnect) return;
|
||||
this->disconnect(this->m_timerStatusBar);
|
||||
this->disconnect(this->m_timerContextWatchdog);
|
||||
this->disconnect(this->m_timerCollectedCockpitUpdates);
|
||||
this->disconnect(this->m_timerAudioTests);
|
||||
this->disconnect(this->m_timerSimulator);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user