/*
- Copyright (C) 2009 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
+ * Copyright (C) 2009-2016 Paul Davis <paul@linuxaudiosystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
#include <gtkmm/menu.h>
#include <gtkmm/stock.h>
#include "route_group_menu.h"
#include "route_group_dialog.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace Gtk;
using namespace ARDOUR;
RadioMenuItem::Group group;
items.push_back (RadioMenuElem (group, _("No Group")));
RadioMenuItem* i = static_cast<RadioMenuItem *> (&items.back ());
- i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteGroupMenu::set_group), (RouteGroup *) 0));
+ i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteGroupMenu::set_group), i, (RouteGroup *) 0));
if (groups.size() == 1 && *groups.begin() == 0) {
i->set_active ();
items.push_back (RadioMenuElem (*group, rg->name()));
RadioMenuItem* i = static_cast<RadioMenuItem*> (&items.back ());
- i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteGroupMenu::set_group), rg));
+ i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteGroupMenu::set_group), i, rg));
if (groups.size() == 1 && *groups.begin() == rg) {
/* there's only one active group, and it's this one */
* @param Group, or 0 for none.
*/
void
-RouteGroupMenu::set_group (RouteGroup* g)
+RouteGroupMenu::set_group (Gtk::RadioMenuItem* e, RouteGroup* g)
{
if (_inhibit_group_selected) {
return;
}
+ if (e && !e->get_active()) {
+ return;
+ }
for (WeakRouteList::const_iterator i = _subject.begin(); i != _subject.end(); ++i) {
boost::shared_ptr<Route> r = i->lock ();
RouteGroupDialog* d = new RouteGroupDialog (g, true);
d->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &RouteGroupMenu::new_group_dialog_finished), d));
+ d->present ();
}
void
{
if (r == RESPONSE_OK) {
_session->add_route_group (d->group());
- set_group (d->group());
+ set_group (0, d->group());
} else {
delete d->group ();
}