change ActionManager::find_action() back to ActionManager::get_action()
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 10 Dec 2018 13:32:11 +0000 (08:32 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 10 Dec 2018 13:34:01 +0000 (08:34 -0500)
This avoids dozens or hundreds of unnecessary changes in gtk2_ardour code

libs/gtkmm2ext/actions.cc
libs/gtkmm2ext/bindings.cc
libs/gtkmm2ext/gtk_ui.cc
libs/gtkmm2ext/gtkmm2ext/actions.h

index 8f6fa139fd3760b7fe68e2aeb2f22e52045a30e1..89ee999e4c4b2914555ab749da4295ed1a63d198 100644 (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>();
index d5d8245099082d3f2d168b77e3c74fbb8409dbcd..49f890029ff3329298fea21d80e9932d707b51da 100644 (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) {
index f03c5c5dec98d6f9839771a3d2c2bc28aaf250f8..c321d94d4fe91493b33eb5a75ad8fd0291c21126 100644 (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;
        }
index 698697316916c4e6e800cfac1ff4cc0af8db7c8a..b396294f119f2d483a9af089706e88da97f1ece7 100644 (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,