From 135a54effdbeb1037633492b5eef5ef5bc600545 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 21 Sep 2022 21:16:33 +0200 Subject: [PATCH] Cleanup processor-box sensitivity, mixbus backport --- gtk2_ardour/processor_box.cc | 15 ++++++++++----- gtk2_ardour/processor_box.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 86176a0209..b4600d5978 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -2398,7 +2398,7 @@ ProcessorBox::show_processor_menu (int arg) /* Sensitise actions as approprioate */ - const bool sensitive = !processor_display.selection().empty() && ! stub_processor_selected (); + const bool sensitive = !processor_display.selection().empty() && ! stub_processor_selected () && !channelstrip_selected(); paste_action->set_sensitive (!_p_selection.processors.empty()); cut_action->set_sensitive (sensitive && can_cut ()); @@ -2406,15 +2406,13 @@ ProcessorBox::show_processor_menu (int arg) delete_action->set_sensitive (sensitive || stub_processor_selected ()); backspace_action->set_sensitive (sensitive || stub_processor_selected ()); - edit_action->set_sensitive (one_processor_can_be_edited ()); - edit_generic_action->set_sensitive (one_processor_can_be_edited ()); - boost::shared_ptr pi; if (single_selection) { pi = boost::dynamic_pointer_cast (single_selection->processor ()); } - manage_pins_action->set_sensitive (pi != 0); + manage_pins_action->set_sensitive (pi != 0 && !channelstrip_selected ()); + if (boost::dynamic_pointer_cast(_route)) { disk_io_action->set_sensitive (true); PBD::Unwinder uw (_ignore_rb_change, true); @@ -2435,6 +2433,7 @@ ProcessorBox::show_processor_menu (int arg) } /* allow editing with an Ardour-generated UI for plugin inserts with editors */ + edit_generic_action->set_sensitive (one_processor_can_be_edited ()); edit_action->set_sensitive (pi && pi->plugin()->has_editor ()); /* disallow rename for multiple selections, for plugin inserts and for the fader */ @@ -3360,6 +3359,12 @@ ProcessorBox::stub_processor_selected () const return false; } +bool +ProcessorBox::channelstrip_selected () const +{ + return false; +} + void ProcessorBox::cut_processors (const ProcSelection& to_be_removed) { diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index ebbc2556d3..7b27b11525 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -574,6 +574,7 @@ private: bool can_cut() const; bool stub_processor_selected() const; + bool channelstrip_selected() const; static Glib::RefPtr cut_action; static Glib::RefPtr copy_action;