projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a7210d2
)
Don't allow duplicate playlist names
author
Robin Gareus
<robin@gareus.org>
Thu, 24 Nov 2016 21:11:19 +0000
(22:11 +0100)
committer
Robin Gareus
<robin@gareus.org>
Thu, 24 Nov 2016 21:11:19 +0000
(22:11 +0100)
gtk2_ardour/route_time_axis.cc
patch
|
blob
|
history
diff --git
a/gtk2_ardour/route_time_axis.cc
b/gtk2_ardour/route_time_axis.cc
index 21ff5f8063f0fdfb72d90dd6bec74f8673085bde..7bb41cf8ec78e4df488beb1b1349c3da9ed406e5 100644
(file)
--- a/
gtk2_ardour/route_time_axis.cc
+++ b/
gtk2_ardour/route_time_axis.cc
@@
-1124,20
+1124,25
@@
RouteTimeAxisView::rename_current_playlist ()
prompter.set_title (_("Rename Playlist"));
prompter.set_prompt (_("New name for playlist:"));
prompter.set_title (_("Rename Playlist"));
prompter.set_prompt (_("New name for playlist:"));
- prompter.set_initial_text (pl->name());
prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT);
prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT);
+ prompter.set_initial_text (pl->name());
prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
- switch (prompter.run ()) {
- case Gtk::RESPONSE_ACCEPT:
+ while (true) {
+ if (prompter.run () != Gtk::RESPONSE_ACCEPT) {
+ break;
+ }
prompter.get_result (name);
if (name.length()) {
prompter.get_result (name);
if (name.length()) {
- pl->set_name (name);
+ if (_session->playlists->by_name (name)) {
+ MessageDialog msg (_("Given playlist name is not unique."));
+ msg.run ();
+ prompter.set_initial_text (Playlist::bump_name (name, *_session));
+ } else {
+ pl->set_name (name);
+ break;
+ }
}
}
- break;
-
- default:
- break;
}
}
}
}