diff --git a/src/blackgui/components/dbloadoverviewcomponent.cpp b/src/blackgui/components/dbloadoverviewcomponent.cpp index 475fa0a21..312425bb3 100644 --- a/src/blackgui/components/dbloadoverviewcomponent.cpp +++ b/src/blackgui/components/dbloadoverviewcomponent.cpp @@ -43,12 +43,25 @@ namespace BlackGui connect(ui->pb_ReloadDistributors, &QPushButton::pressed, this, &CDbLoadOverviewComponent::ps_reloadPressed); connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbLoadOverviewComponent::ps_dataLoaded); - QTimer::singleShot(2000, this, &CDbLoadOverviewComponent::ps_setValues); + // QTimer::singleShot(2000, this, &CDbLoadOverviewComponent::ps_setValues); } CDbLoadOverviewComponent::~CDbLoadOverviewComponent() { } + void CDbLoadOverviewComponent::display() + { + if (this->isInitialized()) + { + this->ps_setValues(); + } + else + { + this->showLoading(); + QTimer::singleShot(1000, this, &CDbLoadOverviewComponent::ps_setValues); + } + } + void CDbLoadOverviewComponent::ps_setValues() { if (!sGui) { return; } @@ -87,6 +100,7 @@ namespace BlackGui const QString url = sGui->getGlobalSetup().getDbHomePageUrl().getFullUrl(); ui->lbl_DatabaseUrl->setText(urlHtml.arg(url)); ui->lbl_DatabaseUrl->setToolTip(url); + if (this->m_loadIndicator) { this->m_loadIndicator->stopAnimation(); } } void CDbLoadOverviewComponent::showLoading() @@ -100,6 +114,11 @@ namespace BlackGui this->m_loadIndicator->startAnimation(true); } + bool CDbLoadOverviewComponent::isInitialized() const + { + return !ui->le_AircraftIcaoCacheCount->text().isEmpty(); + } + QString CDbLoadOverviewComponent::formattedTimestamp(const QDateTime &dateTime) { if (!dateTime.isValid()) { return "-"; } @@ -152,7 +171,6 @@ namespace BlackGui if (!CEntityFlags::anySwiftDbEntity(entity)) { return; } if (state == CEntityFlags::ReadFinished || state == CEntityFlags::ReadFinishedRestricted) { - if (this->m_loadIndicator) { this->m_loadIndicator->stopAnimation(); } this->m_reloading = false; this->ps_setValues(); } diff --git a/src/blackgui/components/dbloadoverviewcomponent.h b/src/blackgui/components/dbloadoverviewcomponent.h index c12dccfd9..9649b00fc 100644 --- a/src/blackgui/components/dbloadoverviewcomponent.h +++ b/src/blackgui/components/dbloadoverviewcomponent.h @@ -37,6 +37,9 @@ namespace BlackGui //! Destructor virtual ~CDbLoadOverviewComponent(); + //! Initialize + void display(); + private: QScopedPointer ui; BlackGui::CLoadIndicator *m_loadIndicator = nullptr; //!< load indicator if needed @@ -45,6 +48,9 @@ namespace BlackGui //! Show loading void showLoading(); + //! Values at least set once + bool isInitialized() const; + //! Timestamp static QString formattedTimestamp(const QDateTime &dateTime); diff --git a/src/blackgui/components/infobarwebreadersstatuscomponent.cpp b/src/blackgui/components/infobarwebreadersstatuscomponent.cpp index 6ebcc9899..d8a2c97bb 100644 --- a/src/blackgui/components/infobarwebreadersstatuscomponent.cpp +++ b/src/blackgui/components/infobarwebreadersstatuscomponent.cpp @@ -49,7 +49,8 @@ namespace BlackGui void CInfoBarWebReadersStatusBase::initLeds() { - CLedWidget::LedShape shape = CLedWidget::Circle; + CLedWidget::LedShape shape = CLedWidget::Rounded; + this->led_SwiftDb->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "DB online", "DB offline", 14); this->led_DataReady->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "all data ready", "data missing", 14); this->led_IcaoAircraft->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Red, shape, "reading", "idle", "failed", 14); diff --git a/src/blackgui/components/infobarwebreadersstatussmallcomponent.ui b/src/blackgui/components/infobarwebreadersstatussmallcomponent.ui index d5c24ffe7..13d733e5c 100644 --- a/src/blackgui/components/infobarwebreadersstatussmallcomponent.ui +++ b/src/blackgui/components/infobarwebreadersstatussmallcomponent.ui @@ -6,7 +6,7 @@ 0 0 - 381 + 340 20 @@ -42,19 +42,6 @@ - - - - Mappings ready - - - | data - - - 6 - - - diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 233b6e2ee..d62361a19 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -46,6 +46,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : connect(ui->tb_SwiftGui, &QPushButton::pressed, this, &CSwiftLauncher::ps_startButtonPressed); connect(ui->tb_Database, &QPushButton::pressed, this, &CSwiftLauncher::ps_startButtonPressed); connect(ui->tb_BackToMain, &QToolButton::pressed, this, &CSwiftLauncher::ps_showMainPage); + connect(ui->tb_Launcher, &QToolBox::currentChanged, this, &CSwiftLauncher::ps_tabChanged); // use version signal as trigger for completion this->ps_loadedUpdateInfo(true); // defaults from settings, overridden by signal/slot when changed @@ -405,6 +406,14 @@ void CSwiftLauncher::ps_showMainPage() this->ui->sw_SwiftLauncher->setCurrentWidget(this->ui->pg_SwiftLauncherMain); } +void CSwiftLauncher::ps_tabChanged(int current) +{ + if (current == static_cast(PageUpdates)) + { + ui->comp_DataUpdates->display(); + } +} + void CSwiftLauncher::ps_showLogPage() { this->ui->sw_SwiftLauncher->setCurrentWidget(this->ui->pg_SwiftLauncherLog); diff --git a/src/swiftlauncher/swiftlauncher.h b/src/swiftlauncher/swiftlauncher.h index de7ea4dff..5384cb78c 100644 --- a/src/swiftlauncher/swiftlauncher.h +++ b/src/swiftlauncher/swiftlauncher.h @@ -40,6 +40,16 @@ class CSwiftLauncher : Q_INTERFACES(BlackGui::IMainWindowAccess) public: + + //! Pages + enum Pages + { + PageNews = 0, + PageWindowType, + PageCoreMode, + PageUpdates + }; + //! Constructor explicit CSwiftLauncher(QWidget *parent = nullptr); @@ -151,6 +161,9 @@ private slots: //! Show set main page void ps_showMainPage(); + //! Tab changed + void ps_tabChanged(int current); + //! Show the log page void ps_showLogPage(); }; diff --git a/src/swiftlauncher/swiftlauncher.ui b/src/swiftlauncher/swiftlauncher.ui index 657d482c5..d02c7ef28 100644 --- a/src/swiftlauncher/swiftlauncher.ui +++ b/src/swiftlauncher/swiftlauncher.ui @@ -413,7 +413,26 @@ Check for updates - + + + 9 + + + 9 + + + + + QFrame::StyledPanel + + + QFrame::Raised + + fr_SoftwareUpdates + fr_SoftwareUpdates + fr_SoftwareUpdates + + @@ -422,7 +441,19 @@ QFrame::Raised - + + + 2 + + + 2 + + + 2 + + + 2 + @@ -533,17 +564,7 @@ - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - + QFrame::StyledPanel @@ -749,7 +770,19 @@ p, li { white-space: pre-wrap; } - + + + 3 + + + 3 + + + 3 + + + 3 +