X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmissing_file_dialog.cc;h=9fe125843279424fe860926f0839f307c82b4dec;hb=9840a115373247eaac804e87f63346c175c99c70;hp=56139be32fa5ad63d099705a8f4916578d8216d2;hpb=bc29adf05493ff2503b230604b237b75eb7af7fa;p=ardour.git diff --git a/gtk2_ardour/missing_file_dialog.cc b/gtk2_ardour/missing_file_dialog.cc index 56139be32f..9fe1258432 100644 --- a/gtk2_ardour/missing_file_dialog.cc +++ b/gtk2_ardour/missing_file_dialog.cc @@ -19,10 +19,13 @@ #include "pbd/compose.h" #include "pbd/replace_all.h" #include "pbd/strsplit.h" +#include "pbd/search_path.h" #include "ardour/session.h" +#include "gtkmm2ext/utils.h" #include "missing_file_dialog.h" +#include "i18n.h" using namespace Gtk; using namespace std; @@ -30,7 +33,7 @@ using namespace ARDOUR; using namespace PBD; MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataType type) - : ArdourDialog (_("Missing File!"), true, false) + : ArdourDialog (_("Missing File"), true, false) , filetype (type) , chooser (_("Select a folder to search"), FILE_CHOOSER_ACTION_SELECT_FOLDER) , use_chosen (_("Add chosen folder to search path, and try again")) @@ -39,9 +42,13 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT , all_missing_ok (choice_group, _("Skip all missing files"), false) , this_missing_ok (choice_group, _("Skip this file"), false) { - set_session (s); + /* This dialog is always shown programatically. Center the window.*/ + set_position (Gtk::WIN_POS_CENTER); + + set_session (s); add_button (_("Done"), RESPONSE_OK); + set_default_response (RESPONSE_OK); string typestr; @@ -54,15 +61,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_justify (JUSTIFY_LEFT); 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, Gtkmm2ext::markup_escape_text (path), Gtkmm2ext::markup_escape_text (oss.str()))); HBox* hbox = manage (new HBox); hbox->pack_start (msg, false, true); @@ -81,7 +91,7 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT button_packer_box->pack_start (stop_loading_button, false, false); button_packer_box->show_all (); - + get_vbox()->set_spacing (6); get_vbox()->set_border_width (25); get_vbox()->set_homogeneous (false); @@ -127,7 +137,7 @@ MissingFileDialog::add_chosen () break; } - split (str, dirs, ':'); + split (str, dirs, G_SEARCHPATH_SEPARATOR); newdir = chooser.get_filename (); @@ -138,9 +148,9 @@ MissingFileDialog::add_chosen () } if (!str.empty()) { - str += ':'; - } - + str += G_SEARCHPATH_SEPARATOR; + } + str += newdir; switch (filetype) {