summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-26 19:58:56 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-26 19:58:56 +0000
commit3ae7939b8926df0fd767db294e5f7a8b07f43ba1 (patch)
tree2d69397484169e0a70989aa106cb02a0cdb4aa22
parentbccf7c5c6ff50e25dff8e0e433b81379d8999f9b (diff)
Fix double-appearance of subtitle colour controls.
-rw-r--r--src/wx/subtitle_appearance_dialog.cc7
-rw-r--r--src/wx/subtitle_appearance_dialog.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc
index 339388be6..ad4c03850 100644
--- a/src/wx/subtitle_appearance_dialog.cc
+++ b/src/wx/subtitle_appearance_dialog.cc
@@ -58,7 +58,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
/* XXX: assuming that all FFmpeg streams have bitmap subs */
if (_stream->colours().empty()) {
_job_manager_connection = JobManager::instance()->ActiveJobsChanged.connect(boost::bind(&SubtitleAppearanceDialog::active_jobs_changed, this, _1));
- JobManager::instance()->add(shared_ptr<Job>(new ExamineFFmpegSubtitlesJob(film, ff)));
+ _job = JobManager::instance()->add(shared_ptr<Job>(new ExamineFFmpegSubtitlesJob(film, ff)));
}
}
@@ -107,7 +107,10 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
t->SetLabelMarkup (_("<b>New colour</b>"));
_colour_table->Add (t, 1, wxALIGN_CENTER);
- add_colours ();
+ shared_ptr<Job> job = _job.lock ();
+ if (!job || job->finished()) {
+ add_colours ();
+ }
_colours_panel->SetSizer (_colour_table);
diff --git a/src/wx/subtitle_appearance_dialog.h b/src/wx/subtitle_appearance_dialog.h
index ed0360e4c..0b3c66132 100644
--- a/src/wx/subtitle_appearance_dialog.h
+++ b/src/wx/subtitle_appearance_dialog.h
@@ -33,6 +33,7 @@ class FFmpegSubtitleStream;
class wxCheckBox;
class wxWidget;
class Film;
+class Job;
class SubtitleAppearanceDialog : public wxDialog
{
@@ -76,6 +77,8 @@ private:
boost::signals2::scoped_connection _content_connection;
boost::signals2::scoped_connection _job_manager_connection;
+ boost::weak_ptr<Job> _job;
+
static int const NONE;
static int const OUTLINE;
static int const SHADOW;