diff --git a/src/blackcore/data/updateinfo.cpp b/src/blackcore/data/updateinfo.cpp index 2a7046ba9..ade73d4ce 100644 --- a/src/blackcore/data/updateinfo.cpp +++ b/src/blackcore/data/updateinfo.cpp @@ -40,6 +40,11 @@ namespace BlackCore return CBuildConfig::isBetaTest() ? getLatestVersionBeta() : getLatestVersionStable(); } + QString CUpdateInfo::getChannel() const + { + return CBuildConfig::isBetaTest() ? "beta" : "stable"; + } + bool CUpdateInfo::hasSameType(const CUpdateInfo &otherDownload) const { return this->isDevelopment() == otherDownload.isDevelopment(); @@ -136,6 +141,5 @@ namespace BlackCore break; } } - } // ns } // ns diff --git a/src/blackcore/data/updateinfo.h b/src/blackcore/data/updateinfo.h index 6201e625b..70c84a064 100644 --- a/src/blackcore/data/updateinfo.h +++ b/src/blackcore/data/updateinfo.h @@ -69,6 +69,9 @@ namespace BlackCore //! Latest version QString getLatestVersion() const; + //! Version channel (Beta, Stable) + QString getChannel() const; + //! Last supported version stable const QString &getLastSupportedVersionStable() const { return m_lastSupportedVersionStable; } diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 24ba57ec8..72471cf93 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -48,6 +48,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : connect(ui->tb_BackToMain, &QToolButton::pressed, this, &CSwiftLauncher::ps_showMainPage); // use version signal as trigger for completion + this->ps_loadedUpdateInfo(true); // defaults from settings, overridden by signal/slot when changed connect(sGui, &CApplication::updateInfoAvailable, this, &CSwiftLauncher::ps_loadedUpdateInfo); new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this, SLOT(ps_showLogPage())); @@ -307,7 +308,7 @@ void CSwiftLauncher::ps_loadedUpdateInfo(bool success) return; } - const CUpdateInfo updateInfo(this->m_updateInfo.getThreadLocal()); + const CUpdateInfo updateInfo(this->m_updateInfo.get()); const QString latestVersion(updateInfo.getLatestVersion()) ; // need to get this from somewhere CFailoverUrlList downloadUrls(updateInfo.getDownloadUrls()); bool newVersionAvailable = CVersion::isNewerVersion(latestVersion) && !downloadUrls.isEmpty(); diff --git a/src/swiftlauncher/swiftlauncher.ui b/src/swiftlauncher/swiftlauncher.ui index 2df2759e1..d0eedbf2f 100644 --- a/src/swiftlauncher/swiftlauncher.ui +++ b/src/swiftlauncher/swiftlauncher.ui @@ -78,7 +78,7 @@ - 0 + 3 6 @@ -116,8 +116,8 @@ 0 0 - 199 - 63 + 355 + 301 @@ -181,8 +181,8 @@ 0 0 - 277 - 222 + 341 + 309 @@ -406,104 +406,140 @@ 0 0 - 283 - 198 + 355 + 301 Check for updates - - - - - - + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + true + + + + + - You are running the latest version! + This version: + + + + + + + Latest version: + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + You are running the latest version! + + + + + + + + + + true + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + New version available + + + + + + + URL goes here + + + + + + + + + + check for updates - - - - - - - A new version is available here: - - - - - - - http://www.foobar.com - - - - - - - - - - true + + + + QFrame::StyledPanel + + + QFrame::Raised - - - - Latest version: - - - - - - - This version: - - - - - - - check for updates - - - - - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - + fr_SoftwareUpdates + lbl_NoNewVersion + fr_DataUpdates 0 0 - 98 - 88 + 355 + 301 @@ -738,8 +774,8 @@ p, li { white-space: pre-wrap; } - +