aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-11-17 14:11:32 +0000
committersaturneric <[email protected]>2024-11-17 14:11:32 +0000
commitd6bc631a4fb80c5dabbf898044b46cd2977a49a0 (patch)
tree2f86bd9b6af3075572fe097b30932f1b59f69948 /src
parentfeat: show current selected key db (diff)
downloadGpgFrontend-d6bc631a4fb80c5dabbf898044b46cd2977a49a0.tar.gz
GpgFrontend-d6bc631a4fb80c5dabbf898044b46cd2977a49a0.zip
feat: set max key db number to 8
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/controller/GnuPGControllerDialog.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/dialog/controller/GnuPGControllerDialog.cpp b/src/ui/dialog/controller/GnuPGControllerDialog.cpp
index b53649c4..f0a162a2 100644
--- a/src/ui/dialog/controller/GnuPGControllerDialog.cpp
+++ b/src/ui/dialog/controller/GnuPGControllerDialog.cpp
@@ -328,6 +328,15 @@ auto GnuPGControllerDialog::check_custom_gnupg_path(QString path) -> bool {
void GnuPGControllerDialog::slot_add_new_key_database() {
auto* dialog = new KeyDatabaseEditDialog(this);
+
+ if (buffered_key_db_so_.size() >= 8) {
+ QMessageBox::critical(
+ this, tr("Maximum Key Database Limit Reached"),
+ tr("Currently, GpgFrontend supports a maximum of 8 key databases. "
+ "Please remove an existing database to add a new one."));
+ return;
+ }
+
connect(dialog, &KeyDatabaseEditDialog::SignalKeyDatabaseInfoAccepted, this,
[this](const QString& name, const QString& path) {
auto& key_databases = buffered_key_db_so_;