From 608d1cc7b02683c387ed960896ecffff3745cd93 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 23 Nov 2009 18:08:29 +0000 Subject: [PATCH] Don't offer to make an internal send to ourselves or to a route that we already have one for. Don't offer an empty aux sends menu. git-svn-id: svn://localhost/ardour2/branches/3.0@6157 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/processor_box.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index f0a055057a..964ed9510c 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -303,7 +303,7 @@ ProcessorBox::build_possible_aux_menu () MenuList& items = menu->items(); for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { - if (!(*r)->internal_send_for (*r)) { + if (!_route->internal_send_for (*r) && *r != _route) { items.push_back (MenuElem ((*r)->name(), bind (sigc::ptr_fun (ProcessorBox::rb_choose_aux), boost::weak_ptr(*r)))); } } @@ -338,11 +338,13 @@ ProcessorBox::show_processor_menu (gint arg) if (aux_menu_item) { Menu* m = build_possible_aux_menu(); - if (m) { + if (m && !m->items().empty()) { aux_menu_item->set_submenu (*m); + aux_menu_item->set_sensitive (true); } else { /* stupid gtkmm: we need to pass a null reference here */ gtk_menu_item_set_submenu (aux_menu_item->gobj(), 0); + aux_menu_item->set_sensitive (false); } }