summaryrefslogtreecommitdiff
path: root/gtk2_ardour/processor_box.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-04-21 02:24:38 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-04-21 02:24:38 +0000
commitd9cebc2edf8accded23c6f2a1caab73eb47a50fd (patch)
tree976c94ef8ec19b8e5149675eb5092ab6e9cb20de /gtk2_ardour/processor_box.cc
parentcf77196698a395e4174037f36f755b401de679f3 (diff)
commits 6001-6525 inclusive from 2.X applied to 3.0
git-svn-id: svn://localhost/ardour2/branches/3.0@6942 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/processor_box.cc')
-rw-r--r--gtk2_ardour/processor_box.cc26
1 files changed, 21 insertions, 5 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index add816e40f..42711b4936 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -1242,11 +1242,27 @@ ProcessorBox::rename_processor (boost::shared_ptr<Processor> processor)
case Gtk::RESPONSE_ACCEPT:
name_prompter.get_result (result);
if (result.length()) {
- if (_session->route_by_name (result)) {
- ARDOUR_UI::instance()->popup_error (_("A track already exists with that name."));
- return;
- }
- processor->set_name (result);
+
+ int tries = 0;
+ string test = result;
+
+ while (tries < 100) {
+ if (_session->io_name_is_legal (test)) {
+ result = test;
+ break;
+ }
+ tries++;
+
+ test = string_compose ("%1-%2", result, tries);
+ }
+
+ if (tries < 100) {
+ processor->set_name (result);
+ } else {
+ /* unlikely! */
+ ARDOUR_UI::instance()->popup_error
+ (string_compose (_("At least 100 IO objects exist with a name like %1 - name not changed"), result));
+ }
}
break;
}