From ccf58b8de23619db9983a45f696fd97e13a15cce Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 14 Nov 2009 23:48:26 +0000 Subject: Small cleanups to port matrix context menu. git-svn-id: svn://localhost/ardour2/branches/3.0@6088 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gtk2_ardour/port_matrix.cc') diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 1e0db19cf6..e930df6b99 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -285,9 +285,12 @@ PortMatrix::popup_menu ( boost::weak_ptr w (bc[dim].bundle); + bool can_add_or_rename = false; + if (can_add_channel (bc[dim].bundle)) { snprintf (buf, sizeof (buf), _("Add %s"), channel_noun().c_str()); sub.push_back (MenuElem (buf, bind (mem_fun (*this, &PortMatrix::add_channel_proxy), w))); + can_add_or_rename = true; } @@ -299,9 +302,12 @@ PortMatrix::popup_menu ( bind (mem_fun (*this, &PortMatrix::rename_channel_proxy), w, bc[dim].channel) ) ); + can_add_or_rename = true; } - sub.push_back (SeparatorElem ()); + if (can_add_or_rename) { + sub.push_back (SeparatorElem ()); + } if (can_remove_channels (bc[dim].bundle)) { snprintf (buf, sizeof (buf), _("Remove '%s'"), bc[dim].bundle->channel_name (bc[dim].channel).c_str()); @@ -313,7 +319,7 @@ PortMatrix::popup_menu ( ); } - if (_show_only_bundles) { + if (_show_only_bundles || bc[dim].bundle->nchannels() <= 1) { snprintf (buf, sizeof (buf), _("%s all"), disassociation_verb().c_str()); } else { snprintf ( -- cgit v1.2.3