- dcp::NameFormat::Map name_values;
- name_values['f'] = film->name();
- name_values['b'] = dcp::LocalTime(_timing->from()).date() + " " + dcp::LocalTime(_timing->from()).time_of_day();
- name_values['e'] = dcp::LocalTime(_timing->until()).date() + " " + dcp::LocalTime(_timing->until()).time_of_day();
-
- if (_output->write_to ()) {
- ScreenKDM::write_files (
- screen_kdms,
- _output->directory(),
- _output->name_format(),
- name_values
- );
- }
-
- if (_output->email ()) {
- JobManager::instance()->add (
- shared_ptr<Job> (new SendKDMEmailJob (
- CinemaKDMs::collect (screen_kdms),
- _output->name_format(),
- name_values,
- film->dcp_name(),
- 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."));
+ if (result.second > 0) {
+ /* XXX: proper plural form support in wxWidgets? */
+ wxString s = result.second == 1 ? _("%d KDM written to %s") : _("%d KDMs written to %s");
+ message_dialog (
+ this,
+ wxString::Format (s, result.second, std_to_wx(_output->directory().string()).data())
+ );