diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2019-07-30 13:02:15 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2019-08-01 12:11:31 -0500 |
commit | da3d8e54188691217956eb5c0e6671fe24bcd20f (patch) | |
tree | 82900ce20712110c13def4ccd9d191e1f716bc18 /gtk2_ardour/editor_selection.cc | |
parent | 50786b3e5c42310396a6bf5d54744ea968995319 (diff) |
(Source List) Implement insert-region action... now uses the Source List.
Diffstat (limited to 'gtk2_ardour/editor_selection.cc')
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index e24c525abb..4075ddcac8 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -35,6 +35,7 @@ #include "editor.h" #include "editor_drag.h" #include "editor_routes.h" +#include "editor_sources.h" #include "actions.h" #include "audio_time_axis.h" #include "audio_region_view.h" @@ -1214,6 +1215,7 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing) bool have_selection = false; bool have_entered = false; bool have_edit_point = false; + bool have_selected_source = false; RegionSelection rs; // std::cerr << "STRRA: crossing ? " << because_canvas_crossing << " within ? " << within_track_canvas @@ -1229,6 +1231,10 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing) rs.add (entered_regionview); } + if ( _sources->get_single_selection() ) { + have_selected_source = true; + } + if (rs.empty() && !selection->tracks.empty()) { /* no selected regions, but some selected tracks. @@ -1278,6 +1284,8 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing) sensitive = true; } else if ((tgt & EditPointRegions) && have_edit_point) { sensitive = true; + } else if ((tgt & ListSelection) && have_selected_source ) { + sensitive = true; } x->second.action->set_sensitive (sensitive); @@ -1507,9 +1515,9 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing) /* XXX: should also check that there is a track of the appropriate type for the selected region */ #if 0 if (_edit_point == EditAtMouse || _regions->get_single_selection() == 0 || selection->tracks.empty()) { - _region_actions->get_action("insert-region-from-region-list")->set_sensitive (false); + _region_actions->get_action("insert-region-from-source-list")->set_sensitive (false); } else { - _region_actions->get_action("insert-region-from-region-list")->set_sensitive (true); + _region_actions->get_action("insert-region-from-source-list")->set_sensitive (true); } #endif |