summaryrefslogtreecommitdiff
path: root/gtk2_ardour/actions.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-10-12 01:54:35 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-10-12 01:54:35 +0000
commit29f0d9732eb68fcaa22219cedddddd47bcaa8c17 (patch)
treeaea1b182e2853985301613f5d8a3c31755b40c17 /gtk2_ardour/actions.cc
parent02196886bbbef0f7f169c6d7f91bb0fea83e0379 (diff)
add keybinding editor
git-svn-id: svn://localhost/ardour2/trunk@2543 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/actions.cc')
-rw-r--r--gtk2_ardour/actions.cc33
1 files changed, 21 insertions, 12 deletions
diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc
index 5835292cf9..f7609d2712 100644
--- a/gtk2_ardour/actions.cc
+++ b/gtk2_ardour/actions.cc
@@ -153,19 +153,28 @@ ActionManager::lookup_entry (const ustring accel_path, Gtk::AccelKey& key)
void
ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, vector<string>& keys, vector<AccelKey>& bindings)
{
- ListHandle<RefPtr<ActionGroup> > uim_groups = ui_manager->get_action_groups ();
-
- for (ListHandle<RefPtr<ActionGroup> >::iterator g = uim_groups.begin(); g != uim_groups.end(); ++g) {
-
- ListHandle<RefPtr<Action> > group_actions = (*g)->get_actions();
-
- for (ListHandle<RefPtr<Action> >::iterator a = group_actions.begin(); a != group_actions.end(); ++a) {
-
- ustring accel_path;
-
- accel_path = (*a)->get_accel_path();
+ /* the C++ API for functions used here appears to be broken in
+ gtkmm2.6, so we fall back to the C level.
+ */
+
+ GList* list = gtk_ui_manager_get_action_groups (ui_manager->gobj());
+ GList* node;
+ GList* acts;
+
+ for (node = list; node; node = g_list_next (node)) {
+
+ GtkActionGroup* group = (GtkActionGroup*) node->data;
+
+ for (acts = gtk_action_group_list_actions (group); acts; acts = g_list_next (acts)) {
+
+ GtkAction* action = (GtkAction*) acts->data;
+
+ Glib::RefPtr<Action> act = Glib::wrap (action, true);
+
+ string accel_path = act->get_accel_path ();
+ ustring label = act->property_label();
- names.push_back ((*a)->get_name());
+ names.push_back (label);
paths.push_back (accel_path);
AccelKey key;