Add # of shortcuts to deletion confirmation screen instead

Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
Yihe Li 2025-06-01 16:18:35 +08:00
parent d2ee023788
commit 4214571cff
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -1409,11 +1409,15 @@ void MainWindow::on_actionDeleteInstance_triggered()
}
auto id = m_selectedInstance->id();
QString shortcutStr;
auto shortcuts = m_selectedInstance->shortcuts();
if (!shortcuts.isEmpty())
shortcutStr = tr(" and its %n registered shortcut(s)", "", shortcuts.size());
auto response = CustomMessageBox::selectable(this, tr("Confirm Deletion"),
tr("You are about to delete \"%1\" and all of its shortcut(s).\n"
tr("You are about to delete \"%1\"%2.\n"
"This may be permanent and will completely delete the instance.\n\n"
"Are you sure?")
.arg(m_selectedInstance->name()),
.arg(m_selectedInstance->name(), shortcutStr),
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();