From 4c7b6e1b1bf9e33cf5df5e0a270ad763bb32aea3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 31 Mar 2008 13:11:55 +0000 Subject: minor mootcher fixes; change "Analyze .." to "Spectral Analysis" where applicable; make separate actions be appropriately sensitive to the edit point git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3198 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_actions.cc | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'gtk2_ardour/editor_actions.cc') diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 3d50486b5a..520f5205c6 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -440,16 +440,16 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut)); ActionManager::session_sensitive_actions.push_back (act); /* Note: for now, editor-delete does the exact same thing as editor-cut */ @@ -1656,3 +1656,16 @@ Editor::reset_focus () { track_canvas->grab_focus(); } + +void +Editor::reset_canvas_action_sensitivity (bool onoff) +{ + if (_edit_point != EditAtMouse) { + onoff = true; + } + + for (vector >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin(); + x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) { + (*x)->set_sensitive (onoff); + } +} -- cgit v1.2.3