projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests pass.
[dcpomatic.git]
/
src
/
wx
/
new_film_dialog.cc
diff --git
a/src/wx/new_film_dialog.cc
b/src/wx/new_film_dialog.cc
index 90c2d727ef27defab61568d07025d7ec1408af76..191482a7cbcdb23ca3da8f48720dbbcdc7bf2d06 100644
(file)
--- a/
src/wx/new_film_dialog.cc
+++ b/
src/wx/new_film_dialog.cc
@@
-29,6
+29,8
@@
using namespace std;
using namespace boost;
using namespace std;
using namespace boost;
+boost::optional<string> NewFilmDialog::_directory;
+
NewFilmDialog::NewFilmDialog (wxWindow* parent)
: wxDialog (parent, wxID_ANY, _("New Film"))
{
NewFilmDialog::NewFilmDialog (wxWindow* parent)
: wxDialog (parent, wxID_ANY, _("New Film"))
{
@@
-49,7
+51,12
@@
NewFilmDialog::NewFilmDialog (wxWindow* parent)
#else
_folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST);
#endif
#else
_folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST);
#endif
- _folder->SetPath (std_to_wx (Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()))));
+
+ if (!_directory) {
+ _directory = Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()));
+ }
+
+ _folder->SetPath (std_to_wx (_directory.get()));
table->Add (_folder, 1, wxEXPAND);
wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
table->Add (_folder, 1, wxEXPAND);
wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
@@
-61,6
+68,11
@@
NewFilmDialog::NewFilmDialog (wxWindow* parent)
overall_sizer->SetSizeHints (this);
}
overall_sizer->SetSizeHints (this);
}
+NewFilmDialog::~NewFilmDialog ()
+{
+ _directory = wx_to_std (_folder->GetPath ());
+}
+
string
NewFilmDialog::get_path () const
{
string
NewFilmDialog::get_path () const
{