diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-09-02 13:55:12 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-09-02 13:55:12 +0100 |
| commit | 82598b8d3bcd52c37a153621144f52d03e77fd20 (patch) | |
| tree | 32df92850024d333ccadfb412a826a33498fc843 /src/tools | |
| parent | f51029d4eb1e663bc5c97b2987d35bb89e6657b5 (diff) | |
Remember the last directory used when opening DCPs in the player (#1121).
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 6753b5423..dec1d3f14 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -207,12 +207,12 @@ private: void file_open () { - wxDirDialog* c = new wxDirDialog ( - this, - _("Select DCP to open"), - wxStandardPaths::Get().GetDocumentsDir(), - wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST - ); + wxString d = wxStandardPaths::Get().GetDocumentsDir(); + if (Config::instance()->last_player_load_directory()) { + d = std_to_wx (Config::instance()->last_player_load_directory()->string()); + } + + wxDirDialog* c = new wxDirDialog (this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST); int r; while (true) { @@ -225,7 +225,9 @@ private: } if (r == wxID_OK) { - load_dcp (wx_to_std (c->GetPath ())); + boost::filesystem::path const dcp (wx_to_std (c->GetPath ())); + load_dcp (dcp); + Config::instance()->set_last_player_load_directory (dcp.parent_path()); } c->Destroy (); |
