From 05626747f02ae34cf2379ae13df5dfdce07a049e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 9 Dec 2011 15:20:14 +0000 Subject: [PATCH] Patch from colinf to use session_name_is_legal for snapshots too (#4548). git-svn-id: svn://localhost/ardour2/branches/3.0@10945 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 54a74884f9..5e7b75b90e 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2171,7 +2171,7 @@ ARDOUR_UI::stop_blinking () } -/** Ask the user for the name of a new shapshot and then take it. +/** Ask the user for the name of a new snapshot and then take it. */ void @@ -2205,21 +2205,10 @@ ARDOUR_UI::snapshot_session (bool switch_to_it) bool do_save = (snapname.length() != 0); if (do_save) { - if (snapname.find ('/') != string::npos) { - MessageDialog msg (_("To ensure compatibility with various systems\n" - "snapshot names may not contain a '/' character")); - msg.run (); - goto again; - } - if (snapname.find ('\\') != string::npos) { - MessageDialog msg (_("To ensure compatibility with various systems\n" - "snapshot names may not contain a '\\' character")); - msg.run (); - goto again; - } - if (snapname.find (':') != string::npos) { - MessageDialog msg (_("To ensure compatibility with various systems\n" - "snapshot names may not contain a ':' character")); + char illegal = Session::session_name_is_legal(snapname); + if (illegal) { + MessageDialog msg (string_compose (_("To ensure compatibility with various systems\n" + "snapshot names may not contain a '%1' character"), illegal)); msg.run (); goto again; } @@ -2253,7 +2242,7 @@ ARDOUR_UI::snapshot_session (bool switch_to_it) } } -/** Ask the user for the name of a new shapshot and then take it. +/** Ask the user for a new session name and then rename the session to it. */ void