Skip to content

Commit

Permalink
Gui: [skip ci] fixes: Std_DlgCustomize: 2 shortcuts can be assigned t…
Browse files Browse the repository at this point in the history
…o macro
  • Loading branch information
wwmayer committed May 1, 2020
1 parent 4518d7d commit 3bfa795
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Gui/DlgKeyboardImp.cpp
Expand Up @@ -268,8 +268,20 @@ void DlgCustomKeyboardImp::setShortcutOfCurrentAction(const QString& accelText)
action->setStatusTip(statusTip);
}

ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Shortcut");
hGrp->SetASCII(name.constData(), ui->accelLineEditShortcut->text().toUtf8());
// The shortcuts for macros are store in a different location,
// also override the command's shortcut directly
if (dynamic_cast<MacroCommand*>(cmd)) {
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Macro/Macros");
if (hGrp->HasGroup(cmd->getName())) {
hGrp = hGrp->GetGroup(cmd->getName());
hGrp->SetASCII("Accel", ui->accelLineEditShortcut->text().toUtf8());
cmd->setAccel(ui->accelLineEditShortcut->text().toUtf8());
}
}
else {
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Shortcut");
hGrp->SetASCII(name.constData(), ui->accelLineEditShortcut->text().toUtf8());
}
ui->buttonAssign->setEnabled(false);
ui->buttonReset->setEnabled(true);
}
Expand Down

0 comments on commit 3bfa795

Please sign in to comment.