summaryrefslogtreecommitdiff
path: root/src/wx/kdm_output_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-04 21:26:18 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-04 21:26:18 +0000
commit9ccaee9ed18688b3862b8b7fb7e73b69e71568e3 (patch)
treeccea84223b46ae1bb8dfc9d362d2d6e8ace52d0a /src/wx/kdm_output_panel.cc
parente21611dbada74946fcdb037386f0e58fad8fc97e (diff)
Set up a default KDM write mode and preselect the last used one when re-opening the KDM window (#1137).
Diffstat (limited to 'src/wx/kdm_output_panel.cc')
-rw-r--r--src/wx/kdm_output_panel.cc31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc
index 29b697b89..0b99ee465 100644
--- a/src/wx/kdm_output_panel.cc
+++ b/src/wx/kdm_output_panel.cc
@@ -132,10 +132,25 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
table->Add (_email, 1, wxEXPAND);
table->AddSpacer (0);
+ switch (Config::instance()->last_kdm_write_type().get_value_or(Config::KDM_WRITE_FLAT)) {
+ case Config::KDM_WRITE_FLAT:
+ _write_flat->SetValue (true);
+ break;
+ case Config::KDM_WRITE_FOLDER:
+ _write_folder->SetValue (true);
+ break;
+ case Config::KDM_WRITE_ZIP:
+ _write_zip->SetValue (true);
+ break;
+ }
+
_write_to->SetValue (true);
- _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::setup_sensitivity, this));
+ _email->Bind (wxEVT_CHECKBOX, boost::bind (&KDMOutputPanel::setup_sensitivity, 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));
SetSizer (table);
}
@@ -150,6 +165,18 @@ KDMOutputPanel::setup_sensitivity ()
_write_zip->Enable (write);
}
+void
+KDMOutputPanel::kdm_write_type_changed ()
+{
+ if (_write_flat->GetValue()) {
+ Config::instance()->set_last_kdm_write_type (Config::KDM_WRITE_FLAT);
+ } else if (_write_folder->GetValue()) {
+ Config::instance()->set_last_kdm_write_type (Config::KDM_WRITE_FOLDER);
+ } else if (_write_zip->GetValue()) {
+ Config::instance()->set_last_kdm_write_type (Config::KDM_WRITE_ZIP);
+ }
+}
+
pair<shared_ptr<Job>, int>
KDMOutputPanel::make (
list<ScreenKDM> screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite, shared_ptr<Log> log