X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Fplayer_config_dialog.cc;h=a7bb35bda427beca8e2e4b2f68f57d1ab46c119d;hp=3158b279cf4c600d0827dee923e80f4f45966976;hb=529d00f4ced6b9f5b7e351332036de414535384e;hpb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26 diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc index 3158b279c..a7bb35bda 100644 --- a/src/wx/player_config_dialog.cc +++ b/src/wx/player_config_dialog.cc @@ -18,61 +18,63 @@ */ + /** @file src/player_config_dialog.cc * @brief A dialogue to edit DCP-o-matic Player configuration. */ + +#include "check_box.h" #include "config_dialog.h" -#include "wx_util.h" +#include "dir_picker_ctrl.h" #include "editable_list.h" -#include "filter_dialog.h" +#include "email_dialog.h" #include "file_picker_ctrl.h" -#include "dir_picker_ctrl.h" -#include "isdcf_metadata_dialog.h" -#include "server_dialog.h" +#include "filter_dialog.h" #include "make_chain_dialog.h" -#include "email_dialog.h" -#include "name_format_editor.h" #include "nag_dialog.h" -#include "monitor_dialog.h" -#include "check_box.h" +#include "name_format_editor.h" +#include "server_dialog.h" #include "static_text.h" +#include "wx_util.h" #include "lib/config.h" -#include "lib/ratio.h" -#include "lib/filter.h" +#include "lib/cross.h" #include "lib/dcp_content_type.h" +#include "lib/exceptions.h" +#include "lib/filter.h" #include "lib/log.h" +#include "lib/ratio.h" #include "lib/util.h" -#include "lib/cross.h" -#include "lib/exceptions.h" -#include -#include #include -#include +#include +#include +#include +LIBDCP_DISABLE_WARNINGS +#include #include #include -#include +#include +LIBDCP_ENABLE_WARNINGS #include #include -#include -#include -using std::vector; -using std::string; + +using std::function; using std::list; -using std::cout; -using std::pair; using std::make_pair; using std::map; -using boost::bind; +using std::pair; using std::shared_ptr; -using boost::function; +using std::string; +using std::vector; +using boost::bind; using boost::optional; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif using dcp::locale_convert; + class PlayerGeneralPage : public GeneralPage { public: @@ -81,7 +83,7 @@ public: {} private: - void setup () + void setup () override { wxGridBagSizer* table = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); _panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border); @@ -123,25 +125,19 @@ private: table->Add (_respect_kdm, wxGBPosition(r, 0), wxGBSpan(1, 2)); ++r; - add_label_to_sizer (table, _panel, _("Activity log file"), true, wxGBPosition (r, 0)); - _activity_log_file = new FilePickerCtrl (_panel, _("Select activity log file"), "*", true, true); - table->Add (_activity_log_file, wxGBPosition(r, 1)); - ++r; - add_label_to_sizer (table, _panel, _("Debug log file"), true, wxGBPosition (r, 0)); - _debug_log_file = new FilePickerCtrl (_panel, _("Select debug log file"), "*", true, true); + _debug_log_file = new FilePickerCtrl (_panel, _("Select debug log file"), "*", false, true); table->Add (_debug_log_file, wxGBPosition(r, 1)); ++r; _player_mode->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::player_mode_changed, this)); _image_display->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::image_display_changed, this)); _video_display_mode->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::video_display_mode_changed, this)); - _respect_kdm->Bind (wxEVT_CHECKBOX, bind(&PlayerGeneralPage::respect_kdm_changed, this)); - _activity_log_file->Bind (wxEVT_FILEPICKER_CHANGED, bind(&PlayerGeneralPage::activity_log_file_changed, this)); + _respect_kdm->bind(&PlayerGeneralPage::respect_kdm_changed, this); _debug_log_file->Bind (wxEVT_FILEPICKER_CHANGED, bind(&PlayerGeneralPage::debug_log_file_changed, this)); } - void config_changed () + void config_changed () override { GeneralPage::config_changed (); @@ -170,9 +166,6 @@ private: checked_set (_image_display, config->image_display()); checked_set (_respect_kdm, config->respect_kdm_validity_periods()); - if (config->player_activity_log_file()) { - checked_set (_activity_log_file, *config->player_activity_log_file()); - } if (config->player_debug_log_file()) { checked_set (_debug_log_file, *config->player_debug_log_file()); } @@ -213,11 +206,6 @@ private: Config::instance()->set_respect_kdm_validity_periods(_respect_kdm->GetValue()); } - void activity_log_file_changed () - { - Config::instance()->set_player_activity_log_file(wx_to_std(_activity_log_file->GetPath())); - } - void debug_log_file_changed () { Config::instance()->set_player_debug_log_file(wx_to_std(_debug_log_file->GetPath())); @@ -226,8 +214,7 @@ private: wxChoice* _player_mode; wxChoice* _image_display; wxChoice* _video_display_mode; - wxCheckBox* _respect_kdm; - FilePickerCtrl* _activity_log_file; + CheckBox* _respect_kdm; FilePickerCtrl* _debug_log_file; }; @@ -246,15 +233,15 @@ public: , _log_timing (0) {} - wxString GetName () const + wxString GetName () const override { return _("Advanced"); } #ifdef DCPOMATIC_OSX - wxBitmap GetLargeIcon () const + wxBitmap GetLargeIcon () const override { - return wxBitmap ("advanced", wxBITMAP_TYPE_PNG_RESOURCE); + return wxBitmap(icon_path("advanced"), wxBITMAP_TYPE_PNG); } #endif @@ -270,9 +257,9 @@ private: table->Add (m, 0, flags, DCPOMATIC_SIZER_Y_GAP); } - void setup () + void setup () override { - wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); + auto table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); table->AddGrowableCol (1, 1); _panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border); @@ -297,18 +284,18 @@ private: table->AddSpacer (0); #endif - _log_general->Bind (wxEVT_CHECKBOX, boost::bind (&PlayerAdvancedPage::log_changed, this)); - _log_warning->Bind (wxEVT_CHECKBOX, boost::bind (&PlayerAdvancedPage::log_changed, this)); - _log_error->Bind (wxEVT_CHECKBOX, boost::bind (&PlayerAdvancedPage::log_changed, this)); - _log_timing->Bind (wxEVT_CHECKBOX, boost::bind (&PlayerAdvancedPage::log_changed, this)); + _log_general->bind(&PlayerAdvancedPage::log_changed, this); + _log_warning->bind(&PlayerAdvancedPage::log_changed, this); + _log_error->bind(&PlayerAdvancedPage::log_changed, this); + _log_timing->bind(&PlayerAdvancedPage::log_changed, this); #ifdef DCPOMATIC_WINDOWS - _win32_console->Bind (wxEVT_CHECKBOX, boost::bind (&PlayerAdvancedPage::win32_console_changed, this)); + _win32_console->bind(&PlayerAdvancedPage::win32_console_changed, this); #endif } - void config_changed () + void config_changed () override { - Config* config = Config::instance (); + auto config = Config::instance (); checked_set (_log_general, config->log_types() & LogEntry::TYPE_GENERAL); checked_set (_log_warning, config->log_types() & LogEntry::TYPE_WARNING); @@ -344,12 +331,12 @@ private: } #endif - wxCheckBox* _log_general; - wxCheckBox* _log_warning; - wxCheckBox* _log_error; - wxCheckBox* _log_timing; + CheckBox* _log_general; + CheckBox* _log_warning; + CheckBox* _log_error; + CheckBox* _log_timing; #ifdef DCPOMATIC_WINDOWS - wxCheckBox* _win32_console; + CheckBox* _win32_console; #endif }; @@ -357,17 +344,17 @@ private: wxPreferencesEditor* create_player_config_dialog () { - wxPreferencesEditor* e = new wxPreferencesEditor (_("DCP-o-matic Player Preferences")); + auto e = new wxPreferencesEditor (_("DCP-o-matic Player Preferences")); #ifdef DCPOMATIC_OSX /* Width that we force some of the config panels to be on OSX so that the containing window doesn't shrink too much when we select those panels. This is obviously an unpleasant hack. */ - wxSize ps = wxSize (520, -1); + auto ps = wxSize (520, -1); int const border = 16; #else - wxSize ps = wxSize (-1, -1); + auto ps = wxSize (-1, -1); int const border = 8; #endif