Add DCP-o-matic DKDMs straight to the configured list.
authorCarl Hetherington <cth@carlh.net>
Wed, 6 Jan 2016 16:54:51 +0000 (16:54 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 6 Jan 2016 16:54:51 +0000 (16:54 +0000)
src/tools/dcpomatic.cc
src/wx/self_dkdm_dialog.cc
src/wx/self_dkdm_dialog.h

index 3162dee985e212849e841349aad90a211e14b404..0260cd9a88c3baad1c98e8f77ac77330394b10f0 100644 (file)
@@ -541,17 +541,19 @@ private:
                }
 
                try {
-                       dcp::EncryptedKDM 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
+                       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
+                                       )
                                );
 
-                       string const name = tidy_for_filename(_film->name()) + "_DKDM.kdm.xml";
-                       kdm.as_xml (d->directory() / name);
+                       Config::instance()->set_dkdms (dkdms);
                } catch (dcp::NotEncryptedError& e) {
                        error_dialog (this, _("CPL's content is not encrypted."));
                } catch (exception& e) {
index fed233ad14e4f851a8b8f977bc7b4c4fe20faa05..710f5e42d3c9ec17c4c731b2a6ba0e61d87fb76c 100644 (file)
 #include "lib/film.h"
 #include "lib/screen.h"
 #include <libcxml/cxml.h>
-#ifdef DCPOMATIC_USE_OWN_PICKER
-#include "dir_picker_ctrl.h"
-#else
-#include <wx/filepicker.h>
-#endif
 #include <wx/treectrl.h>
 #include <wx/listctrl.h>
 #include <wx/stdpaths.h>
@@ -60,27 +55,6 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr<const Film>
        _cpl = new KDMCPLPanel (this, film->cpls ());
        vertical->Add (_cpl);
 
-       /* Sub-heading: Output */
-       h = new wxStaticText (this, wxID_ANY, _("Output"));
-       h->SetFont (subheading_font);
-       vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
-
-       wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
-
-       add_label_to_sizer (table, this, _("Write to"), true);
-
-#ifdef DCPOMATIC_USE_OWN_PICKER
-       _folder = new DirPickerCtrl (this);
-#else
-       _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
-#endif
-
-       _folder->SetPath (wxStandardPaths::Get().GetDocumentsDir());
-
-       table->Add (_folder, 1, wxEXPAND);
-
-       vertical->Add (table);
-
        /* Make an overall sizer to get a nice border, and put some buttons in */
 
        wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
@@ -112,9 +86,3 @@ SelfDKDMDialog::cpl () const
 {
        return _cpl->cpl ();
 }
-
-boost::filesystem::path
-SelfDKDMDialog::directory () const
-{
-       return wx_to_std (_folder->GetPath ());
-}
index edf64132d58761346f69d4c48300d17283435dd4..5b1404081aa9bee355ac57b638112f4e0a9bb5da 100644 (file)
@@ -26,8 +26,6 @@
 
 class Film;
 class KDMCPLPanel;
-class DirPickerCtrl;
-class wxDirPickerCtrl;
 
 class SelfDKDMDialog : public wxDialog
 {
@@ -35,15 +33,9 @@ public:
        SelfDKDMDialog (wxWindow *, boost::shared_ptr<const Film>);
 
        boost::filesystem::path cpl () const;
-       boost::filesystem::path directory () const;
 
 private:
        void setup_sensitivity ();
 
        KDMCPLPanel* _cpl;
-#ifdef DCPOMATIC_USE_OWN_PICKER
-       DirPickerCtrl* _folder;
-#else
-       wxDirPickerCtrl* _folder;
-#endif
 };