- KDMDialog* d = new KDMDialog (this, _film);
- if (d->ShowModal () != wxID_OK) {
- d->Destroy ();
- return;
- }
-
- try {
- list<ScreenKDM> screen_kdms = _film->make_kdms (d->screens(), d->cpl(), d->from(), d->until(), d->formulation());
- if (d->write_to ()) {
- ScreenKDM::write_files (
- _film->name(),
- screen_kdms,
- d->directory()
- );
- } else {
- JobManager::instance()->add (
- shared_ptr<Job> (new SendKDMEmailJob (
- _film->name(),
- _film->dcp_name(),
- d->from(),
- d->until(),
- CinemaKDMs::collect (screen_kdms),
- _film->log()
- ))
- );
- }
- } catch (dcp::NotEncryptedError& e) {
- error_dialog (this, _("CPL's content is not encrypted."));
- } catch (exception& e) {
- error_dialog (this, e.what ());
- } catch (...) {
- error_dialog (this, _("An unknown exception occurred."));