refs #799, adjusted swift client reg. the settings updates

This commit is contained in:
Klaus Basan
2016-11-11 20:42:35 +01:00
parent df64f31dbf
commit bb0a96749e
5 changed files with 26 additions and 35 deletions

View File

@@ -38,7 +38,6 @@
class QCloseEvent;
class QEvent;
class QMouseEvent;
class QWidget;
namespace BlackGui
@@ -327,7 +326,7 @@ void SwiftGuiStd::updateGuiStatusInformation()
}
// update status fields
QString s = QString("network: %1").arg(network);
const QString s = QString("network: %1").arg(network);
ui->comp_InfoBarStatus->setDBusTooltip(s);
}

View File

@@ -105,9 +105,9 @@ private:
QScopedPointer<Ui::SwiftGuiStd> ui;
// if I pass the parent, the dialog is always center over the parent
QScopedPointer<BlackGui::Components::CNavigatorDialog> m_navigator{new BlackGui::Components::CNavigatorDialog()};
bool m_init = false;
BlackGui::CManagedStatusBar m_statusBar;
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui };
bool m_init = false;
BlackGui::CManagedStatusBar m_statusBar;
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui };
// contexts
bool m_coreAvailable = false;
@@ -169,12 +169,6 @@ private:
//! \param mainPage index to be checked
bool isMainPageSelected(MainPageIndex mainPage) const;
//! Start all update timers
void startUpdateTimersWhenConnected();
//! Stop all update timers
void stopUpdateTimersWhenDisconnected();
//! Stop all timers
//! \param disconnect also disconnect signal/slots
void stopAllTimers(bool disconnectSignalSlots);

View File

@@ -141,9 +141,6 @@ void SwiftGuiStd::init()
ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(sGui->swiftVersionString());
ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(CBuildConfig::compiledWithInfo());
// update timers
this->startUpdateTimersWhenConnected();
// do this as last statement, so it can be used as flag
// whether init has been completed
this->setVisible(true);
@@ -205,11 +202,6 @@ void SwiftGuiStd::initGuiSignals()
connect(ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedWindowsOpacity, this, &SwiftGuiStd::ps_onChangedWindowOpacity);
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &SwiftGuiStd::ps_onStyleSheetsChanged);
// sliders
connect(ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedUsersUpdateInterval, ui->comp_MainInfoArea->getUserComponent(), &CUserComponent::setUpdateIntervalSeconds);
connect(ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedAircraftUpdateInterval, ui->comp_MainInfoArea->getAircraftComponent(), &CAircraftComponent::setUpdateIntervalSeconds);
connect(ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedAtcStationsUpdateInterval, ui->comp_MainInfoArea->getAtcStationComponent(), &::CAtcStationComponent::setUpdateIntervalSeconds);
// login
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
@@ -244,24 +236,9 @@ void SwiftGuiStd::initialDataReads()
CLogMessage(this).info("Initial data read");
}
void SwiftGuiStd::startUpdateTimersWhenConnected()
{
ui->comp_MainInfoArea->getAtcStationComponent()->setUpdateIntervalSeconds(ui->comp_MainInfoArea->getSettingsComponent()->getAtcUpdateIntervalSeconds());
ui->comp_MainInfoArea->getAircraftComponent()->setUpdateIntervalSeconds(ui->comp_MainInfoArea->getSettingsComponent()->getAircraftUpdateIntervalSeconds());
ui->comp_MainInfoArea->getUserComponent()->setUpdateIntervalSeconds(ui->comp_MainInfoArea->getSettingsComponent()->getUsersUpdateIntervalSeconds());
}
void SwiftGuiStd::stopUpdateTimersWhenDisconnected()
{
ui->comp_MainInfoArea->getAtcStationComponent()->stopTimer();
ui->comp_MainInfoArea->getAircraftComponent()->stopTimer();
ui->comp_MainInfoArea->getUserComponent()->stopTimer();
}
void SwiftGuiStd::stopAllTimers(bool disconnectSignalSlots)
{
this->m_timerContextWatchdog->stop();
this->stopUpdateTimersWhenDisconnected();
if (!disconnectSignalSlots) { return; }
this->disconnect(this->m_timerContextWatchdog);
}