summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-08-03 13:28:54 +0000
committerCarl Hetherington <carl@carlh.net>2011-08-03 13:28:54 +0000
commit89354edbbc91fa186e7bf7d1916229789b632d85 (patch)
tree42546c0dbe6a0948e8c2037b7b23c3a69bac8f7f /gtk2_ardour/route_time_axis.cc
parent61d95b0bd09152d502d3dc5ecc2e595329a5e053 (diff)
When renaming a track to the name of an existing one,
use the same behaviour in both the editor and mixer windows (add a number to the requested name). git-svn-id: svn://localhost/ardour2/branches/3.0@9954 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 360a9fb4c1..66cd38659d 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -1299,35 +1299,27 @@ RouteTimeAxisView::playlist () const
void
RouteTimeAxisView::name_entry_changed ()
{
- string x;
-
- x = name_entry.get_text ();
+ string x = name_entry.get_text ();
if (x == _route->name()) {
return;
}
- strip_whitespace_edges(x);
+ strip_whitespace_edges (x);
if (x.length() == 0) {
name_entry.set_text (_route->name());
return;
}
- if (!_session->route_name_unique (x)) {
- ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
- name_entry.set_text (_route->name());
- } else if (_session->route_name_internal (x)) {
+ if (_session->route_name_internal (x)) {
ARDOUR_UI::instance()->popup_error (string_compose (_("You cannot create a track with that name as it is reserved for %1"),
- PROGRAM_NAME));
- name_entry.set_text (_route->name());
+ PROGRAM_NAME));
+ name_entry.grab_focus ();
+ } else if (RouteUI::verify_new_route_name (x)) {
+ _route->set_name (x);
} else {
-
- if (RouteUI::verify_new_route_name (x)) {
- _route->set_name (x);
- } else {
- name_entry.grab_focus ();
- }
+ name_entry.grab_focus ();
}
}