#include "screens_panel.h"
#include "static_text.h"
#include "wx_util.h"
+#include "wx_variant.h"
#include "lib/cinema.h"
#include "lib/config.h"
#include "lib/film.h"
#include "lib/kdm_util.h"
#include "lib/screen.h"
#include <libcxml/cxml.h>
+#include <dcp/cpl.h>
#include <dcp/exceptions.h>
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
/* Bind */
- _screens->ScreensChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
+ _screens->ScreensChanged.connect(boost::bind(&KDMDialog::screens_changed, this));
_timing->TimingChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
_make->Bind (wxEVT_BUTTON, boost::bind (&KDMDialog::make_clicked, this));
+ _cpl->Changed.connect(boost::bind(&KDMDialog::cpl_changed, this));
+ cpl_changed();
setup_sensitivity ();
SetSizer (overall_sizer);
}
+void
+KDMDialog::screens_changed()
+{
+ _timing->suggest_utc_offset(_screens->best_utc_offset());
+ setup_sensitivity();
+}
+
+
+void
+KDMDialog::cpl_changed()
+{
+ try {
+ dcp::CPL cpl(_cpl->cpl());
+ if (auto text = cpl.annotation_text()) {
+ _output->set_annotation_text(*text);
+ }
+ } catch (...) {}
+
+ setup_sensitivity();
+}
+
+
void
KDMDialog::setup_sensitivity ()
{
if (e.starts_too_early()) {
error_dialog (this, _("The KDM start period is before (or close to) the start of the signing certificate's validity period. Use a later start time for this KDM."));
} else {
- error_dialog (this, _("The KDM end period is after (or close to) the end of the signing certificates' validity period. Either use an earlier end time for this KDM or re-create your signing certificates in the DCP-o-matic preferences window."));
+ error_dialog(
+ this,
+ variant::wx::insert_dcpomatic(
+ _("The KDM end period is after (or close to) the end of the signing certificates' validity "
+ "period. Either use an earlier end time for this KDM or re-create your signing certificates "
+ "in the %s preferences window."))
+ );
}
return;
} catch (runtime_error& e) {
return;
}
- auto result = _output->make (kdms, film->name(), bind (&KDMDialog::confirm_overwrite, this, _1));
+ auto result = _output->make(kdms, film->dcp_name(), bind (&KDMDialog::confirm_overwrite, this, _1));
if (result.first) {
JobManager::instance()->add (result.first);
}