mirror of
https://github.com/leozide/leocad
synced 2024-12-25 21:58:23 +01:00
Prompt to replace mouse shortcuts.
This commit is contained in:
parent
638fd10beb
commit
e6c6ef9490
1 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue