X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmissing_file_dialog.cc;h=532101e76261538c1a4d209cc22078e57648b63c;hb=c22e96522d9275db4b1b4ba8edddbda5e7f798b9;hp=9d5712ee6134aae54855d601a61b4283e128b6c9;hpb=ed626628b54e67dd9621c08d82a42afaed00c7ac;p=ardour.git diff --git a/gtk2_ardour/missing_file_dialog.cc b/gtk2_ardour/missing_file_dialog.cc index 9d5712ee61..532101e762 100644 --- a/gtk2_ardour/missing_file_dialog.cc +++ b/gtk2_ardour/missing_file_dialog.cc @@ -19,6 +19,7 @@ #include "pbd/compose.h" #include "pbd/replace_all.h" #include "pbd/strsplit.h" +#include "pbd/search_path.h" #include "ardour/session.h" @@ -43,6 +44,7 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT set_session (s); add_button (_("Done"), RESPONSE_OK); + set_default_response (RESPONSE_OK); string typestr; @@ -55,15 +57,18 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT break; } - string dirstr; + vector source_dirs = s->source_search_path (type); + vector::iterator i = source_dirs.begin(); + ostringstream oss; + oss << *i << endl; - dirstr = s->source_search_path (type); - cerr << "Search path = " << dirstr << endl; - replace_all (dirstr, ":", "\n"); + while (++i != source_dirs.end()) { + oss << *i << endl; + } msg.set_justify (JUSTIFY_CENTER); msg.set_markup (string_compose (_("%1 cannot find the %2 file\n\n%3\n\nin any of these folders:\n\n\ -%4\n\n"), PROGRAM_NAME, typestr, path, dirstr)); +%4\n\n"), PROGRAM_NAME, typestr, Glib::Markup::escape_text(path), Glib::Markup::escape_text (oss.str()))); HBox* hbox = manage (new HBox); hbox->pack_start (msg, false, true); @@ -128,7 +133,7 @@ MissingFileDialog::add_chosen () break; } - split (str, dirs, ':'); + split (str, dirs, G_SEARCHPATH_SEPARATOR); newdir = chooser.get_filename (); @@ -139,7 +144,7 @@ MissingFileDialog::add_chosen () } if (!str.empty()) { - str += ':'; + str += G_SEARCHPATH_SEPARATOR; } str += newdir;