From df936f57844340064ae3dcc2cf9dac0a0013be06 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 15 Oct 2022 02:17:38 +0200 Subject: [PATCH] Make overridden subtitle language option respect OK/Cancel. --- src/wx/content_advanced_dialog.cc | 8 +++----- src/wx/content_advanced_dialog.h | 3 ++- src/wx/content_menu.cc | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wx/content_advanced_dialog.cc b/src/wx/content_advanced_dialog.cc index ba2c3f43b..547b77bb3 100644 --- a/src/wx/content_advanced_dialog.cc +++ b/src/wx/content_advanced_dialog.cc @@ -139,7 +139,6 @@ ContentAdvancedDialog::ContentAdvancedDialog (wxWindow* parent, shared_ptrBind (wxEVT_BUTTON, bind(&ContentAdvancedDialog::set_video_frame_rate, this)); _video_frame_rate->Bind (wxEVT_TEXT, boost::bind(&ContentAdvancedDialog::video_frame_rate_changed, this)); _burnt_subtitle->Bind (wxEVT_CHECKBOX, boost::bind(&ContentAdvancedDialog::burnt_subtitle_changed, this)); - _burnt_subtitle_language->Changed.connect (boost::bind(&ContentAdvancedDialog::burnt_subtitle_language_changed, this)); setup_sensitivity (); } @@ -245,10 +244,9 @@ ContentAdvancedDialog::burnt_subtitle_changed () } -void -ContentAdvancedDialog::burnt_subtitle_language_changed () +optional +ContentAdvancedDialog::burnt_subtitle_language() const { - DCPOMATIC_ASSERT (_content->video); - _content->video->set_burnt_subtitle_language (_burnt_subtitle_language->get()); + return _burnt_subtitle_language->get(); } diff --git a/src/wx/content_advanced_dialog.h b/src/wx/content_advanced_dialog.h index 3c2454449..93a90ba61 100644 --- a/src/wx/content_advanced_dialog.h +++ b/src/wx/content_advanced_dialog.h @@ -19,6 +19,7 @@ */ +#include #include LIBDCP_DISABLE_WARNINGS #include @@ -45,6 +46,7 @@ public: } boost::optional video_frame_rate() const; + boost::optional burnt_subtitle_language() const; private: void edit_filters (); @@ -54,7 +56,6 @@ private: void video_frame_rate_changed (); void setup_sensitivity (); void burnt_subtitle_changed (); - void burnt_subtitle_language_changed (); std::shared_ptr _content; bool _filters_allowed = false; diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 3dfb2f282..cae56283b 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -474,6 +474,7 @@ ContentMenu::advanced () if (content->video) { content->video->set_use(!dialog->ignore_video()); + content->video->set_burnt_subtitle_language(dialog->burnt_subtitle_language()); } auto ffmpeg = dynamic_pointer_cast(content); -- 2.30.2