aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/KeyMgmt.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-18 17:11:40 +0000
committersaturneric <[email protected]>2025-04-18 17:11:40 +0000
commit502a43488d51c88be33d95be11ba8f160c2a3fd4 (patch)
tree87ee50bc5fdb1ca89d71ccfc988b1e6f67550f83 /src/ui/main_window/KeyMgmt.cpp
parentfeat: add more info check (diff)
downloadGpgFrontend-502a43488d51c88be33d95be11ba8f160c2a3fd4.tar.gz
GpgFrontend-502a43488d51c88be33d95be11ba8f160c2a3fd4.zip
feat: add more basic env checks at init
Diffstat (limited to 'src/ui/main_window/KeyMgmt.cpp')
-rw-r--r--src/ui/main_window/KeyMgmt.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/ui/main_window/KeyMgmt.cpp b/src/ui/main_window/KeyMgmt.cpp
index e3128231..f9364ecf 100644
--- a/src/ui/main_window/KeyMgmt.cpp
+++ b/src/ui/main_window/KeyMgmt.cpp
@@ -428,12 +428,20 @@ void KeyMgmt::SlotExportKeyToClipboard() {
}
void KeyMgmt::SlotGenerateKeyDialog() {
- (new KeyGenerateDialog(key_list_->GetCurrentGpgContextChannel(), this))
- ->exec();
- this->raise();
+ if (!CheckGpgVersion(key_list_->GetCurrentGpgContextChannel(), "2.2.0")) {
+ CommonUtils::RaiseMessageBoxNotSupported(this);
+ return;
+ }
+
+ new KeyGenerateDialog(key_list_->GetCurrentGpgContextChannel(), this);
}
void KeyMgmt::SlotGenerateSubKey() {
+ if (!CheckGpgVersion(key_list_->GetCurrentGpgContextChannel(), "2.2.0")) {
+ CommonUtils::RaiseMessageBoxNotSupported(this);
+ return;
+ }
+
auto key = key_list_->GetSelectedGpgKey();
if (key == nullptr) return;
@@ -444,10 +452,7 @@ void KeyMgmt::SlotGenerateSubKey() {
return;
}
- (new SubkeyGenerateDialog(key_list_->GetCurrentGpgContextChannel(), key,
- this))
- ->exec();
- this->raise();
+ new SubkeyGenerateDialog(key_list_->GetCurrentGpgContextChannel(), key, this);
}
void KeyMgmt::SlotExportAsOpenSSHFormat() {