Add test for #3356.
[ardour.git] / gtk2_ardour / route_group_dialog.cc
index 4856d87f08e6fc2bf8ea3aca3c0f89b86a0a94a0..176c23d8e2ae468a069b76e2f278715002efdeaf 100644 (file)
 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,15 +74,15 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s)
        _name.set_text (_group->name ());
        _active.set_active (_group->is_active ());
 
-       _name.signal_activate ().connect (sigc::bind (mem_fun (*this, &Dialog::response), RESPONSE_ACCEPT));
+       _name.signal_activate ().connect (sigc::bind (sigc::mem_fun (*this, &Dialog::response), RESPONSE_OK));
 
-       _gain.set_active (_group->property (RouteGroup::Gain));
+       _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 ();
 
@@ -113,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 ();
 }
@@ -127,15 +127,20 @@ RouteGroupDialog::do_run ()
        int const r = run ();
 
        if (r == Gtk::RESPONSE_OK || r == Gtk::RESPONSE_ACCEPT) {
-               _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);
+
+               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;