summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-06-21 23:56:13 +0200
committerCarl Hetherington <cth@carlh.net>2021-06-21 23:56:13 +0200
commitdf79d429bf1663a0053844b7e98690d2fdfb790d (patch)
tree0543748fcf25600505701b769307874324324c06 /src/wx
parentd0a85f18ad5b0b2eacaa2c7071a0565ce6eb05d2 (diff)
Remember the path used for "add files" (#2049).
Also default to the home directory rather than where DoM was run from, or something equally unhelpful.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_panel.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 68f6f1b94..bcc699913 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -34,6 +34,7 @@
#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/content_factory.h"
+#include "lib/cross.h"
#include "lib/dcp_content.h"
#include "lib/dcpomatic_log.h"
#include "lib/ffmpeg_content.h"
@@ -420,13 +421,15 @@ ContentPanel::add_file_clicked ()
return;
}
+ auto path = Config::instance()->add_files_path();
+
/* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using
non-Latin filenames or paths.
*/
auto d = new wxFileDialog (
_splitter,
_("Choose a file or files"),
- wxT (""),
+ std_to_wx(path ? path->string() : home_directory().string()),
wxT (""),
wxT ("All files|*.*|Subtitle files|*.srt;*.xml|Audio files|*.wav;*.w64;*.flac;*.aif;*.aiff"),
wxFD_MULTIPLE | wxFD_CHANGE_DIR
@@ -447,6 +450,10 @@ ContentPanel::add_file_clicked ()
}
add_files (path_list);
+ if (!path_list.empty()) {
+ Config::instance()->set_add_files_path(path_list[0].parent_path());
+ }
+
d->Destroy ();
}