, _hints_dialog (0)
, _servers_list_dialog (0)
, _config_dialog (0)
+ , _kdm_dialog (0)
, _file_menu (0)
, _history_items (0)
, _history_position (0)
return;
}
- KDMDialog* d = new KDMDialog (this, _film);
- if (d->ShowModal () != wxID_OK) {
- d->Destroy ();
- return;
+ if (_kdm_dialog) {
+ _kdm_dialog->Destroy ();
+ _kdm_dialog = 0;
}
- 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."));
- }
-
- d->Destroy ();
+ _kdm_dialog = new KDMDialog (this, _film);
+ _kdm_dialog->Show (this);
}
void jobs_make_dcp_batch ()
HintsDialog* _hints_dialog;
ServersListDialog* _servers_list_dialog;
wxPreferencesEditor* _config_dialog;
+ KDMDialog* _kdm_dialog;
wxMenu* _file_menu;
shared_ptr<Film> _film;
int _history_items;