X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=e29d41db7dd5d9c3175694c16f480fc2dba3e5b0;hb=736b3a068ba5a402b541d32f270669e6e1a4e5c4;hp=6b1d4d260dc3b044252ed5423502d3ca98541f2c;hpb=a8a0dfd1b21de6c0facf965ab119833ff6f790bf;p=dcpomatic.git diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 6b1d4d260..e29d41db7 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -58,6 +58,7 @@ #include "lib/compose.hpp" #include "lib/cinema_kdms.h" #include "lib/dcpomatic_socket.h" +#include "lib/hints.h" #include #include #include @@ -455,6 +456,15 @@ private: } } + if (!get_hints(_film).empty() && Config::instance()->show_hints_before_make_dcp()) { + HintsDialog* hints = new HintsDialog (this, _film, false); + int const r = hints->ShowModal(); + hints->Destroy (); + if (r == wxID_CANCEL) { + return; + } + } + try { /* It seems to make sense to auto-save metadata here, since the make DCP may last a long time, and crashes/power failures are moderately likely. @@ -482,20 +492,26 @@ private: try { list screen_kdms = _film->make_kdms (d->screens(), d->cpl(), d->from(), d->until(), d->formulation()); + + NameFormat::Map name_values; + name_values["film_name"] = _film->name(); + name_values["from"] = dcp::LocalTime(d->from()).date() + " " + dcp::LocalTime(d->from()).time_of_day(); + name_values["to"] = dcp::LocalTime(d->until()).date() + " " + dcp::LocalTime(d->until()).time_of_day(); + if (d->write_to ()) { ScreenKDM::write_files ( - _film->name(), screen_kdms, - d->directory() + d->directory(), + d->name_format(), + name_values ); } else { JobManager::instance()->add ( shared_ptr (new SendKDMEmailJob ( - _film->name(), - _film->dcp_name(), - d->from(), - d->until(), CinemaKDMs::collect (screen_kdms), + d->name_format(), + name_values, + _film->dcp_name(), _film->log() )) ); @@ -517,6 +533,15 @@ private: return; } + if (!get_hints(_film).empty() && Config::instance()->show_hints_before_make_dcp()) { + HintsDialog* hints = new HintsDialog (this, _film, false); + int const r = hints->ShowModal(); + hints->Destroy (); + if (r == wxID_CANCEL) { + return; + } + } + _film->write_metadata (); /* i = 0; try to connect via socket @@ -663,7 +688,7 @@ private: void tools_hints () { if (!_hints_dialog) { - _hints_dialog = new HintsDialog (this, _film); + _hints_dialog = new HintsDialog (this, _film, true); } _hints_dialog->Show (); @@ -908,7 +933,7 @@ private: } for (size_t i = 0; i < history.size(); ++i) { - SafeStringStream s; + locked_stringstream s; if (i < 9) { s << "&" << (i + 1) << " "; } @@ -987,6 +1012,8 @@ private: { wxInitAllImageHandlers (); + Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this)); + wxSplashScreen* splash = 0; try { if (!Config::have_existing ("config.xml")) { @@ -1156,6 +1183,11 @@ private: } } + void config_failed_to_load () + { + message_dialog (_frame, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create.")); + } + DOMFrame* _frame; shared_ptr _timer; string _film_to_load;