/* Find the DCP to make the KDM for */
string const dir = this->directory ();
- list<string> dcps;
+ list<boost::filesystem::path> dcps;
for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator(dir); i != boost::filesystem::directory_iterator(); ++i) {
- if (boost::filesystem::is_directory (*i) && i->path().leaf() != "j2c" && i->path().leaf() != "wavs") {
- dcps.push_back (i->path().string());
+ if (boost::filesystem::is_directory (*i) && i->path().leaf() != "j2c" && i->path().leaf() != "video" && i->path().leaf() != "info") {
+ dcps.push_back (i->path());
}
}
if (dcps.empty()) {
- throw KDMError ("Could not find DCP to make KDM for");
+ throw KDMError (_("Could not find DCP to make KDM for"));
} else if (dcps.size() > 1) {
- throw KDMError ("More than one possible DCP to make KDM for");
+ throw KDMError (_("More than one possible DCP to make KDM for"));
}
for (list<shared_ptr<Screen> >::iterator i = screens.begin(); i != screens.end(); ++i) {
libdcp::DCP dcp (dcps.front ());
- dcp.read ();
+
+ try {
+ dcp.read ();
+ } catch (...) {
+ throw KDMError (_("Could not read DCP to make KDM for"));
+ }
shared_ptr<xmlpp::Document> kdm = dcp.cpls().front()->make_kdm (
- signer, (*i)->certificate, from, until, _interop, libdcp::MXFMetadata (), Config::instance()->dcp_metadata ()
+ signer, (*i)->certificate, key (), from, until, _interop, libdcp::MXFMetadata (), Config::instance()->dcp_metadata ()
);
boost::filesystem::path out = directory;
#include "cinema_dialog.h"
#include "screen_dialog.h"
#include "wx_util.h"
-#ifdef __WXMSW__
+#ifdef DCPOMATIC_USE_OWN_DIR_PICKER
#include "dir_picker_ctrl.h"
#else
#include <wx/filepicker.h>
add_label_to_sizer (table, this, "Write to", true);
-#ifdef __WXMSW__
- _folder = new DirPickerCtrl (this);
+#ifdef DCPOMATIC_USE_OWN_DIR_PICKER
+ _folder = new DirPickerCtrl (this);
#else
- _folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST);
+ _folder = new wxDirPickerCtrl (this, wxID_ANY);
#endif
table->Add (_folder, 1, wxEXPAND);
_add_screen->Enable (sc);
_edit_screen->Enable (ss);
_remove_screen->Enable (ss);
+
+ wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK));
+ ok->Enable (sc || sc);
}
void
wxDatePickerCtrl* _until_date;
wxTimePickerCtrl* _from_time;
wxTimePickerCtrl* _until_time;
-#ifdef __WXMSW__
+#ifdef DCPOMATIC_USE_OWN_DIR_PICKER
DirPickerCtrl* _folder;
#else
wxDirPickerCtrl* _folder;