Remember last directory in dcpomatic_batch film picker.
authorCarl Hetherington <cth@carlh.net>
Wed, 12 Feb 2014 14:31:40 +0000 (14:31 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 12 Feb 2014 14:31:40 +0000 (14:31 +0000)
Requested-by: Brad Miller
ChangeLog
src/tools/dcpomatic_batch.cc

index 69eec2c0c303d334225c34806e58d687c0927db1..a66eb71d7a9d70c09870fc187c1b188aa4f3edb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-02-12  Carl Hetherington  <cth@carlh.net>
 
+       * Make the batch converter remember its last directory
+       for the film picker (#318).
+
        * Add dcpomatic_batch to OS X .app.
 
 2014-02-11  Carl Hetherington  <cth@carlh.net>
index 41cb23e733f02a3cb1f7fb02d68fc390ef524ce6..58fbaec985a4c369c9de547d869fd87cd9082f9e 100644 (file)
@@ -168,6 +168,10 @@ private:
        void add_film ()
        {
                wxDirDialog* c = new wxDirDialog (this, _("Select film to open"), wxStandardPaths::Get().GetDocumentsDir(), wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
+               if (_last_parent) {
+                       c->SetPath (std_to_wx (_last_parent.get().string ()));
+               }
+               
                int r;
                while (1) {
                        r = c->ShowModal ();
@@ -190,8 +194,12 @@ private:
                        }
                }
 
+               _last_parent = boost::filesystem::path (wx_to_std (c->GetPath ())).parent_path ();
+
                c->Destroy ();
        }
+
+       boost::optional<boost::filesystem::path> _last_parent;
 };
 
 static const wxCmdLineEntryDesc command_line_description[] = {