Updated da_DK translation from Anders Uhl Pedersen.
[dcpomatic.git] / src / tools / dcpomatic_player.cc
index a0221424e24a999cf8b97c8395abcb57d1595d83..836244db91c516bd9e76c9b5632fdc7301236acb 100644 (file)
@@ -41,6 +41,7 @@
 #include <wx/splash.h>
 #include <wx/cmdline.h>
 #include <wx/preferences.h>
+#include <wx/progdlg.h>
 #ifdef __WXOSX__
 #include <ApplicationServices/ApplicationServices.h>
 #endif
@@ -132,16 +133,18 @@ public:
        {
                _film.reset (new Film (optional<boost::filesystem::path>()));
                shared_ptr<DCPContent> dcp (new DCPContent (_film, dir));
-               _film->examine_and_add_content (dcp);
+               _film->examine_and_add_content (dcp, true);
 
                JobManager* jm = JobManager::instance ();
-               while (jm->work_to_do ()) {
-                       /* XXX: progress dialog */
-                       while (signal_manager->ui_idle ()) {}
+
+               wxProgressDialog* progress = new wxProgressDialog (_("DCP-o-matic Player"), _("Loading DCP"));
+
+               while (jm->work_to_do() || signal_manager->ui_idle()) {
                        dcpomatic_sleep (1);
+                       progress->Pulse ();
                }
 
-               while (signal_manager->ui_idle ()) {}
+               progress->Destroy ();
 
                DCPOMATIC_ASSERT (!jm->get().empty());
 
@@ -209,12 +212,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) {
@@ -227,7 +230,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 ();