Add debug option to log SMTP session transcripts.
[dcpomatic.git] / src / wx / config_dialog.cc
index 81fffbbbc457c3158019867f31b110f1bdf14b2b..f35c9adc9fc8288eea5944176de7c9ef01dd5dfb 100644 (file)
@@ -227,7 +227,7 @@ private:
        {
                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);
@@ -388,7 +388,7 @@ private:
                }
 
                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);
@@ -425,6 +425,10 @@ private:
                        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));
 
@@ -451,6 +455,10 @@ private:
 
                _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 ()
@@ -476,6 +484,7 @@ private:
                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 ()
@@ -518,17 +527,23 @@ private:
                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
@@ -794,9 +809,28 @@ private:
        {
                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 ();
@@ -804,11 +838,11 @@ private:
 
                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) {
@@ -1244,6 +1278,7 @@ public:
                , _log_timing (0)
                , _log_debug_decode (0)
                , _log_debug_encode (0)
+               , _log_debug_email (0)
        {}
 
 private:
@@ -1292,6 +1327,8 @@ 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);
                }
 
@@ -1311,6 +1348,7 @@ private:
                _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
@@ -1323,12 +1361,13 @@ private:
                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
@@ -1353,22 +1392,25 @@ private:
        {
                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);
        }
@@ -1389,6 +1431,7 @@ private:
        wxCheckBox* _log_timing;
        wxCheckBox* _log_debug_decode;
        wxCheckBox* _log_debug_encode;
+       wxCheckBox* _log_debug_email;
 #ifdef DCPOMATIC_WINDOWS
        wxCheckBox* _win32_console;
 #endif