#include "pbd/strsplit.h"
#include "pbd/compose.h"
+#include "pbd/shortpath.h"
+
#include "search_path_option.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace Gtk;
SearchPathOption::SearchPathOption (const string& pathname, const string& label,
+ const string& default_path,
sigc::slot<std::string> get, sigc::slot<bool, std::string> set)
: Option (pathname, label)
, _get (get)
hbox->pack_end (add_chooser, true, true);
hbox->pack_end (*manage (new Label (_("Click to add a new location"))), false, false);
hbox->show_all ();
-
+
vbox.pack_start (path_box);
vbox.pack_end (*hbox);
session_label.set_use_markup (true);
- session_label.set_markup (string_compose ("<i>%1</i>", _("the session folder")));
+ session_label.set_markup (string_compose ("<i>%1 (%2)</i>", _("the session folder"), short_path (default_path, 32)));
session_label.set_alignment (0.0, 0.5);
session_label.show ();
SearchPathOption::~SearchPathOption()
{
-
+
}
Label* label = manage (new Label);
label->set_alignment (0.0, 0.0);
- label->set_markup (string_compose ("%1", _name));
+ label->set_text (string_compose ("%1", _name));
p->table.attach (*label, 1, 2, n, n + 1, FILL | EXPAND);
p->table.attach (vbox, 2, 3, n, n + 1, FILL | EXPAND);
clear ();
path_box.pack_start (session_label);
- split (str, dirs, ':');
-
+ split (str, dirs, G_SEARCHPATH_SEPARATOR);
+
for (vector<string>::iterator d = dirs.begin(); d != dirs.end(); ++d) {
add_path (*d);
}
SearchPathOption::changed ()
{
string str;
-
+
for (list<PathEntry*>::iterator p = paths.begin(); p != paths.end(); ++p) {
if (!str.empty()) {
- str += ':';
+ str += G_SEARCHPATH_SEPARATOR;
}
str += (*p)->entry.get_text ();
}
box.set_spacing (6);
box.set_homogeneous (false);
box.pack_start (entry, true, true);
-
+
if (removable) {
box.pack_start (remove_button, false, false);
remove_button.show ();