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) {
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 ();
}
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);
}
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>();
}
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>();
}
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 += '/';
}
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>();
}
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>();
*/
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;
}
*/
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;
}
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) {
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 {
}
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);
}
}
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) {
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) {
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;
}
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;
}
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,