diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-07 10:34:25 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-07 10:34:25 +0100 |
| commit | be00f12bdb5d74677ae55c7919fae9339e882090 (patch) | |
| tree | 87e9336ab474f3305623a4b1936607bf5cb2cdcf /src/tools | |
| parent | b82eb916dd469ee7c86ebea7a0bf4892d4a1258e (diff) | |
Re-add option to save DKDMs to a file.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 799124ee8..6b1d4d260 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -92,6 +92,7 @@ using std::list; using std::exception; using boost::shared_ptr; using boost::dynamic_pointer_cast; +using boost::optional; class FilmChangedDialog : public boost::noncopyable { @@ -563,20 +564,16 @@ private: return; } + optional<dcp::EncryptedKDM> kdm; try { - vector<dcp::EncryptedKDM> dkdms = Config::instance()->dkdms (); - dkdms.push_back ( - _film->make_kdm ( - Config::instance()->decryption_chain()->leaf(), - vector<dcp::Certificate> (), - d->cpl (), - dcp::LocalTime ("2012-01-01T01:00:00+00:00"), - dcp::LocalTime ("2112-01-01T01:00:00+00:00"), - dcp::MODIFIED_TRANSITIONAL_1 - ) + kdm = _film->make_kdm ( + Config::instance()->decryption_chain()->leaf(), + vector<dcp::Certificate> (), + d->cpl (), + dcp::LocalTime ("2012-01-01T01:00:00+00:00"), + dcp::LocalTime ("2112-01-01T01:00:00+00:00"), + dcp::MODIFIED_TRANSITIONAL_1 ); - - Config::instance()->set_dkdms (dkdms); } catch (dcp::NotEncryptedError& e) { error_dialog (this, _("CPL's content is not encrypted.")); } catch (exception& e) { @@ -585,6 +582,17 @@ private: error_dialog (this, _("An unknown exception occurred.")); } + if (kdm) { + if (d->internal ()) { + vector<dcp::EncryptedKDM> dkdms = Config::instance()->dkdms (); + dkdms.push_back (kdm.get()); + Config::instance()->set_dkdms (dkdms); + } else { + boost::filesystem::path path = d->directory() / (_film->dcp_name(false) + "_DKDM.xml"); + kdm->as_xml (path); + } + } + d->Destroy (); } |
