aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowSlotFunction.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-01-03 22:10:04 +0000
committerSaturneric <[email protected]>2022-01-03 22:10:04 +0000
commit2f64e4300b77f74cc4a7f0f50dbfe87862b72b95 (patch)
tree0d56d21ed78b5b1377681338619ac79c32386335 /src/ui/main_window/MainWindowSlotFunction.cpp
parent<fix, feature>(core, ui): key package import. (diff)
downloadGpgFrontend-2f64e4300b77f74cc4a7f0f50dbfe87862b72b95.tar.gz
GpgFrontend-2f64e4300b77f74cc4a7f0f50dbfe87862b72b95.zip
<fix, feature>(core, ui): version system upgrade.
1. can notice user withdraw version now. 2. fix software not restart when signal caught. 3. improve ui.
Diffstat (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp')
-rw-r--r--src/ui/main_window/MainWindowSlotFunction.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp
index 53f7dd9c..09f29958 100644
--- a/src/ui/main_window/MainWindowSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowSlotFunction.cpp
@@ -499,13 +499,12 @@ void MainWindow::uploadKeyToServer() {
void MainWindow::slotOpenFile(QString& path) { edit->slotOpenFile(path); }
-void MainWindow::slotVersionUpgrade(const QString& currentVersion,
- const QString& latestVersion) {
+void MainWindow::slotVersionUpgrade(const SoftwareVersion& version) {
LOG(INFO) << _("called");
- if (currentVersion < latestVersion) {
+ if (version.NeedUpgrade()) {
statusBar()->showMessage(
QString(_("GpgFrontend Upgradeable (New Version: %1)."))
- .arg(latestVersion),
+ .arg(version.latest_version.c_str()),
30000);
auto update_button = new QPushButton("Update GpgFrontend", this);
connect(update_button, &QPushButton::clicked, [=]() {
@@ -513,17 +512,19 @@ void MainWindow::slotVersionUpgrade(const QString& currentVersion,
about_dialog->show();
});
statusBar()->addPermanentWidget(update_button, 0);
- } else if (currentVersion > latestVersion) {
+ } else if (version.VersionWithDrawn()) {
QMessageBox::warning(
- this, _("Unreleased Version"),
+ this, _("Withdrawn Version"),
QString(
- _("This version(%1) has not been officially released and is not "
- "recommended for use in a production environment. <br/>"))
- .arg(currentVersion) +
- QString(
- _("You can download the latest version(%1) on Github Releases "
- "Page.<br/>"))
- .arg(latestVersion));
+ _("This version(%1) may have been withdrawn by the developer due "
+ "to serious problems. Please stop using this version "
+ "immediately and use the latest stable version."))
+ .arg(version.current_version.c_str()) +
+ "<br/>" +
+ QString(_("You can download the latest stable version(%1) on "
+ "Github Releases "
+ "Page.<br/>"))
+ .arg(version.latest_version.c_str()));
}
}