aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/KeyMgmt.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-17 11:39:47 +0000
committersaturneric <[email protected]>2024-01-17 11:39:47 +0000
commite352e8e6b8d03a24ef5d52eef3e4d370807b5bbd (patch)
tree9a59f0b573a845644afe4b8857a89c4b28bdcc0d /src/ui/main_window/KeyMgmt.cpp
parentfix: solve the gnupg tab options info not shown issue (diff)
downloadGpgFrontend-e352e8e6b8d03a24ef5d52eef3e4d370807b5bbd.tar.gz
GpgFrontend-e352e8e6b8d03a24ef5d52eef3e4d370807b5bbd.zip
fix: find and slove some bugs
Diffstat (limited to '')
-rw-r--r--src/ui/main_window/KeyMgmt.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/ui/main_window/KeyMgmt.cpp b/src/ui/main_window/KeyMgmt.cpp
index 25c32335..3f22265e 100644
--- a/src/ui/main_window/KeyMgmt.cpp
+++ b/src/ui/main_window/KeyMgmt.cpp
@@ -117,6 +117,7 @@ KeyMgmt::KeyMgmt(QWidget* parent)
this->statusBar()->show();
setWindowTitle(tr("KeyPair Management"));
+ setMinimumSize(QSize(600, 400));
key_list_->AddMenuAction(generate_subkey_act_);
key_list_->AddMenuAction(delete_selected_keys_act_);
@@ -399,13 +400,22 @@ void KeyMgmt::SlotExportKeyToClipboard() {
// stop waiting
op_hd();
+ if (CheckGpgError(err) == GPG_ERR_USER_1) {
+ QMessageBox::critical(this, tr("Error"),
+ tr("Unknown error occurred"));
+ return;
+ }
+
if (CheckGpgError(err) != GPG_ERR_NO_ERROR) {
CommonUtils::RaiseMessageBox(this, err);
return;
}
if (data_obj == nullptr || !data_obj->Check<GFBuffer>()) {
- throw std::runtime_error("data object doesn't pass checking");
+ GF_CORE_LOG_ERROR("data object checking failed");
+ QMessageBox::critical(this, tr("Error"),
+ tr("Unknown error occurred"));
+ return;
}
auto gf_buffer = ExtractParams<GFBuffer>(data_obj, 0);
@@ -469,13 +479,21 @@ void KeyMgmt::SlotExportAsOpenSSHFormat() {
// stop waiting
op_hd();
+ if (CheckGpgError(err) == GPG_ERR_USER_1) {
+ QMessageBox::critical(this, tr("Error"),
+ tr("Unknown error occurred"));
+ return;
+ }
+
if (CheckGpgError(err) != GPG_ERR_NO_ERROR) {
CommonUtils::RaiseMessageBox(this, err);
return;
}
if (data_obj == nullptr || !data_obj->Check<GFBuffer>()) {
- throw std::runtime_error("data object doesn't pass checking");
+ QMessageBox::critical(this, tr("Error"),
+ tr("Unknown error occurred"));
+ return;
}
auto gf_buffer = ExtractParams<GFBuffer>(data_obj, 0);