X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fself_dkdm_dialog.cc;h=f53338517447192b9c53a9456c782f4855f44daf;hb=6b9bda07984837d188064f3f5514d0aa132655ec;hp=99f4142678888875626167b929e85e31908f4218;hpb=be00f12bdb5d74677ae55c7919fae9339e882090;p=dcpomatic.git diff --git a/src/wx/self_dkdm_dialog.cc b/src/wx/self_dkdm_dialog.cc index 99f414267..f53338517 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. @@ -24,6 +24,7 @@ #include "kdm_cpl_panel.h" #include "lib/film.h" #include "lib/screen.h" +#include "lib/config.h" #include #ifdef DCPOMATIC_USE_OWN_PICKER #include "dir_picker_ctrl.h" @@ -67,7 +68,7 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr h->SetFont (subheading_font); vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); - _internal = new wxRadioButton (this, wxID_ANY, _("Save to KDM creator tool's list")); + _internal = new wxRadioButton (this, wxID_ANY, _("Save to KDM Creator tool's list")); vertical->Add (_internal, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP); wxBoxSizer* w = new wxBoxSizer (wxHORIZONTAL); @@ -97,14 +98,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