- } 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."));
+ return;
+ } catch (runtime_error& e) {
+ error_dialog (this, std_to_wx(e.what()));
+ return;
+ }
+
+ auto result = _output->make (kdms, film->name(), bind (&KDMDialog::confirm_overwrite, this, _1));
+ if (result.first) {
+ JobManager::instance()->add (result.first);
+ }
+
+ 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())
+ );