Do not allow ctrl chars in session names (2/2)

The GUI applies this to new sessions only, old sessions that
may now have illegal names can still be loaded.
This commit is contained in:
Robin Gareus 2020-06-09 20:19:10 +02:00
parent 72d45c154a
commit 50e96a2135
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 23 additions and 23 deletions

View file

@ -732,21 +732,6 @@ StartupFSM::check_session_parameters (bool must_be_new)
/* session name is just a name */
}
/* check if name is legal */
const char illegal = Session::session_name_is_legal (session_name);
if (illegal) {
ArdourMessageDialog msg (*session_dialog,
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
return 1; /* keep running dialog */
}
/* check if the currently-exists status matches whether or not
* it should be new
*/
@ -780,6 +765,21 @@ StartupFSM::check_session_parameters (bool must_be_new)
session_is_new = true;
}
/* check if name is legal (error for new sessions only) */
std::string const& illegal = Session::session_name_is_legal (session_name);
if (!illegal.empty() && session_is_new) {
ArdourMessageDialog msg (*session_dialog,
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
return 1; /* keep running dialog */
}
float sr;
SampleFormat fmt;
string program_version;