summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-07-06 15:36:06 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-07-06 15:36:06 +0000
commit4e5c5adfbb4c6210afe6ab130a6328d812c31fcb (patch)
tree8a423bf8e9625adc1ec6d9c975db875cba64d2ac /gtk2_ardour
parent9239577c4af8bf8301bd7b1e1cfcba1cf7a512bd (diff)
remove extra use of legalize_for_path() and just make sure that session and snapshot names are not FS-pathological (i.e. containing slash or backslash)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5332 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc34
1 files changed, 30 insertions, 4 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index f99f548398..be60ac728e 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1850,11 +1850,24 @@ ARDOUR_UI::snapshot_session ()
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;
@@ -2209,7 +2222,6 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
Glib::ustring session_name;
Glib::ustring session_path;
Glib::ustring template_name;
- Glib::ustring legal_session_folder_name;
int response;
begin:
@@ -2342,12 +2354,26 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
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))) {