diff options
author | saturneric <[email protected]> | 2025-02-03 19:32:05 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-02-03 19:32:05 +0000 |
commit | ef68697b1833d86f9ab2d0ae87257579b24603a8 (patch) | |
tree | 0255b5f14985cfaa8e63906400eda8a55f9c2851 | |
parent | fix: correct tab edit orders (diff) | |
download | GpgFrontend-ef68697b1833d86f9ab2d0ae87257579b24603a8.tar.gz GpgFrontend-ef68697b1833d86f9ab2d0ae87257579b24603a8.zip |
feat: ask user if automate check update on first startup
-rw-r--r-- | src/ui/main_window/MainWindow.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp index 5cabd52d..d0f9b7db 100644 --- a/src/ui/main_window/MainWindow.cpp +++ b/src/ui/main_window/MainWindow.cpp @@ -138,8 +138,22 @@ void MainWindow::Init() noexcept { // check version information auto settings = GetSettings(); + + // ask if user wants to check update when the app boot + if (!settings.contains("network/prohibit_update_checking")) { + QMessageBox::StandardButton reply; + reply = QMessageBox::question( + this, tr("Update Check"), + tr("Do you want to check for updates at each startup?"), + QMessageBox::Yes | QMessageBox::No); + + auto prohibit_update_checking = (reply == QMessageBox::No); + settings.setValue("network/prohibit_update_checking", + prohibit_update_checking); + } + auto prohibit_update_checking = - settings.value("network/prohibit_update_checking").toBool(); + settings.value("network/prohibit_update_checking", false).toBool(); if (!prohibit_update_checking) { Module::ListenRTPublishEvent( this, kVersionCheckingModuleID, "version.loading_done", @@ -158,7 +172,6 @@ void MainWindow::Init() noexcept { // check if need to open wizard window auto show_wizard = settings.value("wizard/show_wizard", true).toBool(); if (show_wizard) slot_start_wizard(); - } catch (...) { LOG_W() << tr("Critical error occur while loading GpgFrontend."); QMessageBox::critical( |