#include "lib/compose.hpp"
#include "lib/cinema_kdms.h"
#include "lib/dcpomatic_socket.h"
+#include "lib/hints.h"
#include <dcp/exceptions.h>
#include <wx/generic/aboutdlgg.h>
#include <wx/stdpaths.h>
}
}
+ 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.
try {
list<ScreenKDM> 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<Job> (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()
))
);
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
void tools_hints ()
{
if (!_hints_dialog) {
- _hints_dialog = new HintsDialog (this, _film);
+ _hints_dialog = new HintsDialog (this, _film, true);
}
_hints_dialog->Show ();
}
for (size_t i = 0; i < history.size(); ++i) {
- SafeStringStream s;
+ locked_stringstream s;
if (i < 9) {
s << "&" << (i + 1) << " ";
}
{
wxInitAllImageHandlers ();
+ Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
+
wxSplashScreen* splash = 0;
try {
if (!Config::have_existing ("config.xml")) {
}
}
+ 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<wxTimer> _timer;
string _film_to_load;