From d6bc631a4fb80c5dabbf898044b46cd2977a49a0 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 17 Nov 2024 15:11:32 +0100 Subject: feat: set max key db number to 8 --- src/ui/dialog/controller/GnuPGControllerDialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ui/dialog/controller') 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_; -- cgit v1.2.3