0e1b549f97e6d32767de2378b3e39e6881c39296
[ardour.git] / gtk2_ardour / route_group_dialog.cc
1 #include <gtkmm/stock.h>
2 #include "ardour/route_group.h"
3 #include "route_group_dialog.h"
4 #include "i18n.h"
5
6 using namespace Gtk;
7 using namespace ARDOUR;
8
9 RouteGroupDialog::RouteGroupDialog (RouteGroup* g)
10         : Dialog (_("Route group")),
11           _group (g),
12           _active (_("Active"))
13 {
14         _name.set_text (_group->name ());
15         _active.set_active (_group->is_active ());
16         
17         HBox* h = manage (new HBox);
18         h->pack_start (*manage (new Label (_("Name:"))));
19         h->pack_start (_name);
20
21         get_vbox()->pack_start (*h);
22         get_vbox()->pack_start (_active);
23
24         add_button (Stock::CANCEL, RESPONSE_CANCEL);
25         /* XXX: change this depending on context */
26         add_button (Stock::OK, RESPONSE_OK);
27
28         show_all ();
29 }
30
31 int
32 RouteGroupDialog::do_run ()
33 {
34         int const r = run ();
35
36         if (r == Gtk::RESPONSE_OK) {
37                 _group->set_name (_name.get_text ());
38                 _group->set_active (_active.get_active (), this);
39         }
40
41         return r;
42 }