summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-12-09 03:06:58 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-12-09 03:06:58 +0000
commit86ac8536d2a0d09347e622c2df43aebeba4e4150 (patch)
tree3508ce081b7138eb77465260df873cc1a056d8dd /gtk2_ardour
parent26366a40629693b387331c81ed255116fa8f7f7c (diff)
centralize legal-session-name-checkng and include : and ; in characters that we disallow, because they conflict with search path conventions on *nix and windows
git-svn-id: svn://localhost/ardour2/branches/3.0@10943 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc30
1 files changed, 10 insertions, 20 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 382d8b7ca4..54a74884f9 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -2280,15 +2280,11 @@ ARDOUR_UI::rename_session ()
bool do_rename = (name.length() != 0);
if (do_rename) {
- if (name.find ('/') != string::npos) {
- MessageDialog msg (_("To ensure compatibility with various systems\n"
- "session names may not contain a '/' character"));
- msg.run ();
- goto again;
- }
- if (name.find ('\\') != string::npos) {
- MessageDialog msg (_("To ensure compatibility with various systems\n"
- "session names may not contain a '\\' character"));
+ char illegal = Session::session_name_is_legal (name);
+
+ if (illegal) {
+ MessageDialog msg (string_compose (_("To ensure compatibility with various systems\n"
+ "session names may not contain a '%1' character"), illegal));
msg.run ();
goto again;
}
@@ -2666,19 +2662,13 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
session_path = _startup->session_folder();
- if (session_name.find ('/') != string::npos) {
- MessageDialog msg (*_startup,
- _("To ensure compatibility with various systems\n"
- "session names may not contain a '/' character"));
- msg.run ();
- ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
- continue;
- }
+ char illegal = Session::session_name_is_legal (session_name);
- if (session_name.find ('\\') != string::npos) {
+ if (illegal) {
MessageDialog msg (*_startup,
- _("To ensure compatibility with various systems\n"
- "session names may not contain a '\\' character"));
+ string_compose (_("To ensure compatibility with various systems\n"
+ "session names may not contain a '%1' character"),
+ illegal));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;