summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-05 20:47:05 +0100
committerCarl Hetherington <cth@carlh.net>2022-12-05 20:47:09 +0100
commit84107d835469974b514d6cab702a770e11a9cd75 (patch)
treea8c93e102d2218b28d60617ca156d86154c545a0
parent9c096947fee8eb296c4341fec6426d5b74fd3d36 (diff)
Use the same default folder for add folder as add files (#2348).
-rw-r--r--src/wx/content_panel.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 1a5dbdc51..b2b9f04c6 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -619,7 +619,9 @@ ContentPanel::add_file_clicked ()
void
ContentPanel::add_folder_clicked ()
{
- auto d = new wxDirDialog (_splitter, _("Choose a folder"), wxT(""), wxDD_DIR_MUST_EXIST);
+ auto const initial_path = Config::instance()->add_files_path();
+
+ auto d = new wxDirDialog(_splitter, _("Choose a folder"), std_to_wx(initial_path ? initial_path->string() : home_directory().string()), wxDD_DIR_MUST_EXIST);
ScopeGuard sg = [d]() { d->Destroy(); };
int r = d->ShowModal ();
if (r != wxID_OK) {