desensitize foldback show unless there is a foldback bus
authorLen Ovens <len@ovenwerks.net>
Fri, 13 Sep 2019 15:18:35 +0000 (08:18 -0700)
committerLen Ovens <len@ovenwerks.net>
Fri, 13 Sep 2019 15:18:35 +0000 (08:18 -0700)
The view menu should not show the foldback item
if there is no foldback bus available.

gtk2_ardour/mixer_ui.cc

index e349381ce7561bdc46f1548f06cb80ae6e4bf63b..968cdc139668c74029cdb0f0380c5d4f2b8adc8b 100644 (file)
@@ -127,6 +127,9 @@ Mixer_UI::Mixer_UI ()
 {
        load_bindings ();
        register_actions ();
+       Glib::RefPtr<ToggleAction> fb_act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+       fb_act->set_sensitive (false);
+
        _content.set_data ("ardour-bindings", bindings);
 
        PresentationInfo::Change.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::presentation_info_changed, this, _1), gui_context());
@@ -627,6 +630,7 @@ Mixer_UI::add_stripables (StripableList& slist)
                                         * strip exists */
                                        bool yn = _show_foldback_strip;
                                        Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+                                       act->set_sensitive (true);
                                        act->set_active(!yn);
                                        act->set_active(yn);
                                        continue;
@@ -754,6 +758,8 @@ Mixer_UI::remove_foldback (FoldbackStrip* strip)
                /* its all being taken care of */
                return;
        }
+       Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
+       act->set_sensitive (false);
        if (foldback_strip) {
                foldback_strip->destroy_();
        }