change ActionManager::find_action() back to ActionManager::get_action()

This avoids dozens or hundreds of unnecessary changes in gtk2_ardour code
This commit is contained in:
Paul Davis 2018-12-10 08:32:11 -05:00
parent ad002d0de0
commit d1d8fd197d
4 changed files with 30 additions and 30 deletions

View File

@ -201,7 +201,7 @@ ActionManager::set_toggleaction_state (const string& n, bool s)
bool
ActionManager::set_toggleaction_state (const char* group_name, const char* action_name, bool s)
{
RefPtr<Action> act = find_action (group_name, action_name);
RefPtr<Action> act = get_action (group_name, action_name);
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact) {
@ -215,7 +215,7 @@ ActionManager::set_toggleaction_state (const char* group_name, const char* actio
void
ActionManager::do_action (const char* group, const char*action)
{
Glib::RefPtr<Gtk::Action> act = ActionManager::find_action (group, action);
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (group, action);
if (act) {
act->activate ();
}
@ -224,12 +224,12 @@ ActionManager::do_action (const char* group, const char*action)
void
ActionManager::set_toggle_action (const char* group, const char*action, bool yn)
{
Glib::RefPtr<Gtk::ToggleAction> tact = ActionManager::find_toggle_action (group, action);
Glib::RefPtr<Gtk::ToggleAction> tact = ActionManager::get_toggle_action (group, action);
tact->set_active (yn);
}
RefPtr<Action>
ActionManager::find_action (const string& name, bool or_die)
ActionManager::get_action (const string& name, bool or_die)
{
ActionMap::const_iterator a = actions.find (name);
@ -246,9 +246,9 @@ ActionManager::find_action (const string& name, bool or_die)
}
RefPtr<ToggleAction>
ActionManager::find_toggle_action (const string& name, bool or_die)
ActionManager::get_toggle_action (const string& name, bool or_die)
{
RefPtr<Action> act = find_action (name, or_die);
RefPtr<Action> act = get_action (name, or_die);
if (!act) {
return RefPtr<ToggleAction>();
@ -258,9 +258,9 @@ ActionManager::find_toggle_action (const string& name, bool or_die)
}
RefPtr<RadioAction>
ActionManager::find_radio_action (const string& name, bool or_die)
ActionManager::get_radio_action (const string& name, bool or_die)
{
RefPtr<Action> act = find_action (name, or_die);
RefPtr<Action> act = get_action (name, or_die);
if (!act) {
return RefPtr<RadioAction>();
@ -270,7 +270,7 @@ ActionManager::find_radio_action (const string& name, bool or_die)
}
RefPtr<Action>
ActionManager::find_action (char const * group_name, char const * action_name, bool or_die)
ActionManager::get_action (char const * group_name, char const * action_name, bool or_die)
{
string fullpath (group_name);
fullpath += '/';
@ -291,9 +291,9 @@ ActionManager::find_action (char const * group_name, char const * action_name, b
}
RefPtr<ToggleAction>
ActionManager::find_toggle_action (char const * group_name, char const * action_name, bool or_die)
ActionManager::get_toggle_action (char const * group_name, char const * action_name, bool or_die)
{
RefPtr<Action> act = find_action (group_name, action_name, or_die);
RefPtr<Action> act = get_action (group_name, action_name, or_die);
if (!act) {
return RefPtr<ToggleAction>();
@ -303,9 +303,9 @@ ActionManager::find_toggle_action (char const * group_name, char const * action_
}
RefPtr<RadioAction>
ActionManager::find_radio_action (char const * group_name, char const * action_name, bool or_die)
ActionManager::get_radio_action (char const * group_name, char const * action_name, bool or_die)
{
RefPtr<Action> act = find_action (group_name, action_name, or_die);
RefPtr<Action> act = get_action (group_name, action_name, or_die);
if (!act) {
return RefPtr<RadioAction>();

View File

@ -408,7 +408,7 @@ Bindings::get_binding_for_action (RefPtr<Action> action, Operation& op)
*/
if (k->second.action_name == action_name) {
k->second.action = ActionManager::find_action (action_name, false);
k->second.action = ActionManager::get_action (action_name, false);
return k->first;
}
@ -429,7 +429,7 @@ Bindings::get_binding_for_action (RefPtr<Action> action, Operation& op)
*/
if (k->second.action_name == action_name) {
k->second.action = ActionManager::find_action (action_name, false);
k->second.action = ActionManager::get_action (action_name, false);
return k->first;
}
@ -488,7 +488,7 @@ Bindings::activate (KeyboardKey kb, Operation op)
if (k->second.action) {
action = k->second.action;
} else {
action = ActionManager::find_action (k->second.action_name, false);
action = ActionManager::get_action (k->second.action_name, false);
}
if (action) {
@ -508,7 +508,7 @@ Bindings::associate ()
KeybindingMap::iterator k;
for (k = press_bindings.begin(); k != press_bindings.end(); ++k) {
k->second.action = ActionManager::find_action (k->second.action_name, false);
k->second.action = ActionManager::get_action (k->second.action_name, false);
if (k->second.action) {
push_to_gtk (k->first, k->second.action);
} else {
@ -517,18 +517,18 @@ Bindings::associate ()
}
for (k = release_bindings.begin(); k != release_bindings.end(); ++k) {
k->second.action = ActionManager::find_action (k->second.action_name, false);
k->second.action = ActionManager::get_action (k->second.action_name, false);
/* no working support in GTK for release bindings */
}
MouseButtonBindingMap::iterator b;
for (b = button_press_bindings.begin(); b != button_press_bindings.end(); ++b) {
b->second.action = ActionManager::find_action (b->second.action_name, false);
b->second.action = ActionManager::get_action (b->second.action_name, false);
}
for (b = button_release_bindings.begin(); b != button_release_bindings.end(); ++b) {
b->second.action = ActionManager::find_action (b->second.action_name, false);
b->second.action = ActionManager::get_action (b->second.action_name, false);
}
}
@ -662,7 +662,7 @@ Bindings::activate (MouseButton bb, Operation op)
if (b->second.action) {
action = b->second.action;
} else {
action = ActionManager::find_action (b->second.action_name, false);
action = ActionManager::get_action (b->second.action_name, false);
}
if (action) {
@ -881,7 +881,7 @@ Bindings::save_as_html (ostream& ostr, bool categorize) const
if ((*k)->second.action) {
action = (*k)->second.action;
} else {
action = ActionManager::find_action ((*k)->second.action_name, false);
action = ActionManager::get_action ((*k)->second.action_name, false);
}
if (!action) {

View File

@ -617,7 +617,7 @@ UI::process_error_message (Transmitter::Channel chn, const char *str)
void
UI::show_errors ()
{
Glib::RefPtr<Action> act = ActionManager::find_action (X_("Editor"), X_("toggle-log-window"));
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
if (!act) {
return;
}
@ -631,7 +631,7 @@ UI::show_errors ()
void
UI::toggle_errors ()
{
Glib::RefPtr<Action> act = ActionManager::find_action (X_("Editor"), X_("toggle-log-window"));
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
if (!act) {
return;
}

View File

@ -86,12 +86,12 @@ namespace ActionManager {
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
const char* name, const char* label, sigc::slot<void> sl);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> find_action (const std::string& name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> find_action (char const * group_name, char const * action_name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::ToggleAction> find_toggle_action (const std::string& name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::ToggleAction> find_toggle_action (char const * group_name, char const * action_name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::RadioAction> find_radio_action (const std::string& name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::RadioAction> find_radio_action (char const * group_name, char const * action_name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action (const std::string& name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action (char const * group_name, char const * action_name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::ToggleAction> get_toggle_action (const std::string& name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::ToggleAction> get_toggle_action (char const * group_name, char const * action_name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::RadioAction> get_radio_action (const std::string& name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::RadioAction> get_radio_action (char const * group_name, char const * action_name, bool or_die = true);
LIBGTKMM2EXT_API extern void get_all_actions (std::vector<std::string>& paths,