summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_selection.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-02-17 22:41:34 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-02-17 22:41:34 +0000
commit15936ab6d9569838024a2d83145052d1e495b2ed (patch)
treec0ad3c4099a3fad330eb7925fd44a6cd129844a4 /gtk2_ardour/editor_selection.cc
parentdf8b8d7ba640096fb9a1e690601b8deeff118c30 (diff)
a boatload of changes and fixes related to SAE menu redesign (several new operations, things set up as actions for use in the main menu; fix Editor::snap_to() since it was really severely broken for general use
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3079 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_selection.cc')
-rw-r--r--gtk2_ardour/editor_selection.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc
index 0330c6567b..e5bf67389a 100644
--- a/gtk2_ardour/editor_selection.cc
+++ b/gtk2_ardour/editor_selection.cc
@@ -797,6 +797,27 @@ Editor::region_selection_changed ()
(*i)->set_selected_regionviews (selection->regions);
}
+ bool have_selected_regions = !selection->regions.empty();
+
+ for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::region_selection_sensitive_actions.begin();
+ x != ActionManager::region_selection_sensitive_actions.end(); ++x) {
+
+ string accel_path = (*x)->get_accel_path ();
+ AccelKey key;
+
+ /* if there is an accelerator, it should always be sensitive
+ to allow for keyboard ops on entered regions.
+ */
+
+ bool known = ActionManager::lookup_entry (accel_path, key);
+
+ if (known && ((key.get_key() != GDK_VoidSymbol) && (key.get_key() != 0))) {
+ (*x)->set_sensitive (true);
+ } else {
+ (*x)->set_sensitive (have_selected_regions);
+ }
+ }
+
zoomed_to_region = false;
}