Visual tweaks to Soundcloud panel
[ardour.git] / gtk2_ardour / missing_file_dialog.cc
index df09d8c21811365fe60e7bda2995d60b9ad62afb..532101e76261538c1a4d209cc22078e57648b63c 100644 (file)
 #include "pbd/compose.h"
 #include "pbd/replace_all.h"
 #include "pbd/strsplit.h"
+#include "pbd/search_path.h"
 
 #include "ardour/session.h"
 
 #include "missing_file_dialog.h"
+#include "i18n.h"
 
 using namespace Gtk;
 using namespace std;
@@ -42,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;
 
@@ -54,15 +57,18 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT
                 break;
         }
 
-        string dirstr;
+       vector<string> source_dirs = s->source_search_path (type);
+       vector<string>::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 (_("Ardour cannot find the %1 file\n\n<i>%2</i>\n\nin any of these folders:\n\n\
-<tt>%3</tt>\n\n"), typestr, path, dirstr));
+        msg.set_markup (string_compose (_("%1 cannot find the %2 file\n\n<i>%3</i>\n\nin any of these folders:\n\n\
+<tt>%4</tt>\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);
@@ -81,7 +87,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 +133,7 @@ MissingFileDialog::add_chosen ()
                 break;
         }
 
-        split (str, dirs, ':');
+        split (str, dirs, G_SEARCHPATH_SEPARATOR);
 
         newdir = chooser.get_filename ();
 
@@ -138,9 +144,9 @@ MissingFileDialog::add_chosen ()
         }
 
         if (!str.empty()) {
-                str += ':';
-        } 
-        
+                str += G_SEARCHPATH_SEPARATOR;
+        }
+
         str += newdir;
 
         switch (filetype) {