diff options
author | saturneric <[email protected]> | 2024-12-03 09:08:52 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-12-03 09:08:52 +0000 |
commit | 46d376d5ba64dd7856709f4ac9f6dd22ed934144 (patch) | |
tree | b80211455e70e7bebd6d92f8be6d3239d0cd9765 /src/ui/main_window/MainWindowSlotFunction.cpp | |
parent | fix: integrated modules loading path (diff) | |
download | GpgFrontend-46d376d5ba64dd7856709f4ac9f6dd22ed934144.tar.gz GpgFrontend-46d376d5ba64dd7856709f4ac9f6dd22ed934144.zip |
fix: discovered issues by testing
Diffstat (limited to '')
-rw-r--r-- | src/ui/main_window/MainWindowSlotFunction.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index b2b73d96..f214efbd 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -290,6 +290,8 @@ void MainWindow::SlotOpenFile(const QString& path) { } void MainWindow::slot_version_upgrade_notify() { + if (!Module::IsModuleActivate(kVersionCheckingModuleID)) return; + auto is_loading_done = Module::RetrieveRTValueTypedOrDefault<>( kVersionCheckingModuleID, "version.loading_done", false); if (!is_loading_done) { @@ -323,6 +325,13 @@ void MainWindow::slot_version_upgrade_notify() { statusBar()->showMessage( tr("GpgFrontend Upgradeable (New Version: %1).").arg(latest_version), 30000); + + auto* b = new QToolButton(); + b->setToolButtonStyle(Qt::ToolButtonIconOnly); + b->setIcon(QIcon(":/icons/upgrade.png")); + connect(b, &QPushButton::clicked, + [=]() { (new AboutDialog(tr("Update"), this))->show(); }); + statusBar()->addPermanentWidget(b); } else if (is_current_a_withdrawn_version) { auto response = QMessageBox::warning( this, tr("Withdrawn Version"), @@ -338,13 +347,19 @@ void MainWindow::slot_version_upgrade_notify() { QDesktopServices::openUrl( QUrl("https://github.com/saturneric/GpgFrontend/releases/latest")); } - } else if (!is_current_version_released) { statusBar()->showMessage( tr("This may be a BETA Version (Latest Stable Version: %1).") .arg(latest_version), 30000); + auto* b = new QToolButton(); + b->setToolButtonStyle(Qt::ToolButtonIconOnly); + b->setIcon(QIcon(":/icons/warning-filling.png")); + connect(b, &QPushButton::clicked, + [=]() { (new AboutDialog(tr("Update"), this))->show(); }); + statusBar()->addPermanentWidget(b); + } else if (is_git_commit_hash_mismatch) { QMessageBox::information( this, tr("Commit Hash Mismatch"), |