add new Gtk2mmext::EmScale class for measuring font-based sizing
[ardour.git] / libs / gtkmm2ext / paths_dialog.cc
index d4ccd259ad9853989ed24512fce0e0b2b00b406b..1f3a3b5de640add4436e44e07caa10da000740cf 100644 (file)
@@ -50,7 +50,7 @@ PathsDialog::PathsDialog (std::string title, std::string current_paths, std::str
 
        std::vector <std::string> a = PBD::parse_path(current_paths);
        for(vector<std::string>::const_iterator i = a.begin(); i != a.end(); ++i) {
-               paths_list_view.append(*i);
+               paths_list_view.append_text(*i);
        }
 
        paths_list_view.get_selection()->signal_changed().connect (mem_fun (*this, &PathsDialog::selection_changed));
@@ -107,6 +107,12 @@ PathsDialog::selection_changed () {
 void
 PathsDialog::add_path() {
        Gtk::FileChooserDialog d (_("Add folder to search path"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
+
+       std::vector<int> selection = paths_list_view.get_selected();
+       if (selection.size() == 1 ) {
+               d.set_current_folder(paths_list_view.get_text(selection.at(0), 0));
+       }
+
        d.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
        d.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
        ResponseType r = (ResponseType) d.run ();
@@ -121,7 +127,7 @@ PathsDialog::add_path() {
                                }
                        }
                        if (!dup) {
-                               paths_list_view.prepend(dir);
+                               paths_list_view.prepend_text(dir);
                        }
                }
        }
@@ -153,6 +159,6 @@ PathsDialog::set_default() {
        paths_list_view.clear_items();
        std::vector <std::string> a = PBD::parse_path(_default_paths);
        for(vector<std::string>::const_iterator i = a.begin(); i != a.end(); ++i) {
-               paths_list_view.append(*i);
+               paths_list_view.append_text(*i);
        }
 }