summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_ui.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-08-03 13:28:36 +0000
committerCarl Hetherington <carl@carlh.net>2011-08-03 13:28:36 +0000
commit61d95b0bd09152d502d3dc5ecc2e595329a5e053 (patch)
tree19d13f808730c7849f1f40b0354a3ded1e444f47 /gtk2_ardour/route_ui.cc
parent86d2afaf4eccd9a73ff33c1f3aba7856e97e14c1 (diff)
Fix erroneous check for colons in track names; clean up
the dialogue a bit and go back to the name entry if the user wants to re-edit. git-svn-id: svn://localhost/ardour2/branches/3.0@9953 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r--gtk2_ardour/route_ui.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index d78102322b..e7d893ddcc 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -1349,23 +1349,23 @@ RouteUI::idle_remove_this_route (RouteUI *rui)
return false;
}
+/** @return true if this name should be used for the route, otherwise false */
bool
RouteUI::verify_new_route_name (const std::string& name)
{
- if (name.find (':')) {
- MessageDialog colon_msg (_("The use of colons (':') is discouraged in track and bus names.\nDo you insist on using this?"));
- colon_msg.add_button (Stock::CANCEL, RESPONSE_CANCEL);
- switch (colon_msg.run()) {
- case Gtk::RESPONSE_ACCEPT:
- return true;
- break;
- default:
- return false;
- break;
- }
- }
+ if (name.find (':') == string::npos) {
+ return true;
+ }
+
+ MessageDialog colon_msg (
+ _("The use of colons (':') is discouraged in track and bus names.\nDo you want to use this new name?"),
+ false, MESSAGE_QUESTION, BUTTONS_NONE
+ );
+
+ colon_msg.add_button (_("Use the new name"), Gtk::RESPONSE_ACCEPT);
+ colon_msg.add_button (_("Re-edit the name"), Gtk::RESPONSE_CANCEL);
- return true;
+ return (colon_msg.run () == Gtk::RESPONSE_ACCEPT);
}
void