From 759267af15ba002231cb04b0a2d1c53ce9e48295 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Dec 2009 15:32:42 +0000 Subject: Various tweaks to group tabs, the main upshot of which is that you can start a drag in an empty part of the group tab display and drag out a new route group. git-svn-id: svn://localhost/ardour2/branches/3.0@6249 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_route_groups.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'gtk2_ardour/editor_route_groups.cc') diff --git a/gtk2_ardour/editor_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index 2a07ca89c1..1a2fb35f9e 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -154,7 +154,7 @@ EditorRouteGroups::EditorRouteGroups (Editor* e) w->show(); remove_button->add (*w); - add_button->signal_clicked().connect (mem_fun (*this, &EditorRouteGroups::new_route_group)); + add_button->signal_clicked().connect (hide_return (mem_fun (*this, &EditorRouteGroups::new_route_group))); remove_button->signal_clicked().connect (mem_fun (*this, &EditorRouteGroups::remove_selected)); button_box->pack_start (*add_button); @@ -182,7 +182,7 @@ EditorRouteGroups::menu (RouteGroup* g) _menu->set_name ("ArdourContextMenu"); MenuList& items = _menu->items(); - items.push_back (MenuElem (_("New..."), mem_fun(*this, &EditorRouteGroups::new_route_group))); + items.push_back (MenuElem (_("New..."), hide_return (mem_fun(*this, &EditorRouteGroups::new_route_group)))); items.push_back (MenuElem (_("New From"), *new_from)); if (g) { items.push_back (MenuElem (_("Edit..."), bind (mem_fun (*this, &EditorRouteGroups::edit), g))); @@ -231,8 +231,8 @@ EditorRouteGroups::set_activation (RouteGroup* g, bool a) g->set_active (a, this); } -void -EditorRouteGroups::new_route_group () +ARDOUR::RouteGroup * +EditorRouteGroups::new_route_group () const { RouteGroup* g = new RouteGroup ( *_session, @@ -244,13 +244,14 @@ EditorRouteGroups::new_route_group () RouteGroupDialog d (g, Gtk::Stock::NEW); int const r = d.do_run (); - if (r == Gtk::RESPONSE_OK) { - _session->add_route_group (g); - } else { + if (r != Gtk::RESPONSE_OK) { delete g; + return 0; } + + _session->add_route_group (g); + return g; } - void EditorRouteGroups::run_new_group_dialog (const RouteList& rl) { -- cgit v1.2.3