aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowFileSlotFunction.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-06 22:05:21 +0000
committerSaturneric <[email protected]>2021-12-07 05:38:52 +0000
commit1a2c3d6bc0b2feb4b286cc1dbe7b2cd5afcb69ba (patch)
tree081ed8abe91ade5809b41f29ffa823a4f37cf798 /src/ui/main_window/MainWindowFileSlotFunction.cpp
parentTest & Improve UI (diff)
downloadGpgFrontend-1a2c3d6bc0b2feb4b286cc1dbe7b2cd5afcb69ba.tar.gz
GpgFrontend-1a2c3d6bc0b2feb4b286cc1dbe7b2cd5afcb69ba.zip
Add Translate & Fix Bugs.
Diffstat (limited to 'src/ui/main_window/MainWindowFileSlotFunction.cpp')
-rw-r--r--src/ui/main_window/MainWindowFileSlotFunction.cpp54
1 files changed, 12 insertions, 42 deletions
diff --git a/src/ui/main_window/MainWindowFileSlotFunction.cpp b/src/ui/main_window/MainWindowFileSlotFunction.cpp
index c258e8b0..19be9769 100644
--- a/src/ui/main_window/MainWindowFileSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowFileSlotFunction.cpp
@@ -287,43 +287,15 @@ void MainWindow::slotFileVerify() {
});
if (!if_error) {
- auto resultAnalyse = VerifyResultAnalyse(error, std::move(result));
- resultAnalyse.analyse();
- process_result_analyse(edit, infoBoard, resultAnalyse);
+ auto result_analyse = VerifyResultAnalyse(error, std::move(result));
+ result_analyse.analyse();
+ process_result_analyse(edit, infoBoard, result_analyse);
- if (resultAnalyse.getStatus() == -2) {
- QMessageBox::StandardButton reply;
- reply = QMessageBox::question(
- this, _("Public key not found locally"),
- _("There is no target public key content in local for GpgFrontend to "
- "gather enough information about this Signature. Do you want to "
- "import the public key from Keyserver now?"),
- QMessageBox::Yes | QMessageBox::No);
- if (reply == QMessageBox::Yes) {
- qDebug() << "Yes was clicked";
- auto dialog = KeyServerImportDialog(true, this);
- auto key_ids = std::make_unique<KeyIdArgsList>();
- auto* signature = resultAnalyse.GetSignatures();
- while (signature != nullptr) {
- LOG(INFO) << "signature fpr" << signature->fpr;
- key_ids->push_back(signature->fpr);
- signature = signature->next;
- }
- dialog.slotImport(key_ids);
- dialog.show();
-
- } else {
- qDebug() << "Yes was *not* clicked";
- }
- }
+ if (result_analyse.getStatus() == -2)
+ import_unknown_key_from_keyserver(this, result_analyse);
- // if (resultAnalyse.getStatus() >= 0) {
- // infoBoard->resetOptionActionsMenu();
- // infoBoard->addOptionalAction(
- // "Show Verify Details", [this, error, &result]() {
- // VerifyDetailsDialog(this, mKeyList, error, result);
- // });
- // }
+ if (result_analyse.getStatus() >= 0)
+ show_verify_details(this, infoBoard, error, result_analyse);
fileTreeView->update();
} else {
@@ -452,13 +424,11 @@ void MainWindow::slotFileDecryptVerify() {
verify_res.analyse();
process_result_analyse(edit, infoBoard, decrypt_res, verify_res);
- // if (verify_res.getStatus() >= 0) {
- // infoBoard->resetOptionActionsMenu();
- // infoBoard->addOptionalAction(
- // "Show Verify Details", [this, error, v_result]() {
- // VerifyDetailsDialog(this, mCtx, mKeyList, error, v_result);
- // });
- // }
+ if (verify_res.getStatus() == -2)
+ import_unknown_key_from_keyserver(this, verify_res);
+
+ if (verify_res.getStatus() >= 0)
+ show_verify_details(this, infoBoard, error, verify_res);
fileTreeView->update();
} else {