29 PathsDialog::PathsDialog (std::string title, std::string current_paths, std::string default_paths)
30 : Dialog (title, true)
31 , paths_list_view(1, false,
Gtk::SELECTION_SINGLE)
32 , add_path_button(
_(
"Add"))
33 , remove_path_button(
_(
"Delete"))
34 , set_default_button(
_(
"Reset to Default"))
35 , _default_paths(default_paths)
37 set_name (
"PathsDialog");
38 set_skip_taskbar_hint (
true);
40 set_size_request (400, -1);
52 for(vector<std::string>::const_iterator i = a.begin(); i != a.end(); ++i) {
58 VBox *vbox = manage (
new VBox);
64 HBox *hbox = manage (
new HBox);
65 hbox->pack_start (*vbox,
false,
false);
67 hbox->set_spacing (4);
69 get_vbox()->set_spacing (4);
70 get_vbox()->pack_start (*hbox,
true,
true);
72 add_button (Stock::CANCEL, RESPONSE_CANCEL);
73 add_button (Stock::OK, RESPONSE_ACCEPT);
91 if (i > 0) path += G_SEARCHPATH_SEPARATOR;
100 if (selection.size() > 0) {
109 Gtk::FileChooserDialog d (
_(
"Add folder to search path"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
112 if (selection.size() == 1 ) {
116 d.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
117 d.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
118 ResponseType r = (ResponseType) d.run ();
119 if (r == Gtk::RESPONSE_OK) {
120 std::string dir = d.get_filename();
121 if (Glib::file_test (dir, Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) {
139 if (selection.size() == 0 ) { return ; }
142 Gtk::TreeModel::iterator row_it =
paths_list_view.get_selection()->get_selected();
144 Glib::RefPtr<Gtk::TreeStore> refStore = Glib::RefPtr<Gtk::TreeStore>::cast_dynamic(reftm);
146 refStore->erase(row_it);
149 Glib::RefPtr<Gtk::ListStore> refLStore = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(reftm);
151 refLStore->erase(row_it);
161 for(vector<std::string>::const_iterator i = a.begin(); i != a.end(); ++i) {
Gtk::Button add_path_button
Gtk::Button remove_path_button
LIBPBD_API std::vector< std::string > parse_path(std::string path, bool check_if_exists=false)
Gtk::Button set_default_button
std::string get_serialized_paths()
std::string _default_paths
Gtk::ListViewText paths_list_view