aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/key_generate/KeygenDialog.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-10-26 14:20:13 +0000
committersaturneric <[email protected]>2024-10-26 14:20:13 +0000
commitaa90cf1eb97e39f99e622753bb0624ed8dff7775 (patch)
treeec2f334903f4d8e9a179dc88d46911a649c02c7d /src/ui/dialog/key_generate/KeygenDialog.cpp
parentfix: should check key status immediately after get it (diff)
downloadGpgFrontend-aa90cf1eb97e39f99e622753bb0624ed8dff7775.tar.gz
GpgFrontend-aa90cf1eb97e39f99e622753bb0624ed8dff7775.zip
fix: should select channel before any gpg operation
Diffstat (limited to 'src/ui/dialog/key_generate/KeygenDialog.cpp')
-rw-r--r--src/ui/dialog/key_generate/KeygenDialog.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/dialog/key_generate/KeygenDialog.cpp b/src/ui/dialog/key_generate/KeygenDialog.cpp
index 37e2ff2c..e29f6b64 100644
--- a/src/ui/dialog/key_generate/KeygenDialog.cpp
+++ b/src/ui/dialog/key_generate/KeygenDialog.cpp
@@ -41,8 +41,9 @@
namespace GpgFrontend::UI {
-KeyGenDialog::KeyGenDialog(QWidget* parent)
- : GeneralDialog(typeid(KeyGenDialog).name(), parent) {
+KeyGenDialog::KeyGenDialog(int channel, QWidget* parent)
+ : GeneralDialog(typeid(KeyGenDialog).name(), parent),
+ default_gpg_context_channel_(channel) {
button_box_ =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
@@ -426,6 +427,7 @@ auto KeyGenDialog::create_basic_info_group_box() -> QGroupBox* {
gpg_contexts_combo_box_->addItem(
QString("%1: %2").arg(channel).arg(database_name));
}
+ gpg_contexts_combo_box_->setCurrentIndex(default_gpg_context_channel_);
for (const auto& algo : GenKeyInfo::GetSupportedKeyAlgo()) {
key_type_combo_box_->addItem(std::get<0>(algo));