summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-01-02 01:58:59 +0100
committerCarl Hetherington <cth@carlh.net>2024-01-02 01:59:02 +0100
commit082d1d408fb5b503dc7b50dc97241c4ae794a753 (patch)
tree4d614eb611772ad5dcead8b0b0dcf9af3ba99bd5 /src
parentbf4ea03da40f43219ae59568d0cc9535f2058b7f (diff)
Observe CPL changing, so that (e.g.) Make KDM button becomes sensitive
when selecting a screen and then choosing a CPL by browsing the filesystem (when there was no CPL previously selected).
Diffstat (limited to 'src')
-rw-r--r--src/wx/dkdm_dialog.cc1
-rw-r--r--src/wx/kdm_cpl_panel.cc2
-rw-r--r--src/wx/kdm_cpl_panel.h3
-rw-r--r--src/wx/kdm_dialog.cc1
-rw-r--r--src/wx/self_dkdm_dialog.cc1
5 files changed, 8 insertions, 0 deletions
diff --git a/src/wx/dkdm_dialog.cc b/src/wx/dkdm_dialog.cc
index 6a4913d86..26f521573 100644
--- a/src/wx/dkdm_dialog.cc
+++ b/src/wx/dkdm_dialog.cc
@@ -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 ();
diff --git a/src/wx/kdm_cpl_panel.cc b/src/wx/kdm_cpl_panel.cc
index 8bd67db9e..4699582aa 100644
--- a/src/wx/kdm_cpl_panel.cc
+++ b/src/wx/kdm_cpl_panel.cc
@@ -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
diff --git a/src/wx/kdm_cpl_panel.h b/src/wx/kdm_cpl_panel.h
index 9ce90217e..91821d7a3 100644
--- a/src/wx/kdm_cpl_panel.h
+++ b/src/wx/kdm_cpl_panel.h
@@ -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 ();
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 9135baf23..c15156eee 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -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 ();
diff --git a/src/wx/self_dkdm_dialog.cc b/src/wx/self_dkdm_dialog.cc
index c8587e7ee..4702557e7 100644
--- a/src/wx/self_dkdm_dialog.cc
+++ b/src/wx/self_dkdm_dialog.cc
@@ -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));
}