Small cleanups to port matrix context menu.
authorCarl Hetherington <carl@carlh.net>
Sat, 14 Nov 2009 23:48:26 +0000 (23:48 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 14 Nov 2009 23:48:26 +0000 (23:48 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6088 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/port_matrix.cc

index 1e0db19cf6b016fcfd65647944c664226086d56a..e930df6b997f298ca0a8ee06d7748e44837ca7a4 100644 (file)
@@ -285,9 +285,12 @@ PortMatrix::popup_menu (
 
                        boost::weak_ptr<Bundle> 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 (