diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-12 22:30:25 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-12 22:30:25 +0000 |
commit | df5cf878ce791175a67f35df0bac5958b8425b1b (patch) | |
tree | b2b49429cf5d380ebabf4e13503780f8e5afe20e /gtk2_ardour/keyeditor.cc | |
parent | 7dcc66a7e5e68d69bda04fc6a7462d3f2140f6d5 (diff) |
fixup keybinding editor binding action; restore some menu items lost in the trunk merge; no search in processor (redirect) boxes
git-svn-id: svn://localhost/ardour2/trunk@2548 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/keyeditor.cc')
-rw-r--r-- | gtk2_ardour/keyeditor.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc index 07aad652af..c9deebbb6a 100644 --- a/gtk2_ardour/keyeditor.cc +++ b/gtk2_ardour/keyeditor.cc @@ -20,6 +20,9 @@ using namespace Gdk; KeyEditor::KeyEditor () : ArdourDialog (_("Keybinding Editor"), false) { + can_bind = false; + last_state = 0; + model = TreeStore::create(columns); view.set_model (model); @@ -37,7 +40,9 @@ KeyEditor::KeyEditor () scroller.add (view); scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + get_vbox()->pack_start (scroller); + get_vbox()->set_border_width (12); scroller.show (); view.show (); @@ -63,13 +68,28 @@ KeyEditor::action_selected () } bool +KeyEditor::on_key_press_event (GdkEventKey* ev) +{ + can_bind = true; + last_state = ev->state; +} + +bool KeyEditor::on_key_release_event (GdkEventKey* ev) { + if (!can_bind || ev->state != last_state) { + return false; + } + TreeModel::iterator i = view.get_selection()->get_selected(); if (i != model->children().end()) { string path = (*i)[columns.path]; + if (!(*i)[columns.bindable]) { + goto out; + } + bool result = AccelMap::change_entry (path, ev->keyval, (ModifierType) ev->state, @@ -91,6 +111,8 @@ KeyEditor::on_key_release_event (GdkEventKey* ev) } + out: + can_bind = false; return true; } @@ -136,6 +158,7 @@ KeyEditor::populate () nodes[parts[1]] = rowp; parent = *(rowp); parent[columns.action] = parts[1]; + parent[columns.bindable] = false; row = *(model->append (parent.children())); @@ -149,6 +172,7 @@ KeyEditor::populate () row[columns.action] = (*l); row[columns.path] = (*p); + row[columns.bindable] = true; if (*k == ActionManager::unbound_string) { row[columns.binding] = string(); |