add a new name for the region-layering-editor-action that tells us we were started...
[ardour.git] / gtk2_ardour / editor_actions.cc
index 775a24e36bc8ad03f970117cfac3588421dc5947..efb78c48cef8301ac18a89aeae7332d6e83b87c8 100644 (file)
 #include <gio/gio.h>
 #include <gtk/gtkiconfactory.h>
 
+
+#include "pbd/filesystem.h"
+#include "pbd/file_utils.h"
+#include "pbd/search_path.h"
+
 #include "gtkmm2ext/tearoff.h"
 
 #include "ardour/ardour.h"
+#include "ardour/filesystem_paths.h"
 #include "ardour/profile.h"
 #include "ardour/session.h"
 
@@ -282,7 +288,7 @@ Editor::register_actions ()
 
        reg_sens (editor_actions, "duplicate-range", _("Duplicate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_dialog), false));
 
-       undo_action = reg_sens (editor_actions, "undo", _("Undo"), sigc::bind (sigc::mem_fun(*this, &Editor::undo), 1U));
+       undo_action = reg_sens (editor_actions, "undo", S_("Command|Undo"), sigc::bind (sigc::mem_fun(*this, &Editor::undo), 1U));
        redo_action = reg_sens (editor_actions, "redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
 
        reg_sens (editor_actions, "export-audio", _("Export Audio"), sigc::mem_fun(*this, &Editor::export_audio));
@@ -616,6 +622,24 @@ Editor::register_actions ()
        ActionManager::add_action_group (editor_actions);
 }
 
+void
+Editor::load_bindings ()
+{
+        /* XXX move this to a better place */
+       
+        key_bindings.set_action_map (editor_action_map);
+
+       sys::path binding_file;
+       SearchPath spath = ardour_search_path() + user_config_directory() + system_config_search_path();
+
+       if (find_file_in_search_path (spath, "editor.bindings", binding_file)) {
+                key_bindings.load (binding_file.to_string());
+               info << string_compose (_("Loaded editor bindings from %1"), binding_file.to_string()) << endmsg;
+        } else {
+               error << string_compose (_("Could not find editor.bindings in search path %1"), spath.to_string()) << endmsg;
+       }
+}
+
 void
 Editor::toggle_ruler_visibility (RulerType rt)
 {
@@ -1460,7 +1484,10 @@ Editor::register_region_actions ()
                sigc::bind (sigc::mem_fun (*this, &Editor::align_regions_relative), ARDOUR::SyncPoint)
                );
 
-       Glib::RefPtr<Action> a = reg_sens (_region_actions, "choose-top-region", _("Choose Top..."), mem_fun (*this, &Editor::change_region_layering_order));
+       Glib::RefPtr<Action> a = reg_sens (_region_actions, "choose-top-region", _("Choose Top..."), sigc::bind (sigc::mem_fun (*this, &Editor::change_region_layering_order), false));
+       a->set_accel_group (get_accel_group ());
+
+       a = reg_sens (_region_actions, "choose-top-region-context-menu", _("Choose Top..."), sigc::bind (sigc::mem_fun (*this, &Editor::change_region_layering_order), true));
        a->set_accel_group (get_accel_group ());
 
        _all_region_actions_sensitized = true;