Remember the state of the write to/email checkboxes in the KDM creator across runs...
[dcpomatic.git] / src / wx / kdm_output_panel.cc
index 8a2757557e940952eb38a01ec294c6bf9f878f78..11f921aad5c236b70b2e363ad6d6b5d7867bd866 100644 (file)
@@ -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));
@@ -166,6 +167,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 ()
 {