summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-11-14 23:48:26 +0000
committerCarl Hetherington <carl@carlh.net>2009-11-14 23:48:26 +0000
commitccf58b8de23619db9983a45f696fd97e13a15cce (patch)
treeb6335ac12f98a9d2a8754c1fb7c1fa710c025112 /gtk2_ardour/port_matrix.cc
parent53838fc350887b01c260c8af17cd45a3cab7e4fb (diff)
Small cleanups to port matrix context menu.
git-svn-id: svn://localhost/ardour2/branches/3.0@6088 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r--gtk2_ardour/port_matrix.cc10
1 files changed, 8 insertions, 2 deletions
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<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 (