diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-14 00:09:09 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-14 00:09:09 +0100 |
| commit | d9338a75602429347e36e5b393728c10cda731b3 (patch) | |
| tree | a844d223a7e336488d060ce0e026361390c051a2 /src/wx/kdm_output_panel.cc | |
| parent | e97d91c544d95c618fa4cb66db6f3a8ad73a7281 (diff) | |
Remember the state of the write to/email checkboxes in the KDM creator across runs (#2213).
Diffstat (limited to 'src/wx/kdm_output_panel.cc')
| -rw-r--r-- | src/wx/kdm_output_panel.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index 8a2757557..11f921aad 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -153,10 +153,11 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent) break; } - _write_to->SetValue (true); + _write_to->SetValue (Config::instance()->write_kdms_to_disk()); + _email->SetValue (Config::instance()->email_kdms()); - _write_to->Bind (wxEVT_CHECKBOX, boost::bind (&KDMOutputPanel::setup_sensitivity, this)); - _email->Bind (wxEVT_CHECKBOX, boost::bind (&KDMOutputPanel::setup_sensitivity, this)); + _write_to->Bind (wxEVT_CHECKBOX, boost::bind (&KDMOutputPanel::write_to_changed, this)); + _email->Bind (wxEVT_CHECKBOX, boost::bind (&KDMOutputPanel::email_changed, this)); _write_flat->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this)); _write_folder->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this)); _write_zip->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this)); @@ -167,6 +168,22 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent) void +KDMOutputPanel::write_to_changed () +{ + Config::instance()->set_write_kdms_to_disk(_write_to->GetValue()); + setup_sensitivity (); +} + + +void +KDMOutputPanel::email_changed () +{ + Config::instance()->set_email_kdms(_email->GetValue()); + setup_sensitivity (); +} + + +void KDMOutputPanel::setup_sensitivity () { bool const write = _write_to->GetValue (); |
