aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-11-29 16:30:42 +0000
committersaturneric <[email protected]>2024-11-29 16:30:42 +0000
commitf1b8873d3d98a95d02af38453585bd95edf8a8be (patch)
tree69d1897b5b87354391c494b028827465caa391ab
parentfix: solve linux build issue (diff)
downloadGpgFrontend-f1b8873d3d98a95d02af38453585bd95edf8a8be.tar.gz
GpgFrontend-f1b8873d3d98a95d02af38453585bd95edf8a8be.zip
feat: user should confirm the removal of key dbs
-rw-r--r--src/ui/dialog/controller/GnuPGControllerDialog.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ui/dialog/controller/GnuPGControllerDialog.cpp b/src/ui/dialog/controller/GnuPGControllerDialog.cpp
index fe334e45..d911d52e 100644
--- a/src/ui/dialog/controller/GnuPGControllerDialog.cpp
+++ b/src/ui/dialog/controller/GnuPGControllerDialog.cpp
@@ -70,6 +70,8 @@ GnuPGControllerDialog::GnuPGControllerDialog(QWidget* parent)
tr("Tips: notice that modify any of these settings will cause an "
"Application restart."));
+
+
popup_menu_ = new QMenu(this);
popup_menu_->addAction(ui_->actionMove_Key_Database_Up);
popup_menu_->addAction(ui_->actionMove_Key_Database_Down);
@@ -429,6 +431,16 @@ void GnuPGControllerDialog::slot_remove_existing_key_database() {
for (int i = 0; i < row_size; i++) {
auto* const item = ui_->keyDatabaseTable->item(i, 1);
if (!item->isSelected()) continue;
+
+ QMessageBox::StandardButton reply = QMessageBox::question(
+ this, tr("Confirm Deletion"),
+ tr("Are you sure you want to delete the selected key database?"),
+ QMessageBox::Yes | QMessageBox::No);
+
+ if (reply != QMessageBox::Yes) {
+ return;
+ }
+
key_databases.remove(i);
break;
}