#include <map>
-#include "ardour/profile.h"
-
#include <gtkmm/stock.h>
#include <gtkmm/label.h>
#include <gtkmm/accelkey.h>
#include "gtkmm2ext/utils.h"
#include "pbd/strsplit.h"
-#include "pbd/replace_all.h"
+#include "ardour/filesystem_paths.h"
#include "ardour/profile.h"
#include "actions.h"
#include "keyboard.h"
#include "keyeditor.h"
-#include "utils.h"
#include "i18n.h"
scroller.add (view);
scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
- add (scroller);
+ vpacker.set_spacing (6);
+ vpacker.set_border_width (12);
+ vpacker.pack_start (scroller);
if (!ARDOUR::Profile->get_sae()) {
unbind_box.pack_start (unbind_button, false, false);
unbind_button.signal_clicked().connect (sigc::mem_fun (*this, &KeyEditor::unbind));
- add (unbind_box);
+ vpacker.pack_start (unbind_box, false, false);
unbind_box.show ();
unbind_button.show ();
}
+
+ reset_button.add (reset_label);
+ reset_label.set_markup (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("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, false, false);
+
+ add (vpacker);
view.show ();
scroller.show ();
+ vpacker.show ();
unbind_button.set_sensitive (false);
}
unbind_button.set_sensitive (false);
- cerr << "trying to unbind\n";
-
if (i != model->children().end()) {
string path = (*i)[columns.path];
goto out;
}
- cerr << "real lkeyval: " << ev->keyval << endl;
Gtkmm2ext::possibly_translate_keyval_to_make_legal_accelerator (ev->keyval);
- cerr << "using keyval = " << ev->keyval << endl;
bool result = AccelMap::change_entry (path,
ModifierType (Keyboard::RelevantModifierKeyMask & ev->state),
true);
- cerr << "New binding to " << ev->keyval << " worked: " << result << endl;
-
if (result) {
AccelKey key;
(*i)[columns.binding] = ActionManager::get_key_representation (path, key);
//kinda kludgy way to avoid displaying menu items as mappable
if ( parts[1] == _("Main_menu") )
continue;
- if ( parts[1] == _("JACK") )
- continue;
if ( parts[1] == _("redirectmenu") )
continue;
if ( parts[1] == _("Editor_menus") )
}
}
}
+
+void
+KeyEditor::reset ()
+{
+ Keyboard::the_keyboard().reset_bindings ();
+}