From 2fc52ec5fd2c707b0b1ef8e8e244192dcf107138 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 8 Mar 2014 18:28:16 +0100 Subject: [PATCH] paths dialog: use selection as default when adding new dirs --- libs/gtkmm2ext/paths_dialog.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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 (); -- 2.30.2