From 1c95ebf2cbb4d4c841141f568eb394f4091b6ba7 Mon Sep 17 00:00:00 2001 From: saturneric Date: Thu, 24 Sep 2026 23:25:25 +0200 Subject: feat(update): track unseen releases without prompting - replace startup dialogs with quiet background update checks - track and persist the latest update seen by the user - expose update attention state for badges and UI indicators - acknowledge updates when the update page is opened - retain acknowledgements across failures, restarts, and rebuilds - expand tests for attention, persistence, and rediscovered releases --- src/m_ver_check/VersionCheckingModule.cpp | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'src/m_ver_check/VersionCheckingModule.cpp') diff --git a/src/m_ver_check/VersionCheckingModule.cpp b/src/m_ver_check/VersionCheckingModule.cpp index 73cf9fa..4fe5bd7 100644 --- a/src/m_ver_check/VersionCheckingModule.cpp +++ b/src/m_ver_check/VersionCheckingModule.cpp @@ -115,26 +115,6 @@ void OpenUpdateDialog() { {gf::cmd::ViewRef{QStringLiteral(GF_MODULE_ID ".update")}}); } -/// Once per run: the startup check's answer, or a fresh stored one. -void CheckAtStartup() { - auto* checker = VersionChecker(); - if (checker == nullptr) return; - - auto watch = std::make_shared(); - const auto decide = [checker, watch] { - if (checker->State().checking) return; - QObject::disconnect(*watch); - if (ShouldPromptOnStartup(checker->State())) { - LOG_INFO("a newer release is available, notifying user"); - OpenUpdateDialog(); - } - }; - - *watch = QObject::connect(checker, &UpdateChecker::Changed, checker, decide); - checker->Start(CheckMode::kIfStale); - decide(); -} - /// The update dialog, in a frame the Host owns. class UpdateWidget : public QWidget, public gf::ui::DialogWidget { public: @@ -273,7 +253,11 @@ auto OnApplicationLoaded(const GFEvent& /*event*/) -> GFEventResult { return GFEventResult::Ok(); } - OnGuiThread(&CheckAtStartup); + // In the background, and quietly: a newer release shows as a badge on + // Help > Check for Updates, never as a window. + OnGuiThread([] { + if (auto* checker = VersionChecker()) checker->Start(CheckMode::kIfStale); + }); // An observation, answered at once: the check runs on its own. return GFEventResult::Ok(); -- cgit