From: Robin Gareus Date: Sat, 8 Mar 2014 17:28:16 +0000 (+0100) Subject: paths dialog: use selection as default when adding new dirs X-Git-Tag: 1.0.0~609 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=2fc52ec5fd2c707b0b1ef8e8e244192dcf107138;p=ardour.git paths dialog: use selection as default when adding new dirs --- diff --git a/libs/gtkmm2ext/paths_dialog.cc b/libs/gtkmm2ext/paths_dialog.cc index 9f06562617..1f3a3b5de6 100644 --- a/libs/gtkmm2ext/paths_dialog.cc +++ b/libs/gtkmm2ext/paths_dialog.cc @@ -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 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 ();