diff options
author | David Robillard <d@drobilla.net> | 2008-02-16 22:43:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-16 22:43:18 +0000 |
commit | 8aa9508c82f32efcf9c7c00e2c9e76268d4dddce (patch) | |
tree | 1fb1a5e7eef6684c0a5bb49be492612c71796fc4 /gtk2_ardour/option_editor.cc | |
parent | 1b657585572298d1a69a7b43e611f59b7e185df3 (diff) |
Merge with 2.0-ongoing R3071.
git-svn-id: svn://localhost/ardour2/branches/3.0@3073 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/option_editor.cc')
-rw-r--r-- | gtk2_ardour/option_editor.cc | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 0184e3a00a..988aa92e45 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -19,6 +19,7 @@ #include <pbd/whitespace.h> +#include <ardour/ardour.h> #include <ardour/session.h> #include <ardour/audioengine.h> #include <ardour/configuration.h> @@ -100,7 +101,7 @@ OptionEditor::OptionEditor (ARDOUR_UI& uip, PublicEditor& ed, Mixer_UI& mixui) /* kbd/mouse */ - keyboard_mouse_table (3, 4), + keyboard_mouse_table (4, 4), delete_button_adjustment (3, 1, 5), delete_button_spin (delete_button_adjustment), edit_button_adjustment (3, 1, 5), @@ -1082,14 +1083,14 @@ static const struct { #ifdef GTKOSX - /* Command = Mod1 - Option/Alt = Mod5 + /* Command = Meta + Option/Alt = Mod1 */ { "Shift", GDK_SHIFT_MASK }, - { "Command", GDK_MOD1_MASK }, + { "Command", GDK_META_MASK }, { "Control", GDK_CONTROL_MASK }, - { "Option", GDK_MOD5_MASK }, + { "Option", GDK_MOD1_MASK }, { "Command-Shift", GDK_MOD1_MASK|GDK_SHIFT_MASK }, { "Command-Option", GDK_MOD1_MASK|GDK_MOD5_MASK }, { "Shift-Option", GDK_SHIFT_MASK|GDK_MOD5_MASK }, @@ -1197,6 +1198,39 @@ OptionEditor::setup_keyboard_options () keyboard_mouse_table.attach (*label, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, FILL); keyboard_mouse_table.attach (snap_modifier_combo, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, FILL); + + vector<string> strs; + + for (std::map<std::string,std::string>::iterator bf = Keyboard::binding_files.begin(); bf != Keyboard::binding_files.end(); ++bf) { + strs.push_back (bf->first); + } + + set_popdown_strings (keyboard_layout_selector, strs); + keyboard_layout_selector.set_active_text (Keyboard::current_binding_name()); + keyboard_layout_selector.signal_changed().connect (mem_fun (*this, &OptionEditor::bindings_changed)); + + label = manage (new Label (_("Keyboard layout"))); + label->set_name ("OptionsLabel"); + label->set_alignment (1.0, 0.5); + + keyboard_mouse_table.attach (*label, 0, 1, 3, 4, Gtk::FILL|Gtk::EXPAND, FILL); + keyboard_mouse_table.attach (keyboard_layout_selector, 1, 2, 3, 4, Gtk::FILL|Gtk::EXPAND, FILL); +} + +void +OptionEditor::bindings_changed () +{ + string txt; + + txt = keyboard_layout_selector.get_active_text(); + + for (std::map<string,string>::iterator i = Keyboard::binding_files.begin(); i != Keyboard::binding_files.end(); ++i) { + if (txt == i->first) { + if (Keyboard::load_keybindings (i->second)) { + Keyboard::save_keybindings (); + } + } + } } void |