X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Froute_ui.cc;h=68f6622e35d19a672e13753047aef05e110b41ba;hb=aaa44a37aaf585b9bcd9268a9551a005e6269bdb;hp=3ea8345570e74adba3e216c9b0ed1349f316ce31;hpb=4c509656223d3ed1f0fab504cb483090d38972f9;p=ardour.git diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 3ea8345570..68f6622e35 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -37,8 +37,7 @@ #include #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, ¤t); 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