Observe CPL changing, so that (e.g.) Make KDM button becomes sensitive
authorCarl Hetherington <cth@carlh.net>
Tue, 2 Jan 2024 00:58:59 +0000 (01:58 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 2 Jan 2024 00:59:02 +0000 (01:59 +0100)
when selecting a screen and then choosing a CPL by browsing the filesystem
(when there was no CPL previously selected).

src/wx/dkdm_dialog.cc
src/wx/kdm_cpl_panel.cc
src/wx/kdm_cpl_panel.h
src/wx/kdm_dialog.cc
src/wx/self_dkdm_dialog.cc

index 6a4913d8655e65c937e86abfa00d6caf0ee53742..26f521573ddffafabdefdf2be1a623b19dd999f2 100644 (file)
@@ -123,6 +123,7 @@ DKDMDialog::DKDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        _recipients->RecipientsChanged.connect (boost::bind(&DKDMDialog::setup_sensitivity, this));
        _timing->TimingChanged.connect (boost::bind(&DKDMDialog::setup_sensitivity, this));
        _make->Bind (wxEVT_BUTTON, boost::bind(&DKDMDialog::make_clicked, this));
+       _cpl->Changed.connect(boost::bind(&DKDMDialog::setup_sensitivity, this));
 
        setup_sensitivity ();
 
index 8bd67db9ebd37706b1780dd25a514d2069ac629e..4699582aac538a4302a2472ae7307e336a0410da 100644 (file)
@@ -96,6 +96,8 @@ KDMCPLPanel::update_cpl_summary ()
        _dcp_directory->SetLabel (std_to_wx (_cpls[n].dcp_directory));
        _cpl_id->SetLabel (std_to_wx (_cpls[n].cpl_id));
        _cpl_annotation_text->SetLabel (std_to_wx(_cpls[n].cpl_annotation_text.get_value_or("")));
+
+       Changed();
 }
 
 void
index 9ce90217e8ac3a50a1b5d18ec08753fe8940c59b..91821d7a3bd2eae3b64229475b69f113fd64fefb 100644 (file)
@@ -25,6 +25,7 @@ LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
 LIBDCP_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
+#include <boost/signals2.hpp>
 
 
 class KDMCPLPanel : public wxPanel
@@ -35,6 +36,8 @@ public:
        boost::filesystem::path cpl () const;
        bool has_selected () const;
 
+       boost::signals2::signal<void ()> Changed;
+
 private:
        void update_cpl_choice ();
        void update_cpl_summary ();
index 9135baf236a08fe20805e26cf9be68bc010d24d5..c15156eee436e11b24eb02155f7f87691ec20703 100644 (file)
@@ -127,6 +127,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        _screens->ScreensChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
        _timing->TimingChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
        _make->Bind (wxEVT_BUTTON, boost::bind (&KDMDialog::make_clicked, this));
+       _cpl->Changed.connect(boost::bind(&KDMDialog::setup_sensitivity, this));
 
        setup_sensitivity ();
 
index c8587e7ee83a8620d99e5539457b89c00fe25f92..4702557e71f7171af0b68509eb93ad2cba56ee22 100644 (file)
@@ -123,6 +123,7 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, std::shared_ptr<const Film> fi
 
        _internal->Bind (wxEVT_RADIOBUTTON, bind (&SelfDKDMDialog::dkdm_write_type_changed, this));
        _write_to->Bind (wxEVT_RADIOBUTTON, bind (&SelfDKDMDialog::dkdm_write_type_changed, this));
+       _cpl->Changed.connect(boost::bind(&SelfDKDMDialog::setup_sensitivity, this));
 }