diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-12 14:33:18 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-12 14:54:01 -0400 |
commit | 0852d05643fcedd5eaeb0217c4afa9c95218ef17 (patch) | |
tree | 8ca2529b97125eee8b1e72417f536de29de79e6f /gtk2_ardour/route_group_dialog.cc | |
parent | b3b246b7243895fd08a01d184c182fa561f2900e (diff) |
remove RouteGroupDialog::do_run() and replace its use with code that doesn't rely on a recursive run loop
Diffstat (limited to 'gtk2_ardour/route_group_dialog.cc')
-rw-r--r-- | gtk2_ardour/route_group_dialog.cc | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/gtk2_ardour/route_group_dialog.cc b/gtk2_ardour/route_group_dialog.cc index 51db0adcb1..b1a75794ce 100644 --- a/gtk2_ardour/route_group_dialog.cc +++ b/gtk2_ardour/route_group_dialog.cc @@ -126,12 +126,12 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new) _active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); _color.signal_color_set().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); _gain.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); - _relative.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); - _mute.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); - _solo.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); - _rec_enable.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); - _select.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); - _route_active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); + _relative.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); + _mute.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); + _solo.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); + _rec_enable.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); + _select.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); + _route_active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); _share_color.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); _share_monitoring.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); @@ -178,35 +178,27 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new) show_all_children (); } -/** @return true if the route group edit was cancelled, otherwise false */ bool -RouteGroupDialog::do_run () +RouteGroupDialog::name_check () const { - while (1) { - int const r = run (); + if (unique_name (_name.get_text())) { + /* not cancelled and the name is ok, so all is well */ + return true; + } - if (r != Gtk::RESPONSE_OK) { - return true; - } + _group->set_name (_initial_name); - if (unique_name (_name.get_text())) { - /* not cancelled and the name is ok, so all is well */ - return false; - } + MessageDialog msg ( + _("The group name is not unique. Please use a different name."), + false, + Gtk::MESSAGE_ERROR, + Gtk::BUTTONS_OK, + true + ); - _group->set_name (_initial_name); - MessageDialog msg ( - _("The group name is not unique. Please use a different name."), - false, - Gtk::MESSAGE_ERROR, - Gtk::BUTTONS_OK, - true - ); - - msg.run (); - } + msg.set_position (WIN_POS_MOUSE); + msg.run (); - abort(); /* NOTREACHED */ return false; } |