diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc index 409f89dfaf..e9a0ed85a4 100644 --- a/gtk2_ardour/keyeditor.cc +++ b/gtk2_ardour/keyeditor.cc @@ -33,6 +33,7 @@ #include "pbd/strsplit.h" +#include "ardour/filesystem_paths.h" #include "ardour/profile.h" #include "actions.h" @@ -75,9 +76,8 @@ KeyEditor::KeyEditor () scroller.add (view); scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); - add (vpacker); - vpacker.set_spacing (6); + vpacker.set_border_width (12); vpacker.pack_start (scroller); if (!ARDOUR::Profile->get_sae()) { @@ -94,8 +94,18 @@ KeyEditor::KeyEditor () unbind_button.show (); } + + reset_button.add (reset_label); + reset_label.set_markup (string_compose ("%1", _("Reset Bindings to Defaults"))); + + reset_box.pack_start (reset_button, true, false); + reset_box.show (); + reset_button.show (); + reset_label.show (); + reset_button.signal_clicked().connect (sigc::mem_fun (*this, &KeyEditor::reset)); + vpacker.pack_start (reset_box); - vpacker.set_border_width (12); + add (vpacker); view.show (); scroller.show (); @@ -295,3 +305,9 @@ KeyEditor::populate () } } } + +void +KeyEditor::reset () +{ + Keyboard::the_keyboard().reset_bindings (); +} diff --git a/gtk2_ardour/keyeditor.h b/gtk2_ardour/keyeditor.h index 51cf1dc127..76e70f10ba 100644 --- a/gtk2_ardour/keyeditor.h +++ b/gtk2_ardour/keyeditor.h @@ -61,6 +61,9 @@ class KeyEditor : public ArdourWindow KeyEditorColumns columns; Gtk::Button unbind_button; Gtk::HButtonBox unbind_box; + Gtk::HBox reset_box; + Gtk::Button reset_button; + Gtk::Label reset_label; void unbind (); @@ -69,6 +72,8 @@ class KeyEditor : public ArdourWindow void action_selected (); void populate (); + + void reset (); }; #endif /* __ardour_gtk_key_editor_h__ */