From f85207a18b52540feb45aa4959732fc59d815a6f Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Thu, 31 Dec 2020 15:15:10 -0800 Subject: [PATCH] More user friendly message. Fixes #543. --- qt/lc_qpreferencesdialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 39974076..8c2dcf85 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -953,11 +953,12 @@ void lcQPreferencesDialog::on_shortcutAssign_clicked() { for (uint ExistingIndex = 0; ExistingIndex < LC_ARRAY_COUNT(Shortcuts); ExistingIndex++) { - if (NewShortcut == Shortcuts[ExistingIndex]) + if (NewShortcut == Shortcuts[ExistingIndex] && ExistingIndex != ShortcutIndex) { - QString QuestionText = tr("The shortcut '%1' is already assigned to '%2'. Do you want to replace it?").arg(NewShortcut, gCommands[ExistingIndex].ID); + QString ActionText = qApp->translate("Menu", gCommands[ExistingIndex].MenuName).remove('&').remove(QLatin1String("...")); + QString QuestionText = tr("The shortcut '%1' is already assigned to '%2'. Do you want to replace it?").arg(NewShortcut, ActionText); - if (QMessageBox::question(this, tr("Duplicate Shortcut"), QuestionText, QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) + if (QMessageBox::question(this, tr("Override Shortcut"), QuestionText, QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; mOptions->KeyboardShortcuts.mShortcuts[ExistingIndex].clear();