convert property_foo().set_value(bar) to property_foo() = bar
[ardour.git] / gtk2_ardour / route_ui.cc
index 3ea8345570e74adba3e216c9b0ed1349f316ce31..68f6622e35d19a672e13753047aef05e110b41ba 100644 (file)
@@ -37,8 +37,7 @@
 #include <ardour/diskstream.h>
 
 #include "i18n.h"
-/* there is a string_compose() here.. */
-//using namespace sigc;
+using namespace sigc;
 using namespace Gtk;
 using namespace Gtkmm2ext;
 using namespace ARDOUR;
@@ -566,14 +565,13 @@ RouteUI::choose_color()
 {
        bool picked;
        Gdk::Color color;
-       gdouble current[4];
+       Gdk::Color current;
 
-       current[0] = _color.get_red()  / 65535.0;
-       current[1] = _color.get_green() / 65535.0;
-       current[2] = _color.get_blue() / 65535.0;
-       current[3] = 1.0;
+       current.set_red ( _color.get_red()  / 65535);
+       current.set_green (_color.get_green() / 65535);
+       current.set_blue (_color.get_blue() / 65535);
 
-       color = Gtkmm2ext::UI::instance()->get_color (_("ardour: color selection"), picked, current);
+       color = Gtkmm2ext::UI::instance()->get_color (_("ardour: color selection"), picked, &current);
 
        if (picked) {
                set_color (color);
@@ -659,13 +657,13 @@ RouteUI::remove_this_route ()
 
        Choice prompter (prompt, choices);
 
-       prompter.chosen.connect (Gtk::Main::quit.slot());
+       prompter.chosen.connect(sigc::ptr_fun(Gtk::Main::quit));
        prompter.show_all ();
 
        Gtk::Main::run ();
 
        if (prompter.get_choice() == 0) {
-               Glib::signal_idle().connect (bind (mem_fun (&RouteUI::idle_remove_this_route), this));
+         Glib::signal_idle().connect (bind (sigc::ptr_fun (&RouteUI::idle_remove_this_route), this));
        }
 }
 
@@ -688,26 +686,24 @@ void
 RouteUI::route_rename ()
 {
        ArdourPrompter name_prompter (true);
+       string result;
        name_prompter.set_prompt (_("new name: "));
        name_prompter.set_initial_text (_route.name());
-       name_prompter.done.connect (Gtk::Main::quit.slot());
        name_prompter.show_all ();
 
-       Gtk::Main::run();
-
-       if (name_prompter.status == Gtkmm2ext::Prompter::cancelled) {
-               return;
-       }
-       
-       string result;
-       name_prompter.get_result (result);
+       switch (name_prompter.run ()) {
 
-       if (result.length() == 0) {
-               return;
+       case GTK_RESPONSE_ACCEPT:
+               name_prompter.get_result (result);
+               if (result.length()) {
+                       strip_whitespace_edges (result);
+                       _route.set_name (result, this);
+               }       
+               break;
        }
 
-       strip_whitespace_edges (result);
-       _route.set_name (result, this);
+       return;
+  
 }
 
 void