From a056f2186de2470d4328bd1cd682e5e484af4587 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Sun, 2 Jan 2022 11:40:22 +0800 Subject: (core, ui): add & modify core and ui 1. add init functions for core. 2. add non ascii settings. 3. fit ui with this version of core. --- src/ui/help/AboutDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/help/AboutDialog.cpp') diff --git a/src/ui/help/AboutDialog.cpp b/src/ui/help/AboutDialog.cpp index 93e7ccb3..5ee90e23 100644 --- a/src/ui/help/AboutDialog.cpp +++ b/src/ui/help/AboutDialog.cpp @@ -86,8 +86,8 @@ InfoTab::InfoTab(QWidget* parent) : QWidget(parent) { _("or send a mail to my mailing list at") + " eric@bktus.com." + "

" + _("Built with Qt") + " " + qVersion() + " " + _("and GPGME") + " " + - GpgFrontend::GpgContext::getGpgmeVersion().c_str() + "
" + - _("Built at") + " " + BUILD_TIMESTAMP + ""); + GpgFrontend::GpgContext::GetInstance().GetInfo().GpgMEVersion.c_str() + + "
" + _("Built at") + " " + BUILD_TIMESTAMP + ""); auto* layout = new QGridLayout(); auto* pixmapLabel = new QLabel(); -- cgit v1.2.3 From 2f64e4300b77f74cc4a7f0f50dbfe87862b72b95 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Tue, 4 Jan 2022 06:10:04 +0800 Subject: (core, ui): version system upgrade. 1. can notice user withdraw version now. 2. fix software not restart when signal caught. 3. improve ui. --- src/ui/help/AboutDialog.cpp | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'src/ui/help/AboutDialog.cpp') diff --git a/src/ui/help/AboutDialog.cpp b/src/ui/help/AboutDialog.cpp index 5ee90e23..a3db6eda 100644 --- a/src/ui/help/AboutDialog.cpp +++ b/src/ui/help/AboutDialog.cpp @@ -163,14 +163,6 @@ UpdateTab::UpdateTab(QWidget* parent) : QWidget(parent) { latestVersionLabel->setWordWrap(true); upgradeLabel = new QLabel(); - upgradeLabel->setText( - "
" + - QString(_("The current version is less than the latest version on " - "github.")) + - "
" + _("Please click") + - " " + - _("Here") + " " + _("to download the latest version.") + "
"); upgradeLabel->setWordWrap(true); upgradeLabel->setOpenExternalLinks(true); upgradeLabel->setHidden(true); @@ -196,11 +188,7 @@ void UpdateTab::getLatestVersion() { LOG(INFO) << _("try to get latest version"); - QString base_url = - "https://api.github.com/repos/saturneric/gpgfrontend/releases/latest"; - QNetworkRequest request; - request.setUrl(QUrl(base_url)); - auto version_thread = new VersionCheckThread(manager->get(request)); + auto version_thread = new VersionCheckThread(); connect(version_thread, SIGNAL(finished()), version_thread, SLOT(deleteLater())); @@ -210,16 +198,33 @@ void UpdateTab::getLatestVersion() { version_thread->start(); } -void UpdateTab::slotShowVersionStatus(const QString& current, - const QString& server) { +void UpdateTab::slotShowVersionStatus(const SoftwareVersion& version) { this->pb->setHidden(true); - latestVersionLabel->setText("
" + QString(_("Latest Version From Github")) + ": " + - server + "
"); - - if (current < server) { + version.latest_version.c_str() + ""); + + if (version.NeedUpgrade()) { + upgradeLabel->setText( + "
" + + QString(_("The current version is less than the latest version on " + "github.")) + + "
" + _("Please click") + + " " + + _("Here") + " " + _("to download the latest stable version.") + + "
"); upgradeLabel->show(); + } else if (version.VersionWithDrawn()) { + upgradeLabel->setText( + "
" + + QString(_("This version has serious problems and has been withdrawn. " + "Please stop using it immediately.")) + + "
" + _("Please click") + + " " + + _("Here") + " " + _("to download the latest stable version.") + + "
"); } } -- cgit v1.2.3 From f297a701bbcfa5f0586cc02af29a4e9af281910c Mon Sep 17 00:00:00 2001 From: Saturneric Date: Tue, 4 Jan 2022 18:49:11 +0800 Subject: (core, ui): fixed known bugs for v2.0.4-beta.1. 1. longer expire date for keygen. 2. version system improved and fixed. 3. include ui text not translated. 4. improve ui. --- src/ui/help/AboutDialog.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ui/help/AboutDialog.cpp') diff --git a/src/ui/help/AboutDialog.cpp b/src/ui/help/AboutDialog.cpp index a3db6eda..78ff5557 100644 --- a/src/ui/help/AboutDialog.cpp +++ b/src/ui/help/AboutDialog.cpp @@ -225,6 +225,19 @@ void UpdateTab::slotShowVersionStatus(const SoftwareVersion& version) { "href=\"https://github.com/saturneric/GpgFrontend/releases\">" + _("Here") + " " + _("to download the latest stable version.") + ""); + upgradeLabel->show(); + } else if (!version.CurrentVersionReleased()) { + upgradeLabel->setText( + "
" + + QString(_("This version has not been released yet, it may be a beta " + "version. If you are not a tester and care about version " + "stability, please do not use this version.")) + + "
" + _("Please click") + + " " + + _("Here") + " " + _("to download the latest stable version.") + + "
"); + upgradeLabel->show(); } } -- cgit v1.2.3