{
Config* config = Config::instance ();
- checked_set (_set_language, config->language ());
+ checked_set (_set_language, static_cast<bool>(config->language()));
if (config->language().get_value_or ("") == "fr") {
checked_set (_language, 3);
}
add_label_to_sizer (table, _panel, _("Default directory for new films"), true);
-#ifdef DCPOMATIC_USE_OWN_DIR_PICKER
+#ifdef DCPOMATIC_USE_OWN_PICKER
_directory = new DirPickerCtrl (_panel);
#else
_directory = new wxDirPickerCtrl (_panel, wxDD_DIR_MUST_EXIST);
table->Add (s, 1);
}
+ add_label_to_sizer (table, _panel, _("Default standard"), true);
+ _standard = new wxChoice (_panel, wxID_ANY);
+ table->Add (_standard);
+
_still_length->SetRange (1, 3600);
_still_length->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DefaultsPage::still_length_changed, this));
_audio_delay->SetRange (-1000, 1000);
_audio_delay->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DefaultsPage::audio_delay_changed, this));
+
+ _standard->Append (_("SMPTE"));
+ _standard->Append (_("Interop"));
+ _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::standard_changed, this));
}
void config_changed ()
checked_set (_j2k_bandwidth, config->default_j2k_bandwidth() / 1000000);
_j2k_bandwidth->SetRange (50, config->maximum_j2k_bandwidth() / 1000000);
checked_set (_audio_delay, config->default_audio_delay ());
+ checked_set (_standard, config->default_interop() ? 1 : 0);
}
void j2k_bandwidth_changed ()
Config::instance()->set_default_dcp_content_type (ct[_dcp_content_type->GetSelection()]);
}
+ void standard_changed ()
+ {
+ Config::instance()->set_default_interop (_standard->GetSelection() == 1);
+ }
+
wxSpinCtrl* _j2k_bandwidth;
wxSpinCtrl* _audio_delay;
wxButton* _isdcf_metadata_button;
wxSpinCtrl* _still_length;
-#ifdef DCPOMATIC_USE_OWN_DIR_PICKER
+#ifdef DCPOMATIC_USE_OWN_PICKER
DirPickerCtrl* _directory;
#else
wxDirPickerCtrl* _directory;
#endif
wxChoice* _container;
wxChoice* _dcp_content_type;
+ wxChoice* _standard;
};
class EncodingServersPage : public StandardPage
s->Add (_add_certificate, 0, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
_remove_certificate = new wxButton (this, wxID_ANY, _("Remove"));
s->Add (_remove_certificate, 0, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _export_certificate = new wxButton (this, wxID_ANY, _("Export"));
+ s->Add (_export_certificate, 0, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
certificates_sizer->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
}
_add_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&CertificateChainEditor::add_certificate, this));
_remove_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&CertificateChainEditor::remove_certificate, this));
+ _export_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&CertificateChainEditor::export_certificate, this));
_certificates->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&CertificateChainEditor::update_sensitivity, this));
_certificates->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&CertificateChainEditor::update_sensitivity, this));
_remake_certificates->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&CertificateChainEditor::remake_certificates, this));
update_sensitivity ();
}
+ void export_certificate ()
+ {
+ int i = _certificates->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ if (i == -1) {
+ return;
+ }
+
+ wxFileDialog* d = new wxFileDialog (
+ this, _("Select Certificate File"), wxEmptyString, wxEmptyString, wxT ("PEM files (*.pem)|*.pem"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT
+ );
+
+ dcp::CertificateChain::List all = _chain->root_to_leaf ();
+ dcp::CertificateChain::List::iterator j = all.begin ();
+ for (int k = 0; k < i; ++k) {
+ ++j;
+ }
+
+ if (d->ShowModal () == wxID_OK) {
+ FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "w");
+ if (!f) {
+ throw OpenFileError (wx_to_std (d->GetPath ()));
+ }
+
+ string const s = j->certificate (true);
+ fwrite (s.c_str(), 1, s.length(), f);
+ fclose (f);
+ }
+ d->Destroy ();
+ }
+
void update_certificate_list ()
{
_certificates->DeleteAllItems ();
{
shared_ptr<const dcp::CertificateChain> chain = _get ();
+ string subject_organization_name;
+ string subject_organizational_unit_name;
+ string root_common_name;
string intermediate_common_name;
- if (chain->root_to_leaf().size() >= 3) {
- dcp::CertificateChain::List all = chain->root_to_leaf ();
+ string leaf_common_name;
+
+ dcp::CertificateChain::List all = chain->root_to_leaf ();
+
+ if (all.size() >= 1) {
+ /* Have a root */
+ subject_organization_name = chain->root().subject_organization_name ();
+ subject_organizational_unit_name = chain->root().subject_organizational_unit_name ();
+ root_common_name = chain->root().subject_common_name ();
+ }
+
+ if (all.size() >= 2) {
+ /* Have a leaf */
+ leaf_common_name = chain->leaf().subject_common_name ();
+ }
+
+ if (all.size() >= 3) {
+ /* Have an intermediate */
dcp::CertificateChain::List::iterator i = all.begin ();
++i;
intermediate_common_name = i->subject_common_name ();
MakeChainDialog* d = new MakeChainDialog (
this,
- chain->root().subject_organization_name (),
- chain->root().subject_organizational_unit_name (),
- chain->root().subject_common_name (),
+ subject_organization_name,
+ subject_organizational_unit_name,
+ root_common_name,
intermediate_common_name,
- chain->leaf().subject_common_name ()
+ leaf_common_name
);
if (d->ShowModal () == wxID_OK) {
void update_sensitivity ()
{
_remove_certificate->Enable (_certificates->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED) != -1);
+ _export_certificate->Enable (_certificates->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED) != -1);
}
void update_private_key ()
wxListCtrl* _certificates;
wxButton* _add_certificate;
+ wxButton* _export_certificate;
wxButton* _remove_certificate;
wxButton* _remake_certificates;
wxStaticText* _private_key;
, _log_timing (0)
, _log_debug_decode (0)
, _log_debug_encode (0)
+ , _log_debug_email (0)
{}
private:
t->Add (_log_debug_decode, 1, wxEXPAND | wxALL);
_log_debug_encode = new wxCheckBox (_panel, wxID_ANY, _("Debug: encode"));
t->Add (_log_debug_encode, 1, wxEXPAND | wxALL);
+ _log_debug_email = new wxCheckBox (_panel, wxID_ANY, _("Debug: email sending"));
+ t->Add (_log_debug_email, 1, wxEXPAND | wxALL);
table->Add (t, 0, wxALL, 6);
}
_log_timing->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this));
_log_debug_decode->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this));
_log_debug_encode->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this));
+ _log_debug_email->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::log_changed, this));
#ifdef DCPOMATIC_WINDOWS
_win32_console->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AdvancedPage::win32_console_changed, this));
#endif
checked_set (_maximum_j2k_bandwidth, config->maximum_j2k_bandwidth() / 1000000);
checked_set (_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate ());
checked_set (_only_servers_encode, config->only_servers_encode ());
- checked_set (_log_general, config->log_types() & Log::TYPE_GENERAL);
- checked_set (_log_warning, config->log_types() & Log::TYPE_WARNING);
- checked_set (_log_error, config->log_types() & Log::TYPE_ERROR);
- checked_set (_log_timing, config->log_types() & Log::TYPE_TIMING);
- checked_set (_log_debug_decode, config->log_types() & Log::TYPE_DEBUG_DECODE);
- checked_set (_log_debug_encode, config->log_types() & Log::TYPE_DEBUG_ENCODE);
+ checked_set (_log_general, config->log_types() & LogEntry::TYPE_GENERAL);
+ checked_set (_log_warning, config->log_types() & LogEntry::TYPE_WARNING);
+ checked_set (_log_error, config->log_types() & LogEntry::TYPE_ERROR);
+ checked_set (_log_timing, config->log_types() & LogEntry::TYPE_TIMING);
+ checked_set (_log_debug_decode, config->log_types() & LogEntry::TYPE_DEBUG_DECODE);
+ checked_set (_log_debug_encode, config->log_types() & LogEntry::TYPE_DEBUG_ENCODE);
+ checked_set (_log_debug_email, config->log_types() & LogEntry::TYPE_DEBUG_EMAIL);
#ifdef DCPOMATIC_WINDOWS
checked_set (_win32_console, config->win32_console());
#endif
{
int types = 0;
if (_log_general->GetValue ()) {
- types |= Log::TYPE_GENERAL;
+ types |= LogEntry::TYPE_GENERAL;
}
if (_log_warning->GetValue ()) {
- types |= Log::TYPE_WARNING;
+ types |= LogEntry::TYPE_WARNING;
}
if (_log_error->GetValue ()) {
- types |= Log::TYPE_ERROR;
+ types |= LogEntry::TYPE_ERROR;
}
if (_log_timing->GetValue ()) {
- types |= Log::TYPE_TIMING;
+ types |= LogEntry::TYPE_TIMING;
}
if (_log_debug_decode->GetValue ()) {
- types |= Log::TYPE_DEBUG_DECODE;
+ types |= LogEntry::TYPE_DEBUG_DECODE;
}
if (_log_debug_encode->GetValue ()) {
- types |= Log::TYPE_DEBUG_ENCODE;
+ types |= LogEntry::TYPE_DEBUG_ENCODE;
+ }
+ if (_log_debug_email->GetValue ()) {
+ types |= LogEntry::TYPE_DEBUG_EMAIL;
}
Config::instance()->set_log_types (types);
}
wxCheckBox* _log_timing;
wxCheckBox* _log_debug_decode;
wxCheckBox* _log_debug_encode;
+ wxCheckBox* _log_debug_email;
#ifdef DCPOMATIC_WINDOWS
wxCheckBox* _win32_console;
#endif