Make DKDM output panel tell everyone what the output method is and when it changes.
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Mar 2025 23:27:26 +0000 (00:27 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 26 Mar 2025 23:30:25 +0000 (00:30 +0100)
src/wx/dkdm_output_panel.cc
src/wx/dkdm_output_panel.h

index f47639f35a164a5e25566ad035312f53962d958c..66f6dab71cad9943e56779843df9eff5db559637 100644 (file)
@@ -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();
+}
+
+
index 71a897c41b1ec869adec504233d2ff4c55b31c23..31f621830fc3dee9a5d15d74407c63dd9d42fc6f 100644 (file)
@@ -54,7 +54,13 @@ public:
                std::function<bool (boost::filesystem::path)> confirm_overwrite
                );
 
+       bool method_selected() const;
+
+       boost::signals2::signal<void ()> MethodChanged;
+
 private:
+       void method_changed();
+
        NameFormatEditor* _filename_format;
        CheckBox* _write_to;
 #ifdef DCPOMATIC_USE_OWN_PICKER