create_action_group -> get_or_create_action_group

Since adding an action-groups hides existing actions with the same name,
this adds a way to look up actions first.

This fixes an issue introduced in 6af51b52ff (both window_manager.cc
and ardour_ui_ed.cc use the "Window" group.
This commit is contained in:
Robin Gareus 2017-03-11 15:32:55 +01:00
parent 2d595b90d7
commit d6d1074565

View file

@ -1153,6 +1153,13 @@ ActionMap::find_action (const string& name)
RefPtr<ActionGroup>
ActionMap::create_action_group (const string& name)
{
Glib::ListHandle<Glib::RefPtr<ActionGroup> > agl = ActionManager::ui_manager->get_action_groups ();
for (Glib::ListHandle<Glib::RefPtr<ActionGroup> >::iterator i = agl.begin (); i != agl.end (); ++i) {
if ((*i)->get_name () == name) {
return *i;
}
}
RefPtr<ActionGroup> g = ActionGroup::create (name);
/* this is one of the places where our own Action management code