diff options
author | saturneric <[email protected]> | 2025-02-03 19:41:16 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-02-03 19:41:16 +0000 |
commit | 349269cadaa757622403279c94c3f181cf9130ac (patch) | |
tree | 33ad72d79b9ef736e7b4f617ad978a543f4de6cc /src/ui/main_window/MainWindow.cpp | |
parent | Merge branch 'develop' (diff) | |
parent | translation: update zh_CN and de_DE (diff) | |
download | GpgFrontend-349269cadaa757622403279c94c3f181cf9130ac.tar.gz GpgFrontend-349269cadaa757622403279c94c3f181cf9130ac.zip |
Merge branch 'develop'
Diffstat (limited to 'src/ui/main_window/MainWindow.cpp')
-rw-r--r-- | src/ui/main_window/MainWindow.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp index 319a1ad9..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( @@ -279,15 +292,17 @@ void MainWindow::closeEvent(QCloseEvent* event) { } } -auto MainWindow::create_action( - const QString& id, const QString& name, const QString& icon, - const QString& too_tip, const QList<QKeySequence>& shortcuts) -> QAction* { +auto MainWindow::create_action(const QString& id, const QString& name, + const QString& icon, const QString& too_tip, + const QContainer<QKeySequence>& shortcuts) + -> QAction* { auto* action = new QAction(name, this); action->setIcon(QIcon(icon)); action->setToolTip(too_tip); if (!shortcuts.isEmpty()) { - action->setShortcuts(shortcuts); + action->setShortcuts( + QList<QKeySequence>{shortcuts.cbegin(), shortcuts.cend()}); } buffered_actions_.insert(id, {action}); |