From b5cd5eac82b6bbd8a00fb39c045d473d6517b5f4 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Sat, 25 Dec 2021 09:54:57 +0800 Subject: (core, test): core improved and test gpg alone mode 1. let modules known their channels. 2. let factory create a channel. 3. reduce dumplicate code. 4. add type check for function object. 5. test gpg alone mode. 6. remove some asserts. 7. rename importexportor to importexporter. 8. move args in gpg context constructor to a struct. --- src/ui/main_window/MainWindowSlotFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp') diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index 2dd3f842..5671d943 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -37,7 +37,7 @@ #include "gpg/function/BasicOperator.h" #include "gpg/function/GpgKeyGetter.h" -#include "gpg/function/GpgKeyImportExportor.h" +#include "gpg/function/GpgKeyImportExporter.h" #include "ui/UserInterfaceUtils.h" #include "ui/help/AboutDialog.h" #include "ui/settings/GlobalSettingStation.h" -- cgit v1.2.3 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/main_window/MainWindowSlotFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp') diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index 5671d943..9dd3e5cf 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -448,7 +448,7 @@ void MainWindow::slotAppendSelectedKeys() { auto exported = std::make_unique(); auto key_ids = mKeyList->getSelected(); - GpgKeyImportExportor::GetInstance().ExportKeys(key_ids, exported); + GpgKeyImportExporter::GetInstance().ExportKeys(key_ids, exported); edit->curTextPage()->append(QString::fromStdString(*exported)); } -- cgit v1.2.3 From 0f464081971569d9ec6f621cfecdb39a5b8ee2b9 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Sun, 2 Jan 2022 15:07:19 +0800 Subject: (core, ui): add & modify file operations 1. add non ascii mode for file operations. 2. the suffix of normalized file encryption. 3. refactor general settings. --- src/ui/main_window/MainWindowSlotFunction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp') diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index 9dd3e5cf..67ade3ae 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -129,7 +129,9 @@ void MainWindow::slotSign() { auto key_ids = mKeyList->getPrivateChecked(); if (key_ids->empty()) { - QMessageBox::critical(this, _("No Key Selected"), _("No Key Selected")); + QMessageBox::critical( + this, _("No Key Selected"), + _("Please select the key in the key toolbox on the right.")); return; } @@ -270,7 +272,9 @@ void MainWindow::slotEncryptSign() { auto key_ids = mKeyList->getChecked(); if (key_ids->empty()) { - QMessageBox::critical(nullptr, _("No Key Selected"), _("No Key Selected")); + QMessageBox::critical( + nullptr, _("No Key Selected"), + _("Please select the key in the key toolbox on the right.")); return; } -- cgit v1.2.3 From efabb4fa3d543a1d4443b75a1f23c564ccffd8e2 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Mon, 3 Jan 2022 07:54:56 +0800 Subject: (ui): Enhanced sending email function. 1. make options changeable when init in sending email dialog. --- src/ui/main_window/MainWindowSlotFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp') diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index 67ade3ae..53f7dd9c 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -352,7 +352,7 @@ void MainWindow::slotEncryptSign() { infoBoard->resetOptionActionsMenu(); #ifdef SMTP_SUPPORT if (check_gpg_error_2_err_code(error) == GPG_ERR_NO_ERROR) - send_an_email(this, infoBoard, edit->curTextPage()->toPlainText()); + send_an_email(this, infoBoard, edit->curTextPage()->toPlainText(), false); #endif #ifdef ADVANCE_SUPPORT -- 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/main_window/MainWindowSlotFunction.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp') 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.
")) - .arg(currentVersion) + - QString( - _("You can download the latest version(%1) on Github Releases " - "Page.
")) - .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()) + + "
" + + QString(_("You can download the latest stable version(%1) on " + "Github Releases " + "Page.
")) + .arg(version.latest_version.c_str())); } } -- 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/main_window/MainWindowSlotFunction.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp') diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index 09f29958..d5aa262a 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -525,6 +525,11 @@ void MainWindow::slotVersionUpgrade(const SoftwareVersion& version) { "Github Releases " "Page.
")) .arg(version.latest_version.c_str())); + } else if (!version.CurrentVersionReleased()) { + statusBar()->showMessage( + QString(_("This maybe a BETA Version (Latest Stable Version: %1).")) + .arg(version.latest_version.c_str()), + 30000); } } -- cgit v1.2.3 From c2f05ec557ec53f62872e19cc463257481421e4f Mon Sep 17 00:00:00 2001 From: Saturneric Date: Wed, 5 Jan 2022 00:03:18 +0800 Subject: (core, ui): support file symmetric encryption. 1. improve ui for file & text symmetric encryption. --- src/ui/main_window/MainWindowSlotFunction.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp') diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index d5aa262a..57fb5bae 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -59,11 +59,11 @@ void MainWindow::slotEncrypt() { if (key_ids->empty()) { // Symmetric Encrypt - auto ret = - QMessageBox::warning(this, _("Warning"), - _("No Key Selected. Do you want to encrypt with a " - "symmetric cipher using a passphrase?"), - QMessageBox::Ok | QMessageBox::Cancel); + auto ret = QMessageBox::information( + this, _("Symmetric Encryption"), + _("No Key Selected. Do you want to encrypt with a " + "symmetric cipher using a passphrase?"), + QMessageBox::Ok | QMessageBox::Cancel); if (ret == QMessageBox::Cancel) return; -- cgit v1.2.3