summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorSampo Savolainen <v2@iki.fi>2006-11-30 20:49:59 +0000
committerSampo Savolainen <v2@iki.fi>2006-11-30 20:49:59 +0000
commite176a4093f906d6072f848b88ae96269ffbf8456 (patch)
tree771123b1c02c069fdccb5dae53d0abab0a9f5694 /gtk2_ardour/route_time_axis.cc
parentba32e48dd18cfe48725ec27a740c7accadb8d489 (diff)
Make playlist "New copy" foolproof: bump names until a unique one is
found. Also made the "New" button sensitive by default as the default new name for the playlist will be legal. git-svn-id: svn://localhost/ardour2/trunk@1175 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index cc51444d43..348e4fb01f 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -878,7 +878,14 @@ RouteTimeAxisView::use_copy_playlist (bool prompt)
if (!pl)
return;
- name = Playlist::bump_name (pl->name(), _session);
+ name = pl->name();
+
+ do {
+ name = Playlist::bump_name (name, _session);
+ } while (_session.playlist_by_name(name));
+
+ // TODO: The prompter "new" button should be de-activated if the user
+ // specifies a playlist name which already exists in the session.
if (prompt) {
@@ -887,7 +894,7 @@ RouteTimeAxisView::use_copy_playlist (bool prompt)
prompter.set_prompt (_("Name for Playlist"));
prompter.set_initial_text (name);
prompter.add_button (Gtk::Stock::NEW, Gtk::RESPONSE_ACCEPT);
- prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
+ prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
prompter.show_all ();
switch (prompter.run ()) {