provide ActionManager::do_action() as a way to trigger any action item as if the...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 24 Jan 2012 16:19:38 +0000 (16:19 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 24 Jan 2012 16:19:38 +0000 (16:19 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11332 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/gtkmm2ext/actions.cc
libs/gtkmm2ext/gtkmm2ext/actions.h

index 7237497d86c4d531fb4df7d53be5ae6c65c1ee53..c9aae4568b03167103bd5bc585b1de21dc4125c2 100644 (file)
@@ -343,3 +343,13 @@ ActionManager::get_key_representation (const string& accel_path, AccelKey& key)
        
        return unbound_string;
 }
+
+void
+ActionManager::do_action (const char* group, const char*action)
+{
+       Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (group, action);
+       if (act) {
+               act->activate ();
+       }
+}
+
index 189bf328c45e33507ab3cca34f0c77bef6170668..d9082ffbff0efd5a5f4ac146825f7b460b00fb9e 100644 (file)
@@ -43,6 +43,7 @@ namespace ActionManager {
        extern Gtk::Widget* get_widget (const char * name);
        extern Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
        extern Glib::RefPtr<Gtk::Action> get_action (const char* path);
+       extern void do_action (const char* group, const char* name);
 
        extern void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);