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:
parent
ad002d0de0
commit
d1d8fd197d
@ -201,7 +201,7 @@ ActionManager::set_toggleaction_state (const string& n, bool s)
|
|||||||
bool
|
bool
|
||||||
ActionManager::set_toggleaction_state (const char* group_name, const char* action_name, bool s)
|
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) {
|
if (act) {
|
||||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
if (tact) {
|
if (tact) {
|
||||||
@ -215,7 +215,7 @@ ActionManager::set_toggleaction_state (const char* group_name, const char* actio
|
|||||||
void
|
void
|
||||||
ActionManager::do_action (const char* group, const char*action)
|
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) {
|
if (act) {
|
||||||
act->activate ();
|
act->activate ();
|
||||||
}
|
}
|
||||||
@ -224,12 +224,12 @@ ActionManager::do_action (const char* group, const char*action)
|
|||||||
void
|
void
|
||||||
ActionManager::set_toggle_action (const char* group, const char*action, bool yn)
|
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);
|
tact->set_active (yn);
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
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);
|
ActionMap::const_iterator a = actions.find (name);
|
||||||
|
|
||||||
@ -246,9 +246,9 @@ ActionManager::find_action (const string& name, bool or_die)
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<ToggleAction>
|
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) {
|
if (!act) {
|
||||||
return RefPtr<ToggleAction>();
|
return RefPtr<ToggleAction>();
|
||||||
@ -258,9 +258,9 @@ ActionManager::find_toggle_action (const string& name, bool or_die)
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<RadioAction>
|
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) {
|
if (!act) {
|
||||||
return RefPtr<RadioAction>();
|
return RefPtr<RadioAction>();
|
||||||
@ -270,7 +270,7 @@ ActionManager::find_radio_action (const string& name, bool or_die)
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
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);
|
string fullpath (group_name);
|
||||||
fullpath += '/';
|
fullpath += '/';
|
||||||
@ -291,9 +291,9 @@ ActionManager::find_action (char const * group_name, char const * action_name, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<ToggleAction>
|
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) {
|
if (!act) {
|
||||||
return RefPtr<ToggleAction>();
|
return RefPtr<ToggleAction>();
|
||||||
@ -303,9 +303,9 @@ ActionManager::find_toggle_action (char const * group_name, char const * action_
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<RadioAction>
|
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) {
|
if (!act) {
|
||||||
return RefPtr<RadioAction>();
|
return RefPtr<RadioAction>();
|
||||||
|
@ -408,7 +408,7 @@ Bindings::get_binding_for_action (RefPtr<Action> action, Operation& op)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (k->second.action_name == action_name) {
|
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;
|
return k->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ Bindings::get_binding_for_action (RefPtr<Action> action, Operation& op)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (k->second.action_name == action_name) {
|
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;
|
return k->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ Bindings::activate (KeyboardKey kb, Operation op)
|
|||||||
if (k->second.action) {
|
if (k->second.action) {
|
||||||
action = k->second.action;
|
action = k->second.action;
|
||||||
} else {
|
} else {
|
||||||
action = ActionManager::find_action (k->second.action_name, false);
|
action = ActionManager::get_action (k->second.action_name, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action) {
|
if (action) {
|
||||||
@ -508,7 +508,7 @@ Bindings::associate ()
|
|||||||
KeybindingMap::iterator k;
|
KeybindingMap::iterator k;
|
||||||
|
|
||||||
for (k = press_bindings.begin(); k != press_bindings.end(); ++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) {
|
if (k->second.action) {
|
||||||
push_to_gtk (k->first, k->second.action);
|
push_to_gtk (k->first, k->second.action);
|
||||||
} else {
|
} else {
|
||||||
@ -517,18 +517,18 @@ Bindings::associate ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (k = release_bindings.begin(); k != release_bindings.end(); ++k) {
|
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 */
|
/* no working support in GTK for release bindings */
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseButtonBindingMap::iterator b;
|
MouseButtonBindingMap::iterator b;
|
||||||
|
|
||||||
for (b = button_press_bindings.begin(); b != button_press_bindings.end(); ++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) {
|
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) {
|
if (b->second.action) {
|
||||||
action = b->second.action;
|
action = b->second.action;
|
||||||
} else {
|
} else {
|
||||||
action = ActionManager::find_action (b->second.action_name, false);
|
action = ActionManager::get_action (b->second.action_name, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action) {
|
if (action) {
|
||||||
@ -881,7 +881,7 @@ Bindings::save_as_html (ostream& ostr, bool categorize) const
|
|||||||
if ((*k)->second.action) {
|
if ((*k)->second.action) {
|
||||||
action = (*k)->second.action;
|
action = (*k)->second.action;
|
||||||
} else {
|
} else {
|
||||||
action = ActionManager::find_action ((*k)->second.action_name, false);
|
action = ActionManager::get_action ((*k)->second.action_name, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!action) {
|
if (!action) {
|
||||||
|
@ -617,7 +617,7 @@ UI::process_error_message (Transmitter::Channel chn, const char *str)
|
|||||||
void
|
void
|
||||||
UI::show_errors ()
|
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) {
|
if (!act) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -631,7 +631,7 @@ UI::show_errors ()
|
|||||||
void
|
void
|
||||||
UI::toggle_errors ()
|
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) {
|
if (!act) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,12 +86,12 @@ namespace ActionManager {
|
|||||||
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
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);
|
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> get_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::Action> get_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> get_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::ToggleAction> get_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> get_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::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,
|
LIBGTKMM2EXT_API extern void get_all_actions (std::vector<std::string>& paths,
|
||||||
|
Loading…
Reference in New Issue
Block a user