X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Froute_group_dialog.cc;h=176c23d8e2ae468a069b76e2f278715002efdeaf;hb=dab0dacc66dcc190b4408ba75e3807973582cbd6;hp=a23d1f47496be7b4325535989dd0da0c2f8cd0cf;hpb=09ec34292683c8a4edcc0060b938192ae18225c4;p=ardour.git diff --git a/gtk2_ardour/route_group_dialog.cc b/gtk2_ardour/route_group_dialog.cc index a23d1f4749..176c23d8e2 100644 --- a/gtk2_ardour/route_group_dialog.cc +++ b/gtk2_ardour/route_group_dialog.cc @@ -27,9 +27,10 @@ using namespace Gtk; using namespace ARDOUR; using namespace std; +using namespace PBD; RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s) - : ArdourDialog (_("route group dialog")), + : ArdourDialog (_("Route Group")), _group (g), _active (_("Active")), _gain (_("Gain")), @@ -46,8 +47,6 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s) set_position (Gtk::WIN_POS_MOUSE); set_name (N_("RouteGroupDialog")); - set_title (_("Route Group")); - VBox* vbox = manage (new VBox); Gtk::Label* l; @@ -75,13 +74,15 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s) _name.set_text (_group->name ()); _active.set_active (_group->is_active ()); - _gain.set_active (_group->property (RouteGroup::Gain)); + _name.signal_activate ().connect (sigc::bind (sigc::mem_fun (*this, &Dialog::response), RESPONSE_OK)); + + _gain.set_active (_group->is_gain()); _relative.set_active (_group->is_relative()); - _mute.set_active (_group->property (RouteGroup::Mute)); - _solo.set_active (_group->property (RouteGroup::Solo)); - _rec_enable.set_active (_group->property (RouteGroup::RecEnable)); - _select.set_active (_group->property (RouteGroup::Select)); - _edit.set_active (_group->property (RouteGroup::Edit)); + _mute.set_active (_group->is_mute()); + _solo.set_active (_group->is_solo()); + _rec_enable.set_active (_group->is_recenable()); + _select.set_active (_group->is_select()); + _edit.set_active (_group->is_edit()); gain_toggled (); @@ -111,10 +112,11 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s) get_vbox()->pack_start (*vbox, false, false); - _gain.signal_toggled().connect(mem_fun (*this, &RouteGroupDialog::gain_toggled)); + _gain.signal_toggled().connect(sigc::mem_fun (*this, &RouteGroupDialog::gain_toggled)); add_button (Stock::CANCEL, RESPONSE_CANCEL); add_button (s, RESPONSE_OK); + set_default_response (RESPONSE_OK); show_all_children (); } @@ -124,16 +126,21 @@ RouteGroupDialog::do_run () { int const r = run (); - if (r == Gtk::RESPONSE_OK) { - _group->set_property (RouteGroup::Gain, _gain.get_active ()); - _group->set_property (RouteGroup::Mute, _mute.get_active ()); - _group->set_property (RouteGroup::Solo, _solo.get_active ()); - _group->set_property (RouteGroup::RecEnable, _rec_enable.get_active ()); - _group->set_property (RouteGroup::Select, _select.get_active ()); - _group->set_property (RouteGroup::Edit, _edit.get_active ()); - _group->set_name (_name.get_text ()); // This emits changed signal - _group->set_active (_active.get_active (), this); - _group->set_relative (_relative.get_active(), this); + if (r == Gtk::RESPONSE_OK || r == Gtk::RESPONSE_ACCEPT) { + + PropertyList plist; + + plist.add (Properties::gain, _gain.get_active()); + plist.add (Properties::recenable, _rec_enable.get_active()); + plist.add (Properties::mute, _mute.get_active()); + plist.add (Properties::solo, _solo.get_active ()); + plist.add (Properties::select, _select.get_active()); + plist.add (Properties::edit, _edit.get_active()); + plist.add (Properties::relative, _relative.get_active()); + plist.add (Properties::active, _active.get_active()); + plist.add (Properties::name, string (_name.get_text())); + + _group->set_properties (plist); } return r;