From 502a43488d51c88be33d95be11ba8f160c2a3fd4 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 18 Apr 2025 19:11:40 +0200 Subject: feat: add more basic env checks at init --- src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/ui/dialog/keypair_details/KeyPairSubkeyTab.cpp') 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() { -- cgit v1.2.3