mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +01:00
add new variant of ActionMap::find_action()
This is more useful when replacing ActionManager::get_action
This commit is contained in:
parent
d6b5c23579
commit
4d7e9d5706
2 changed files with 21 additions and 0 deletions
|
|
@ -1183,6 +1183,26 @@ ActionMap::find_action (const string& name)
|
||||||
return a->second;
|
return a->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cerr << "Failed to find action: [" << name << ']' << endl;
|
||||||
|
return RefPtr<Action>();
|
||||||
|
}
|
||||||
|
|
||||||
|
RefPtr<Action>
|
||||||
|
ActionMap::find_action (char const * group_name, char const * action_name)
|
||||||
|
{
|
||||||
|
string fullpath;
|
||||||
|
|
||||||
|
fullpath = group_name;
|
||||||
|
fullpath += '/';
|
||||||
|
fullpath += action_name;
|
||||||
|
|
||||||
|
_ActionMap::iterator a = _actions.find (fullpath);
|
||||||
|
|
||||||
|
if (a != _actions.end()) {
|
||||||
|
return a->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
cerr << "Failed to find action (2): [" << fullpath << ']' << endl;
|
||||||
return RefPtr<Action>();
|
return RefPtr<Action>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ class LIBGTKMM2EXT_API ActionMap {
|
||||||
const char* name, const char* label, sigc::slot<void> sl);
|
const char* name, const char* label, sigc::slot<void> sl);
|
||||||
|
|
||||||
Glib::RefPtr<Gtk::Action> find_action (const std::string& name);
|
Glib::RefPtr<Gtk::Action> find_action (const std::string& name);
|
||||||
|
Glib::RefPtr<Gtk::Action> find_action (char const * group_name, char const * action_name);
|
||||||
|
|
||||||
void set_bindings (Bindings*);
|
void set_bindings (Bindings*);
|
||||||
Bindings* bindings() const { return _bindings; }
|
Bindings* bindings() const { return _bindings; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue