diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-12-12 21:42:25 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-12-12 21:42:25 +0000 |
commit | 7d351e7e486717d7d0cc2a4f338676faa8c35f5e (patch) | |
tree | bf5a19ba6d937aadc4579c6f187fe921a3d83d07 /gtk2_ardour/main.cc | |
parent | 24593ea7308346f54a8d51a367e20fc880432671 (diff) |
per-kbd-layout keybindings selection; initial pass at link-region-and-track-selection
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2779 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/main.cc')
-rw-r--r-- | gtk2_ardour/main.cc | 74 |
1 files changed, 54 insertions, 20 deletions
diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 6dd957993d..0054479e29 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -191,6 +191,59 @@ fixup_bundle_environment () #endif +static void +setup_keybindings (ARDOUR_UI* ui) +{ + Glib::ustring path; + + if (keybindings_path.empty()) { + keybindings_path = "ardour"; + } + + std::string kbpath; + + if (keybindings_path.find (".bindings") == string::npos) { + + // just a style name - allow user to + // specify the layout type. + + char* layout; + + if ((layout = getenv ("ARDOUR_KEYBOARD_LAYOUT")) != 0) { + keybindings_path += '-'; + keybindings_path += layout; + } + + keybindings_path += ".bindings"; + } + + + // XXX timbyr - we need a portable test for "is-absolute" here + + if (keybindings_path[0] != '/' && keybindings_path[0] != '.') { + + /* not absolute - look in the usual places */ + + path = find_config_file (keybindings_path); + + if (path.empty()) { + warning << string_compose (_("Key bindings file \"%1\" not found. Default bindings used instead"), + keybindings_path) + << endmsg; + } + + } else { + + // absolute path from user - use it as is + + path = keybindings_path; + } + + if (!path.empty()) { + ui->set_keybindings_path (path); + } +} + #ifdef VST_SUPPORT /* this is called from the entry point of a wine-compiled executable that is linked against gtk2_ardour built @@ -279,26 +332,7 @@ int main (int argc, char* argv[]) } } - if (!keybindings_path.empty()) { - std::string path; - - // XXX timbyr - we need a portable test for "is-absolute" here - - if (keybindings_path[0] != '/' && keybindings_path[0] != '.') { - path = find_config_file (keybindings_path); - if (path.empty()) { - warning << string_compose (_("Key bindings file \"%1\" not found. Default bindings used instead"), - keybindings_path) - << endmsg; - } - } else { - path = keybindings_path; - } - - if (!path.empty()) { - ui->set_keybindings_path (path); - } - } + setup_keybindings (ui); ui->run (text_receiver); ui = 0; |