diff options
author | saturneric <[email protected]> | 2024-12-01 00:21:46 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-12-01 00:21:46 +0000 |
commit | eeec34f66fac8ecb350cd8d683a5dd167c91e706 (patch) | |
tree | 61da717af5370e37963da1e21f9daae0dc426b00 /src/ui/dialog/controller/GnuPGControllerDialog.cpp | |
parent | fix: solve link errors on windows (diff) | |
parent | feat: improve windows release structure at nightly build (diff) | |
download | GpgFrontend-eeec34f66fac8ecb350cd8d683a5dd167c91e706.tar.gz GpgFrontend-eeec34f66fac8ecb350cd8d683a5dd167c91e706.zip |
Merge branch 'dev/2.1.5/mingw' into develop
Diffstat (limited to 'src/ui/dialog/controller/GnuPGControllerDialog.cpp')
-rw-r--r-- | src/ui/dialog/controller/GnuPGControllerDialog.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/ui/dialog/controller/GnuPGControllerDialog.cpp b/src/ui/dialog/controller/GnuPGControllerDialog.cpp index fe334e45..72e9c276 100644 --- a/src/ui/dialog/controller/GnuPGControllerDialog.cpp +++ b/src/ui/dialog/controller/GnuPGControllerDialog.cpp @@ -272,7 +272,9 @@ void GnuPGControllerDialog::set_settings() { buffered_key_db_so_ = GetGpgKeyDatabaseInfos(); editable_key_db_so_ = buffered_key_db_so_; - editable_key_db_so_.pop_front(); + if (!editable_key_db_so_.isEmpty()) { + editable_key_db_so_.pop_front(); + } this->slot_refresh_key_database_table(); } @@ -380,7 +382,9 @@ void GnuPGControllerDialog::slot_add_new_key_database() { key_databases.append(key_database); editable_key_db_so_ = buffered_key_db_so_; - editable_key_db_so_.pop_front(); + if (!editable_key_db_so_.isEmpty()) { + editable_key_db_so_.pop_front(); + } // refresh ui slot_refresh_key_database_table(); @@ -429,6 +433,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; } |