From 76b0568f28839e802382f41b99b0ed5eea6f5479 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 27 Mar 2025 00:27:26 +0100 Subject: Make DKDM output panel tell everyone what the output method is and when it changes. --- src/wx/dkdm_output_panel.cc | 21 +++++++++++++++++++-- src/wx/dkdm_output_panel.h | 6 ++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/wx/dkdm_output_panel.cc b/src/wx/dkdm_output_panel.cc index f47639f35..66f6dab71 100644 --- a/src/wx/dkdm_output_panel.cc +++ b/src/wx/dkdm_output_panel.cc @@ -92,13 +92,21 @@ DKDMOutputPanel::DKDMOutputPanel(wxWindow* parent) table->Add(_email, 1, wxEXPAND); table->AddSpacer(0); - _write_to->bind(&DKDMOutputPanel::setup_sensitivity, this); - _email->bind(&DKDMOutputPanel::setup_sensitivity, this); + _write_to->bind(&DKDMOutputPanel::method_changed, this); + _email->bind(&DKDMOutputPanel::method_changed, this); SetSizer(table); } +void +DKDMOutputPanel::method_changed() +{ + setup_sensitivity(); + MethodChanged(); +} + + void DKDMOutputPanel::setup_sensitivity() { @@ -197,3 +205,12 @@ DKDMOutputPanel::directory() const { return wx_to_std(_folder->GetPath()); } + + +bool +DKDMOutputPanel::method_selected() const +{ + return _write_to->GetValue() || _email->GetValue(); +} + + diff --git a/src/wx/dkdm_output_panel.h b/src/wx/dkdm_output_panel.h index 71a897c41..31f621830 100644 --- a/src/wx/dkdm_output_panel.h +++ b/src/wx/dkdm_output_panel.h @@ -54,7 +54,13 @@ public: std::function confirm_overwrite ); + bool method_selected() const; + + boost::signals2::signal MethodChanged; + private: + void method_changed(); + NameFormatEditor* _filename_format; CheckBox* _write_to; #ifdef DCPOMATIC_USE_OWN_PICKER -- cgit v1.2.3