summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-09-14 15:45:21 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-09-14 15:45:21 +0000
commit4d112a8e6b90fa64a5cd333042044768111ba994 (patch)
tree6688c5250bc55de106f74ef9be93d7ee574ec9d8 /gtk2_ardour/ardour_ui.cc
parent875f0befd5fb52678d25544fcbcb6e6b55a2c483 (diff)
remove Glib::ustring from libardour; allow any characters except '/' and '\' in paths (may cause issues when loading creatively named 2.X sessions; fix a couple of details of name collection and usage from the startup dialog
git-svn-id: svn://localhost/ardour2/branches/3.0@7772 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc34
1 files changed, 27 insertions, 7 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 8eacd1904b..91352740f7 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -118,6 +118,8 @@ sigc::signal<void> ARDOUR_UI::RapidScreenUpdate;
sigc::signal<void> ARDOUR_UI::SuperRapidScreenUpdate;
sigc::signal<void,nframes_t, bool, nframes_t> ARDOUR_UI::Clock;
+bool could_be_a_valid_path (const string& path);
+
ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
: Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp),
@@ -2465,9 +2467,9 @@ ARDOUR_UI::loading_message (const std::string& /*msg*/)
int
ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, string load_template)
{
- Glib::ustring session_name;
- Glib::ustring session_path;
- Glib::ustring template_name;
+ string session_name;
+ string session_path;
+ string template_name;
int ret = -1;
bool likely_new = false;
@@ -2496,6 +2498,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
} else {
bool const apply = run_startup (should_be_new, load_template);
+
if (!apply) {
if (quit_on_cancel) {
exit (1);
@@ -2513,16 +2516,17 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
/* this shouldn't happen, but we catch it just in case it does */
if (session_name.empty()) {
- break;
+ continue;
}
+
if (_startup->use_session_template()) {
template_name = _startup->session_template_name();
_session_is_new = true;
}
- if (session_name[0] == '/' ||
- (session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
- (session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
+ if (session_name[0] == G_DIR_SEPARATOR ||
+ (session_name.length() > 2 && session_name[0] == '.' && session_name[1] == G_DIR_SEPARATOR) ||
+ (session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == G_DIR_SEPARATOR)) {
/* absolute path or cwd-relative path specified for session name: infer session folder
from what was given.
@@ -2534,6 +2538,22 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
} else {
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;
+ }
+
+ 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;
+ }
}
}