using boost::shared_ptr;
using boost::lexical_cast;
using boost::function;
+using boost::optional;
class Page
{
_language->Append (wxT ("Svenska"));
_language->Append (wxT ("Русский"));
_language->Append (wxT ("Polski"));
- _language->Append (wxT ("Danske"));
+ _language->Append (wxT ("Dansk"));
+ _language->Append (wxT ("Português europeu"));
+ _language->Append (wxT ("Slovenský jazyk"));
table->Add (_language, wxGBPosition (r, 1));
++r;
- wxStaticText* restart = add_label_to_grid_bag_sizer (
+ wxStaticText* restart = add_label_to_sizer (
table, _panel, _("(restart DCP-o-matic to see language changes)"), false, wxGBPosition (r, 0), wxGBSpan (1, 2)
);
wxFont font = restart->GetFont();
restart->SetFont (font);
++r;
- add_label_to_grid_bag_sizer (table, _panel, _("Threads to use for encoding on this host"), true, wxGBPosition (r, 0));
+ add_label_to_sizer (table, _panel, _("Threads to use for encoding on this host"), true, wxGBPosition (r, 0));
_num_local_encoding_threads = new wxSpinCtrl (_panel);
table->Add (_num_local_encoding_threads, wxGBPosition (r, 1));
++r;
table->Add (_check_for_updates, wxGBPosition (r, 0), wxGBSpan (1, 2));
++r;
- _check_for_test_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for testing updates as well as stable ones"));
+ _check_for_test_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for testing updates on startup"));
table->Add (_check_for_test_updates, wxGBPosition (r, 0), wxGBSpan (1, 2));
++r;
checked_set (_language, 8);
} else if (config->language().get_value_or ("") == "da") {
checked_set (_language, 9);
+ } else if (config->language().get_value_or ("") == "pt") {
+ checked_set (_language, 10);
+ } else if (config->language().get_value_or ("") == "sk") {
+ checked_set (_language, 11);
} else {
_language->SetSelection (1);
}
- setup_language_sensitivity ();
-
checked_set (_num_local_encoding_threads, config->num_local_encoding_threads ());
checked_set (_automatic_audio_analysis, config->automatic_audio_analysis ());
checked_set (_check_for_updates, config->check_for_updates ());
checked_set (_check_for_test_updates, config->check_for_test_updates ());
checked_set (_issuer, config->dcp_issuer ());
checked_set (_creator, config->dcp_creator ());
+
+ setup_sensitivity ();
}
- void setup_language_sensitivity ()
+ void setup_sensitivity ()
{
_language->Enable (_set_language->GetValue ());
+ _check_for_test_updates->Enable (_check_for_updates->GetValue ());
}
void set_language_changed ()
{
- setup_language_sensitivity ();
+ setup_sensitivity ();
if (_set_language->GetValue ()) {
language_changed ();
} else {
case 9:
Config::instance()->set_language ("da");
break;
+ case 10:
+ Config::instance()->set_language ("pt");
+ break;
+ case 11:
+ Config::instance()->set_language ("sk");
+ break;
}
}
}
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);
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;
private:
void setup ()
{
- _use_any_servers = new wxCheckBox (_panel, wxID_ANY, _("Use all servers"));
+ _use_any_servers = new wxCheckBox (_panel, wxID_ANY, _("Search network for servers"));
_panel->GetSizer()->Add (_use_any_servers, 0, wxALL, _border);
vector<string> columns;
wxBoxSizer* certificates_sizer = new wxBoxSizer (wxHORIZONTAL);
_sizer->Add (certificates_sizer, 0, wxLEFT | wxRIGHT, border);
- _certificates = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize (400, 150), wxLC_REPORT | wxLC_SINGLE_SEL);
+ _certificates = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize (440, 150), wxLC_REPORT | wxLC_SINGLE_SEL);
{
wxListItem ip;
wxListItem ip;
ip.SetId (1);
ip.SetText (_("Thumbprint"));
- ip.SetWidth (300);
+ ip.SetWidth (340);
wxFont font = ip.GetFont ();
font.SetFamily (wxFONTFAMILY_TELETYPE);
_sizer->Add (table, 1, wxALL | wxEXPAND, border);
int r = 0;
- add_label_to_grid_bag_sizer (table, this, _("Leaf private key"), true, wxGBPosition (r, 0));
+ add_label_to_sizer (table, this, _("Leaf private key"), true, wxGBPosition (r, 0));
_private_key = new wxStaticText (this, wxID_ANY, wxT (""));
wxFont font = _private_key->GetFont ();
font.SetFamily (wxFONTFAMILY_TELETYPE);
table->Add (_private_key, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
_load_private_key = new wxButton (this, wxID_ANY, _("Load..."));
table->Add (_load_private_key, wxGBPosition (r, 2));
+ _export_private_key = new wxButton (this, wxID_ANY, _("Export..."));
+ table->Add (_export_private_key, wxGBPosition (r, 3));
++r;
_button_sizer = new wxBoxSizer (wxHORIZONTAL);
_remake_certificates = new wxButton (this, wxID_ANY, _("Re-make certificates and key..."));
_button_sizer->Add (_remake_certificates, 1, wxRIGHT, border);
- table->Add (_button_sizer, wxGBPosition (r, 0), wxGBSpan (1, 3));
+ table->Add (_button_sizer, wxGBPosition (r, 0), wxGBSpan (1, 4));
++r;
_add_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&CertificateChainEditor::add_certificate, 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));
_load_private_key->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&CertificateChainEditor::load_private_key, this));
+ _export_private_key->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&CertificateChainEditor::export_private_key, this));
SetSizerAndFit (_sizer);
}
update_sensitivity ();
}
+ void export_private_key ()
+ {
+ optional<string> key = _chain->key ();
+ if (!key) {
+ return;
+ }
+
+ wxFileDialog* d = new wxFileDialog (
+ this, _("Select Key File"), wxEmptyString, wxEmptyString, wxT ("PEM files (*.pem)|*.pem"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT
+ );
+
+ 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 = _chain->key().get ();
+ fwrite (s.c_str(), 1, s.length(), f);
+ fclose (f);
+ }
+ d->Destroy ();
+ }
+
wxListCtrl* _certificates;
wxButton* _add_certificate;
wxButton* _export_certificate;
wxButton* _remake_certificates;
wxStaticText* _private_key;
wxButton* _load_private_key;
+ wxButton* _export_private_key;
wxSizer* _sizer;
wxBoxSizer* _button_sizer;
shared_ptr<dcp::CertificateChain> _chain;
_kdm_email = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (480, 128), wxTE_MULTILINE);
_panel->GetSizer()->Add (_kdm_email, 1, wxEXPAND | wxALL, _border);
- _reset_kdm_email = new wxButton (_panel, wxID_ANY, _("Reset to default text"));
+ _reset_kdm_email = new wxButton (_panel, wxID_ANY, _("Reset to default subject and text"));
_panel->GetSizer()->Add (_reset_kdm_email, 0, wxEXPAND | wxALL, _border);
_mail_server->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::mail_server_changed, this));
, _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