diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index d7e3960f..da3a2574 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -674,6 +674,18 @@ void lcQPreferencesDialog::on_mouseAssign_clicked() Modifiers |= Qt::AltModifier; } + for (int ToolIdx = 0; ToolIdx < LC_NUM_TOOLS; ToolIdx++) + { + if (ToolIdx != ButtonIndex && options->MouseShortcuts.mShortcuts[ToolIdx].Button == Button && options->MouseShortcuts.mShortcuts[ToolIdx].Modifiers == Modifiers) + { + if (QMessageBox::question(this, tr("Override Shortcut"), tr("This shortcut is already assigned to '%1', do you want to replace it?").arg(gToolNames[ToolIdx]), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) + return; + + options->MouseShortcuts.mShortcuts[ToolIdx].Button = Qt::NoButton; + options->MouseShortcuts.mShortcuts[ToolIdx].Modifiers = Qt::NoModifier; + } + } + int ItemIndex = ui->mouseTree->indexOfTopLevelItem(Current); options->MouseShortcuts.mShortcuts[ItemIndex].Button = Button; options->MouseShortcuts.mShortcuts[ItemIndex].Modifiers = Modifiers;