X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Fself_dkdm_dialog.cc;h=5eae05de40f7cfdbadd59e2179f1f31c83df0b09;hb=a8e31120a793f09ab56cc2847d76944ba698ba95;hp=001b8d328c06e1b3156787c3d106f5ce009af851;hpb=a9f81397b720819af7cb4aee4307e5888752a9ef;p=dcpomatic.git diff --git a/src/wx/self_dkdm_dialog.cc b/src/wx/self_dkdm_dialog.cc index 001b8d328..5eae05de4 100644 --- a/src/wx/self_dkdm_dialog.cc +++ b/src/wx/self_dkdm_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -22,8 +22,10 @@ #include "wx_util.h" #include "kdm_output_panel.h" #include "kdm_cpl_panel.h" +#include "static_text.h" #include "lib/film.h" #include "lib/screen.h" +#include "lib/config.h" #include #ifdef DCPOMATIC_USE_OWN_PICKER #include "dir_picker_ctrl.h" @@ -56,14 +58,14 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr subheading_font.SetWeight (wxFONTWEIGHT_BOLD); /* Sub-heading: CPL */ - wxStaticText* h = new wxStaticText (this, wxID_ANY, _("CPL")); + wxStaticText* h = new StaticText (this, _("CPL")); h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2); _cpl = new KDMCPLPanel (this, film->cpls ()); vertical->Add (_cpl); /* Sub-heading: output */ - h = new wxStaticText (this, wxID_ANY, _("Output")); + h = new StaticText (this, _("Output")); h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); @@ -97,14 +99,34 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr overall_sizer->Add (buttons, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP); } - setup_sensitivity (); - SetSizer (overall_sizer); overall_sizer->Layout (); overall_sizer->SetSizeHints (this); - _internal->Bind (wxEVT_COMMAND_RADIOBUTTON_SELECTED, bind (&SelfDKDMDialog::setup_sensitivity, this)); - _write_to->Bind (wxEVT_COMMAND_RADIOBUTTON_SELECTED, bind (&SelfDKDMDialog::setup_sensitivity, this)); + switch (Config::instance()->last_dkdm_write_type().get_value_or(Config::DKDM_WRITE_INTERNAL)) { + case Config::DKDM_WRITE_INTERNAL: + _internal->SetValue (true); + break; + case Config::DKDM_WRITE_FILE: + _write_to->SetValue (true); + break; + } + setup_sensitivity (); + + _internal->Bind (wxEVT_RADIOBUTTON, bind (&SelfDKDMDialog::dkdm_write_type_changed, this)); + _write_to->Bind (wxEVT_RADIOBUTTON, bind (&SelfDKDMDialog::dkdm_write_type_changed, this)); +} + +void +SelfDKDMDialog::dkdm_write_type_changed () +{ + setup_sensitivity (); + + if (_internal->GetValue ()) { + Config::instance()->set_last_dkdm_write_type (Config::DKDM_WRITE_INTERNAL); + } else if (_write_to->GetValue ()) { + Config::instance()->set_last_dkdm_write_type (Config::DKDM_WRITE_FILE); + } } void