aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/UserInterfaceUtils.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/UserInterfaceUtils.cpp
parentTest & Improve UI (diff)
downloadGpgFrontend-1a2c3d6bc0b2feb4b286cc1dbe7b2cd5afcb69ba.tar.gz
GpgFrontend-1a2c3d6bc0b2feb4b286cc1dbe7b2cd5afcb69ba.zip
Add Translate & Fix Bugs.
Diffstat (limited to '')
-rw-r--r--src/ui/UserInterfaceUtils.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp
index 52fc8457..3c10009a 100644
--- a/src/ui/UserInterfaceUtils.cpp
+++ b/src/ui/UserInterfaceUtils.cpp
@@ -35,6 +35,41 @@ namespace GpgFrontend::UI {
std::unique_ptr<GpgFrontend::UI::CommonUtils>
GpgFrontend::UI::CommonUtils::_instance = nullptr;
+void show_verify_details(QWidget* parent, InfoBoardWidget* info_board,
+ GpgError error, VerifyResultAnalyse& verify_res) {
+ // take out result
+ auto _result = verify_res.TakeChargeOfResult();
+ info_board->resetOptionActionsMenu();
+ info_board->addOptionalAction(
+ "Show Verify Details", [parent, error, _result_ptr = _result.get()]() {
+ VerifyDetailsDialog(parent, error, GpgVerifyResult(_result_ptr));
+ });
+ _result.reset(nullptr);
+}
+
+void import_unknown_key_from_keyserver(QWidget* parent,
+ const VerifyResultAnalyse& verify_res) {
+ QMessageBox::StandardButton reply;
+ reply = QMessageBox::question(
+ parent, _("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) {
+ auto dialog = KeyServerImportDialog(true, parent);
+ auto key_ids = std::make_unique<KeyIdArgsList>();
+ auto* signature = verify_res.GetSignatures();
+ while (signature != nullptr) {
+ LOG(INFO) << "signature fpr" << signature->fpr;
+ key_ids->push_back(signature->fpr);
+ signature = signature->next;
+ }
+ dialog.show();
+ dialog.slotImport(key_ids);
+ }
+}
+
void refresh_info_board(InfoBoardWidget* info_board, int status,
const std::string& report_text) {
if (status < 0)
@@ -60,7 +95,7 @@ void process_result_analyse(TextEdit* edit, InfoBoardWidget* info_board,
LOG(INFO) << "process_result_analyse Started";
info_board->associateTabWidget(edit->tabWidget);
-
+
refresh_info_board(
info_board,
std::min(result_analyse_a.getStatus(), result_analyse_b.getStatus()),