diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 0573a0189..bc8fc3f70 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -479,23 +479,21 @@ void DatabaseWidget::deleteEntries() bool inRecycleBin = Tools::hasChild(m_db->metadata()->recycleBin(), selectedEntries.first()); if (inRecycleBin || !m_db->metadata()->recycleBinEnabled()) { - QMessageBox::StandardButton result; - + QString prompt; if (selected.size() == 1) { - result = MessageBox::question( - this, tr("Delete entry?"), - tr("Do you really want to delete the entry \"%1\" for good?") - .arg(selectedEntries.first()->title().toHtmlEscaped()), - QMessageBox::Yes | QMessageBox::No); + prompt = tr("Do you really want to delete the entry \"%1\" for good?") + .arg(selectedEntries.first()->title().toHtmlEscaped()); } else { - result = MessageBox::question( - this, tr("Delete entries?"), - tr("Do you really want to delete %1 entries for good?") - .arg(selected.size()), - QMessageBox::Yes | QMessageBox::No); + prompt = tr("Do you really want to delete %n entry(s) for good?", "", selected.size()); } + QMessageBox::StandardButton result = MessageBox::question( + this, + tr("Delete entry(s)?", "", selected.size()), + prompt, + QMessageBox::Yes | QMessageBox::No); + if (result == QMessageBox::Yes) { for (Entry* entry : asConst(selectedEntries)) { delete entry; @@ -504,22 +502,20 @@ void DatabaseWidget::deleteEntries() } } else { - QMessageBox::StandardButton result; - + QString prompt; if (selected.size() == 1) { - result = MessageBox::question( - this, tr("Move entry to recycle bin?"), - tr("Do you really want to move entry \"%1\" to the recycle bin?") - .arg(selectedEntries.first()->title().toHtmlEscaped()), - QMessageBox::Yes | QMessageBox::No); - } - else { - result = MessageBox::question( - this, tr("Move entries to recycle bin?"), - tr("Do you really want to move %n entry(s) to the recycle bin?", 0, selected.size()), - QMessageBox::Yes | QMessageBox::No); + prompt = tr("Do you really want to move entry \"%1\" to the recycle bin?") + .arg(selectedEntries.first()->title().toHtmlEscaped()); + } else { + prompt = tr("Do you really want to move %n entry(s) to the recycle bin?", "", selected.size()); } + QMessageBox::StandardButton result = MessageBox::question( + this, + tr("Move entry(s) to recycle bin?", "", selected.size()), + prompt, + QMessageBox::Yes | QMessageBox::No); + if (result == QMessageBox::No) { return; } diff --git a/src/gui/EditWidgetIcons.cpp b/src/gui/EditWidgetIcons.cpp index af4476ac3..a70e0dca2 100644 --- a/src/gui/EditWidgetIcons.cpp +++ b/src/gui/EditWidgetIcons.cpp @@ -305,9 +305,10 @@ void EditWidgetIcons::removeCustomIcon() int iconUseCount = entriesWithSameIcon.size() + groupsWithSameIcon.size(); if (iconUseCount > 0) { QMessageBox::StandardButton ans = MessageBox::question(this, tr("Confirm Delete"), - tr("This icon is used by %1 entries, and will be replaced " - "by the default icon. Are you sure you want to delete it?") - .arg(iconUseCount), QMessageBox::Yes | QMessageBox::No); + tr("This icon is used by %n entry(s), and will be replaced " + "by the default icon. Are you sure you want to delete it?", + "", iconUseCount), + QMessageBox::Yes | QMessageBox::No); if (ans == QMessageBox::No) { // Early out, nothing is changed