return;
}
- auto path = Config::instance()->add_files_path();
+ auto path = Config::instance()->initial_path("AddFilesPath");
/* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using
non-Latin filenames or paths.
add_files (path_list);
if (!path_list.empty()) {
- Config::instance()->set_add_files_path(path_list[0].parent_path());
+ Config::instance()->set_initial_path("AddFilesPath", path_list[0].parent_path());
}
d->Destroy ();
void
ContentPanel::add_folder_clicked ()
{
- auto d = new wxDirDialog (_splitter, _("Choose a folder"), wxT(""), wxDD_DIR_MUST_EXIST);
+ auto const initial_path = Config::instance()->initial_path("AddFilesPath");
+
+ 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) {
void
ContentPanel::add_dcp_clicked ()
{
- auto d = new wxDirDialog (_splitter, _("Choose a DCP folder"), wxT(""), wxDD_DIR_MUST_EXIST);
- int r = d->ShowModal ();
- boost::filesystem::path const path (wx_to_std (d->GetPath ()));
- d->Destroy ();
+ auto const initial_path = Config::instance()->initial_path("AddFilesPath");
+ auto d = new wxDirDialog(_splitter, _("Choose a DCP 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) {
return;
}
+ boost::filesystem::path const path(wx_to_std(d->GetPath()));
add_dcp(path);
}