diff options
author | saturneric <[email protected]> | 2025-04-18 17:11:40 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-04-18 17:11:40 +0000 |
commit | 502a43488d51c88be33d95be11ba8f160c2a3fd4 (patch) | |
tree | 87ee50bc5fdb1ca89d71ccfc988b1e6f67550f83 /src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp | |
parent | feat: add more info check (diff) | |
download | GpgFrontend-502a43488d51c88be33d95be11ba8f160c2a3fd4.tar.gz GpgFrontend-502a43488d51c88be33d95be11ba8f160c2a3fd4.zip |
feat: add more basic env checks at init
Diffstat (limited to 'src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp')
-rw-r--r-- | src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp index 73e7f4e5..b8942b94 100644 --- a/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp @@ -66,6 +66,11 @@ KeyPairSubkeyTab::KeyPairSubkeyTab(int channel, GpgKeyPtr key, QWidget* parent) add_adsk_button->hide(); } + if (!CheckGpgVersion(channel, "2.4.1")) { + add_adsk_button->setDisabled(true); + add_adsk_button->hide(); + } + uid_buttons_layout->addWidget(add_subkey_button, 0, 0); uid_buttons_layout->addWidget(add_adsk_button, 0, 1); @@ -277,9 +282,12 @@ void KeyPairSubkeyTab::slot_refresh_subkey_list() { } void KeyPairSubkeyTab::slot_add_subkey() { - auto* dialog = - new SubkeyGenerateDialog(current_gpg_context_channel_, key_, this); - dialog->show(); + if (!CheckGpgVersion(current_gpg_context_channel_, "2.2.0")) { + CommonUtils::RaiseMessageBoxNotSupported(this); + return; + } + + new SubkeyGenerateDialog(current_gpg_context_channel_, key_, this); } void KeyPairSubkeyTab::slot_add_adsk() { |