diff options
author | Robin Gareus <robin@gareus.org> | 2014-03-08 18:28:16 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-03-08 18:28:16 +0100 |
commit | 2fc52ec5fd2c707b0b1ef8e8e244192dcf107138 (patch) | |
tree | 91df0869cebcf5623c883d3ecd80e600a11d714e | |
parent | 732d58ba811e1058fb7aaed06cc2a7b0f37f1aa3 (diff) |
paths dialog: use selection as default when adding new dirs
-rw-r--r-- | libs/gtkmm2ext/paths_dialog.cc | 6 |
1 files changed, 6 insertions, 0 deletions
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<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 (); |