13
0

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
This commit is contained in:
Paul Davis 2007-10-12 22:30:25 +00:00
parent 7dcc66a7e5
commit df5cf878ce
4 changed files with 36 additions and 1 deletions

View File

@ -298,6 +298,10 @@
<menuitem action='UseSoftwareMonitoring'/> <menuitem action='UseSoftwareMonitoring'/>
<menuitem action='UseExternalMonitoring'/> <menuitem action='UseExternalMonitoring'/>
</menu> </menu>
<menu action='Plugins'>
<menuitem action='DisableAllPlugins'/>
<menuitem action='ABAllPlugins'/>
</menu>
<menu action='Metering'> <menu action='Metering'>
<menu action='MeteringFallOffRate'> <menu action='MeteringFallOffRate'>
<menuitem action='MeterFalloffOff'/> <menuitem action='MeterFalloffOff'/>
@ -368,7 +372,7 @@
</menu> </menu>
</menubar> </menubar>
<popup name='redirectmenu'> <popup name='processormenu'>
<menuitem action='newplugin'/> <menuitem action='newplugin'/>
<menuitem action='newinsert'/> <menuitem action='newinsert'/>
<menuitem action='newsend'/> <menuitem action='newsend'/>

View File

@ -20,6 +20,9 @@ using namespace Gdk;
KeyEditor::KeyEditor () KeyEditor::KeyEditor ()
: ArdourDialog (_("Keybinding Editor"), false) : ArdourDialog (_("Keybinding Editor"), false)
{ {
can_bind = false;
last_state = 0;
model = TreeStore::create(columns); model = TreeStore::create(columns);
view.set_model (model); view.set_model (model);
@ -37,7 +40,9 @@ KeyEditor::KeyEditor ()
scroller.add (view); scroller.add (view);
scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
get_vbox()->pack_start (scroller); get_vbox()->pack_start (scroller);
get_vbox()->set_border_width (12);
scroller.show (); scroller.show ();
view.show (); view.show ();
@ -62,14 +67,29 @@ KeyEditor::action_selected ()
{ {
} }
bool
KeyEditor::on_key_press_event (GdkEventKey* ev)
{
can_bind = true;
last_state = ev->state;
}
bool bool
KeyEditor::on_key_release_event (GdkEventKey* ev) KeyEditor::on_key_release_event (GdkEventKey* ev)
{ {
if (!can_bind || ev->state != last_state) {
return false;
}
TreeModel::iterator i = view.get_selection()->get_selected(); TreeModel::iterator i = view.get_selection()->get_selected();
if (i != model->children().end()) { if (i != model->children().end()) {
string path = (*i)[columns.path]; string path = (*i)[columns.path];
if (!(*i)[columns.bindable]) {
goto out;
}
bool result = AccelMap::change_entry (path, bool result = AccelMap::change_entry (path,
ev->keyval, ev->keyval,
(ModifierType) ev->state, (ModifierType) ev->state,
@ -91,6 +111,8 @@ KeyEditor::on_key_release_event (GdkEventKey* ev)
} }
out:
can_bind = false;
return true; return true;
} }
@ -136,6 +158,7 @@ KeyEditor::populate ()
nodes[parts[1]] = rowp; nodes[parts[1]] = rowp;
parent = *(rowp); parent = *(rowp);
parent[columns.action] = parts[1]; parent[columns.action] = parts[1];
parent[columns.bindable] = false;
row = *(model->append (parent.children())); row = *(model->append (parent.children()));
@ -149,6 +172,7 @@ KeyEditor::populate ()
row[columns.action] = (*l); row[columns.action] = (*l);
row[columns.path] = (*p); row[columns.path] = (*p);
row[columns.bindable] = true;
if (*k == ActionManager::unbound_string) { if (*k == ActionManager::unbound_string) {
row[columns.binding] = string(); row[columns.binding] = string();

View File

@ -18,6 +18,7 @@ class KeyEditor : public ArdourDialog
protected: protected:
void on_show (); void on_show ();
void on_unmap (); void on_unmap ();
bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*); bool on_key_release_event (GdkEventKey*);
private: private:
@ -26,10 +27,12 @@ class KeyEditor : public ArdourDialog
add (action); add (action);
add (binding); add (binding);
add (path); add (path);
add (bindable);
} }
Gtk::TreeModelColumn<Glib::ustring> action; Gtk::TreeModelColumn<Glib::ustring> action;
Gtk::TreeModelColumn<std::string> binding; Gtk::TreeModelColumn<std::string> binding;
Gtk::TreeModelColumn<std::string> path; Gtk::TreeModelColumn<std::string> path;
Gtk::TreeModelColumn<bool> bindable;
}; };
Gtk::ScrolledWindow scroller; Gtk::ScrolledWindow scroller;
@ -37,6 +40,9 @@ class KeyEditor : public ArdourDialog
Glib::RefPtr<Gtk::TreeStore> model; Glib::RefPtr<Gtk::TreeStore> model;
KeyEditorColumns columns; KeyEditorColumns columns;
bool can_bind;
guint last_state;
void action_selected (); void action_selected ();
void populate (); void populate ();
}; };

View File

@ -120,6 +120,7 @@ ProcessorBox::ProcessorBox (Placement pcmnt, Session& sess, boost::shared_ptr<Ro
processor_display.set_size_request (-1, 40); processor_display.set_size_request (-1, 40);
processor_display.get_column(0)->set_sizing(TREE_VIEW_COLUMN_FIXED); processor_display.get_column(0)->set_sizing(TREE_VIEW_COLUMN_FIXED);
processor_display.get_column(0)->set_fixed_width(48); processor_display.get_column(0)->set_fixed_width(48);
processor_display.set_enable_search (false);
processor_display.add_object_drag (columns.processor.index(), "redirects"); processor_display.add_object_drag (columns.processor.index(), "redirects");
processor_display.signal_object_drop.connect (mem_fun (*this, &ProcessorBox::object_drop)); processor_display.signal_object_drop.connect (mem_fun (*this, &ProcessorBox::object_drop));