30 const string& default_path,
31 sigc::slot<std::string>
get, sigc::slot<bool, std::string> set)
35 , add_chooser (
_(
"Select folder to search for media"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
39 HBox* hbox = manage (
new HBox);
41 hbox->set_border_width (12);
42 hbox->set_spacing (6);
44 hbox->pack_end (*manage (
new Label (
_(
"Click to add a new location"))),
false,
false);
48 vbox.pack_end (*hbox);
75 int const n = p->
table.property_n_rows();
76 p->
table.resize (n + 1, 3);
78 Label* label = manage (
new Label);
79 label->set_alignment (0.0, 0.0);
82 p->
table.attach (*label, 1, 2, n, n + 1, FILL | EXPAND);
83 p->
table.attach (
vbox, 2, 3, n, n + 1, FILL | EXPAND);
90 for (list<PathEntry*>::iterator p =
paths.begin(); p !=
paths.end(); ++p) {
100 string str =
_get ();
106 split (str, dirs, G_SEARCHPATH_SEPARATOR);
108 for (vector<string>::iterator d = dirs.begin(); d != dirs.end(); ++d) {
118 for (list<PathEntry*>::iterator p =
paths.begin(); p !=
paths.end(); ++p) {
121 str += G_SEARCHPATH_SEPARATOR;
123 str += (*p)->entry.get_text ();
133 paths.push_back (pe);
148 : remove_button (Stock::REMOVE)
150 entry.set_text (path);
154 box.set_homogeneous (
false);
Gtk::FileChooserButton add_chooser
LIBPBD_API void split(std::string, std::vector< std::string > &, char)
PathEntry(const std::string &path, bool removable=true)
SearchPathOption(const std::string &pathname, const std::string &label, const std::string &default_path, sigc::slot< std::string >, sigc::slot< bool, std::string >)
void set_state_from_config()
Gtk::Button remove_button
void add_to_page(OptionEditorPage *)
void add_path(const std::string &path, bool removable=true)
void remove_path(PathEntry *)
LIBPBD_API Glib::ustring short_path(const Glib::ustring &path, Glib::ustring::size_type target_characters)
std::list< PathEntry * > paths
sigc::slot< std::string > _get
slot to get the configuration variable's value
sigc::slot< bool, std::string > _set
slot to set the configuration variable's value
std::string string_compose(const std::string &fmt, const T1 &o1)