mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 21:09:27 -06:00
Update the action dropdown when creating or removing an action (closes #2004)
This commit is contained in:
@@ -488,6 +488,12 @@ void ActionDialog::actionRemove() {
|
||||
_actionData.erase(_actionData.begin() + i);
|
||||
delete _actionWidgets.list->takeItem(static_cast<int>(i));
|
||||
clearActionFields();
|
||||
|
||||
_keybindingWidgets.action->clear();
|
||||
for (const Profile::Action& action : _actionData) {
|
||||
_keybindingWidgets.action->addItem(QString::fromStdString(action.identifier));
|
||||
}
|
||||
clearKeybindingFields();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -587,6 +593,13 @@ void ActionDialog::actionSaved() {
|
||||
action->script = _actionWidgets.script->toPlainText().toStdString();
|
||||
|
||||
updateListItem(_actionWidgets.list->currentItem(), *action);
|
||||
|
||||
// Update the list of actions available in the action chooser
|
||||
_keybindingWidgets.action->clear();
|
||||
for (const Profile::Action& action : _actionData) {
|
||||
_keybindingWidgets.action->addItem(QString::fromStdString(action.identifier));
|
||||
}
|
||||
clearKeybindingFields();
|
||||
clearActionFields();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user