prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
prompter.set_prompt (_("Name of New Snapshot"));
prompter.set_initial_text (timebuf);
-
+
+ again:
switch (prompter.run()) {
case RESPONSE_ACCEPT:
prompter.get_result (snapname);
if (snapname.length()){
+ if (snapname.find ('/')) {
+ MessageDialog msg (_("To ensure compatibility with various systems\n"
+ "snapshot names may not contain a '/' character"));
+ msg.run ();
+ goto again;
+ }
+ if (snapname.find ('\\')) {
+ MessageDialog msg (_("To ensure compatibility with various systems\n"
+ "snapshot names may not contain a '\\' character"));
+ msg.run ();
+ goto again;
+ }
save_state (snapname);
}
break;
Glib::ustring session_name;
Glib::ustring session_path;
Glib::ustring template_name;
- Glib::ustring legal_session_folder_name;
int response;
begin:
should_be_new = true;
- legal_session_folder_name = legalize_for_path (session_name);
+ if (session_name.find ('/')) {
+ MessageDialog msg (*new_session_dialog, _("To ensure compatibility with various systems\n"
+ "session names may not contain a '/' character"));
+ msg.run ();
+ response = RESPONSE_NONE;
+ goto try_again;
+ }
+
+ if (session_name.find ('\\')) {
+ MessageDialog msg (*new_session_dialog, _("To ensure compatibility with various systems\n"
+ "session names may not contain a '\\' character"));
+ msg.run ();
+ response = RESPONSE_NONE;
+ goto try_again;
+ }
//XXX This is needed because session constructor wants a
//non-existant path. hopefully this will be fixed at some point.
- session_path = Glib::build_filename (session_path, legal_session_folder_name);
+ session_path = Glib::build_filename (session_path, session_name);
if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
string xml_path;
xml_path = _path;
- xml_path += legalize_for_path (_current_snapshot_name);
+ xml_path += _current_snapshot_name;
xml_path += _pending_suffix;
unlink (xml_path.c_str());
return;
}
- const string old_xml_path = _path + legalize_for_path (old_name) + _statefile_suffix;
- const string new_xml_path = _path + legalize_for_path (new_name) + _statefile_suffix;
+ const string old_xml_path = _path + old_name + _statefile_suffix;
+ const string new_xml_path = _path + new_name + _statefile_suffix;
if (rename (old_xml_path.c_str(), new_xml_path.c_str()) != 0) {
error << string_compose(_("could not rename snapshot %1 to %2"), old_name, new_name) << endmsg;
return;
}
- const string xml_path = _path + legalize_for_path (snapshot_name) + _statefile_suffix;
+ const string xml_path = _path + snapshot_name + _statefile_suffix;
/* make a backup copy of the state file */
const string bak_path = xml_path + ".bak";
/* proper save: use _statefile_suffix (.ardour in English) */
xml_path = _path;
- xml_path += legalize_for_path (snapshot_name);
+ xml_path += snapshot_name;
xml_path += _statefile_suffix;
/* make a backup copy of the old file */
/* pending save: use _pending_suffix (.pending in English) */
xml_path = _path;
- xml_path += legalize_for_path (snapshot_name);
+ xml_path += snapshot_name;
xml_path += _pending_suffix;
}
string tmp_path;
tmp_path = _path;
- tmp_path += legalize_for_path (snapshot_name);
+ tmp_path += snapshot_name;
tmp_path += ".tmp";
// cerr << "actually writing state to " << xml_path << endl;
/* check for leftover pending state from a crashed capture attempt */
xmlpath = _path;
- xmlpath += legalize_for_path (snapshot_name);
+ xmlpath += snapshot_name;
xmlpath += _pending_suffix;
if (Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
if (!state_was_pending) {
xmlpath = _path;
- xmlpath += legalize_for_path (snapshot_name);
+ xmlpath += snapshot_name;
xmlpath += _statefile_suffix;
}
string backup_path;
backup_path = _path;
- backup_path += legalize_for_path (snapshot_name);
+ backup_path += snapshot_name;
backup_path += "-1";
backup_path += _statefile_suffix;
}
this_snapshot_path = _path;
- this_snapshot_path += legalize_for_path (_current_snapshot_name);
+ this_snapshot_path += _current_snapshot_name;
this_snapshot_path += _statefile_suffix;
for (vector<string*>::iterator i = state_files->begin(); i != state_files->end(); ++i) {
snapshot_name = _current_snapshot_name;
}
- xml_path = _path + legalize_for_path (snapshot_name) + ".history";
+ xml_path = _path + snapshot_name + ".history";
bak_path = xml_path + ".bak";
}
/* read xml */
- xmlpath = _path + legalize_for_path (snapshot_name) + ".history";
+ xmlpath = _path + snapshot_name + ".history";
cerr << string_compose(_("Loading history from '%1'."), xmlpath) << endmsg;
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {