More enum class additions.
[dcpomatic.git] / src / wx / full_config_dialog.cc
index 2d4ac3fdf9f98c233772be37f20ebbf73e45015e..43c76fddb61d9696d63f33b4148999f9a6229c4a 100644 (file)
@@ -57,7 +57,6 @@
 #include <wx/filepicker.h>
 #include <RtAudio.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::vector;
@@ -68,7 +67,7 @@ using std::pair;
 using std::make_pair;
 using std::map;
 using boost::bind;
-using boost::shared_ptr;
+using std::shared_ptr;
 using boost::function;
 using boost::optional;
 #if BOOST_VERSION >= 106100
@@ -92,11 +91,6 @@ private:
                int r = 0;
                add_language_controls (table, r);
 
-               add_label_to_sizer (table, _panel, _("Interface complexity"), true, wxGBPosition(r, 0));
-               _interface_complexity = new wxChoice (_panel, wxID_ANY);
-               table->Add (_interface_complexity, wxGBPosition (r, 1));
-               ++r;
-
                add_label_to_sizer (table, _panel, _("Number of threads DCP-o-matic should use"), true, wxGBPosition (r, 0));
                _master_encoding_threads = new wxSpinCtrl (_panel);
                table->Add (_master_encoding_threads, wxGBPosition (r, 1));
@@ -134,10 +128,6 @@ private:
                _config_file->Bind  (wxEVT_FILEPICKER_CHANGED, boost::bind (&FullGeneralPage::config_file_changed,   this));
                _cinemas_file->Bind (wxEVT_FILEPICKER_CHANGED, boost::bind (&FullGeneralPage::cinemas_file_changed,  this));
 
-               _interface_complexity->Append (_("Simple"));
-               _interface_complexity->Append (_("Full"));
-               _interface_complexity->Bind (wxEVT_CHOICE, boost::bind(&FullGeneralPage::interface_complexity_changed, this));
-
                _master_encoding_threads->SetRange (1, 128);
                _master_encoding_threads->Bind (wxEVT_SPINCTRL, boost::bind (&FullGeneralPage::master_encoding_threads_changed, this));
                _server_encoding_threads->SetRange (1, 128);
@@ -154,14 +144,6 @@ private:
        {
                Config* config = Config::instance ();
 
-               switch (config->interface_complexity()) {
-               case Config::INTERFACE_SIMPLE:
-                       checked_set (_interface_complexity, 0);
-                       break;
-               case Config::INTERFACE_FULL:
-                       checked_set (_interface_complexity, 1);
-                       break;
-               }
                checked_set (_master_encoding_threads, config->master_encoding_threads ());
                checked_set (_server_encoding_threads, config->server_encoding_threads ());
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
@@ -187,16 +169,6 @@ private:
                d->Destroy ();
        }
 
-       void interface_complexity_changed ()
-       {
-               if (_interface_complexity->GetSelection() == 0) {
-                       Config::instance()->set_interface_complexity (Config::INTERFACE_SIMPLE);
-               } else {
-                       Config::instance()->set_interface_complexity (Config::INTERFACE_FULL);
-               }
-       }
-
-
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
        void analyse_ebur128_changed ()
        {
@@ -250,7 +222,6 @@ private:
                Config::instance()->set_cinemas_file (wx_to_std (_cinemas_file->GetPath ()));
        }
 
-       wxChoice* _interface_complexity;
        wxSpinCtrl* _master_encoding_threads;
        wxSpinCtrl* _server_encoding_threads;
        FilePickerCtrl* _config_file;
@@ -359,13 +330,13 @@ private:
 
                _isdcf_metadata_button->Bind (wxEVT_BUTTON, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this));
 
-               BOOST_FOREACH (Ratio const * i, Ratio::containers()) {
+               for (auto i: Ratio::containers()) {
                        _container->Append (std_to_wx(i->container_nickname()));
                }
 
                _container->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::container_changed, this));
 
-               BOOST_FOREACH (DCPContentType const * i, DCPContentType::all()) {
+               for (auto i: DCPContentType::all()) {
                        _dcp_content_type->Append (std_to_wx (i->pretty_name ()));
                }
 
@@ -615,7 +586,7 @@ private:
                Config* config = Config::instance ();
 
                checked_set (_upload, config->upload_after_make_dcp());
-               checked_set (_tms_protocol, config->tms_protocol ());
+               checked_set (_tms_protocol, static_cast<int>(config->tms_protocol()));
                checked_set (_tms_ip, config->tms_ip ());
                checked_set (_tms_path, config->tms_path ());
                checked_set (_tms_user, config->tms_user ());
@@ -729,21 +700,21 @@ private:
 
        void config_changed ()
        {
-               Config* config = Config::instance ();
+               auto config = Config::instance ();
 
                checked_set (_server, config->mail_server ());
                checked_set (_port, config->mail_port ());
                switch (config->mail_protocol()) {
-               case EMAIL_PROTOCOL_AUTO:
+               case EmailProtocol::AUTO:
                        checked_set (_protocol, 0);
                        break;
-               case EMAIL_PROTOCOL_PLAIN:
+               case EmailProtocol::PLAIN:
                        checked_set (_protocol, 1);
                        break;
-               case EMAIL_PROTOCOL_STARTTLS:
+               case EmailProtocol::STARTTLS:
                        checked_set (_protocol, 2);
                        break;
-               case EMAIL_PROTOCOL_SSL:
+               case EmailProtocol::SSL:
                        checked_set (_protocol, 3);
                        break;
                }
@@ -765,16 +736,16 @@ private:
        {
                switch (_protocol->GetSelection()) {
                case 0:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_AUTO);
+                       Config::instance()->set_mail_protocol(EmailProtocol::AUTO);
                        break;
                case 1:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_PLAIN);
+                       Config::instance()->set_mail_protocol(EmailProtocol::PLAIN);
                        break;
                case 2:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_STARTTLS);
+                       Config::instance()->set_mail_protocol(EmailProtocol::STARTTLS);
                        break;
                case 3:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_SSL);
+                       Config::instance()->set_mail_protocol(EmailProtocol::SSL);
                        break;
                }
        }
@@ -1481,7 +1452,7 @@ private:
                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_threed, config->log_types() & LogEntry::TYPE_DEBUG_THREED);
+               checked_set (_log_debug_threed, config->log_types() & LogEntry::TYPE_DEBUG_THREE_D);
                checked_set (_log_debug_encode, config->log_types() & LogEntry::TYPE_DEBUG_ENCODE);
                checked_set (_log_debug_email, config->log_types() & LogEntry::TYPE_DEBUG_EMAIL);
                checked_set (_log_debug_video_view, config->log_types() & LogEntry::TYPE_DEBUG_VIDEO_VIEW);
@@ -1558,7 +1529,7 @@ private:
                        types |= LogEntry::TYPE_TIMING;
                }
                if (_log_debug_threed->GetValue ()) {
-                       types |= LogEntry::TYPE_DEBUG_THREED;
+                       types |= LogEntry::TYPE_DEBUG_THREE_D;
                }
                if (_log_debug_encode->GetValue ()) {
                        types |= LogEntry::TYPE_DEBUG_ENCODE;