#include <wx/splash.h>
#include <wx/cmdline.h>
#include <wx/preferences.h>
+#include <wx/progdlg.h>
#ifdef __WXOSX__
#include <ApplicationServices/ApplicationServices.h>
#endif
{
_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());
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) {
}
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 ();