Fix "create KDM" button sensitivity with invalid KDM time range.
authorCarl Hetherington <cth@carlh.net>
Sun, 19 Nov 2023 20:34:27 +0000 (21:34 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 20 Nov 2023 06:31:44 +0000 (07:31 +0100)
src/tools/dcpomatic_kdm.cc

index fbeac764057ce93b48324ee95afbcb14cb9f4f90..8cf38128347c58e00a45fc102152a7a78c337d8b 100644 (file)
@@ -244,6 +244,7 @@ public:
                _remove_dkdm->Bind (wxEVT_BUTTON, bind (&DOMFrame::remove_dkdm_clicked, this));
                _export_dkdm->Bind (wxEVT_BUTTON, bind (&DOMFrame::export_dkdm_clicked, this));
                _dkdm_search->Bind(wxEVT_TEXT, boost::bind(&DOMFrame::dkdm_search_changed, this));
+               _timing->TimingChanged.connect(boost::bind(&DOMFrame::setup_sensitivity, this));
 
                setup_sensitivity ();
 
@@ -479,7 +480,7 @@ private:
                _dkdm->GetSelections (sel);
                auto group = dynamic_pointer_cast<DKDMGroup>(selected_dkdm());
                auto dkdm = dynamic_pointer_cast<DKDM>(selected_dkdm());
-               _create->Enable (!_screens->screens().empty() && sel.GetCount() > 0 && dkdm);
+               _create->Enable(!_screens->screens().empty() && _timing->valid() && sel.GetCount() > 0 && dkdm);
                _remove_dkdm->Enable (sel.GetCount() > 0 && (!group || group->name() != "root"));
                _export_dkdm->Enable (sel.GetCount() > 0 && dkdm);
        }