summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-07-01 16:17:23 +0100
committerCarl Hetherington <cth@carlh.net>2014-07-01 16:17:23 +0100
commitd88958ff52b8865d95d33b38cd53694dc8519c5a (patch)
treec7865b2e1f0c90402ebe5cad5e39ee3f3b10b147 /src
parente777b4336af5eb8c83fdd5dfe56116b10f973ad3 (diff)
Only enable viewing of subtitles with SubRip.
Diffstat (limited to 'src')
-rw-r--r--src/wx/subtitle_panel.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc
index 4b7f1ca53..adbd0f32e 100644
--- a/src/wx/subtitle_panel.cc
+++ b/src/wx/subtitle_panel.cc
@@ -156,14 +156,19 @@ SubtitlePanel::setup_sensitivity ()
{
int any_subs = 0;
int ffmpeg_subs = 0;
+ int subrip_subs = 0;
SubtitleContentList c = _editor->selected_subtitle_content ();
for (SubtitleContentList::const_iterator i = c.begin(); i != c.end(); ++i) {
shared_ptr<const FFmpegContent> fc = boost::dynamic_pointer_cast<const FFmpegContent> (*i);
+ shared_ptr<const SubRipContent> sc = boost::dynamic_pointer_cast<const SubRipContent> (*i);
if (fc) {
if (!fc->subtitle_streams().empty ()) {
++ffmpeg_subs;
++any_subs;
}
+ } else if (sc) {
+ ++subrip_subs;
+ ++any_subs;
} else {
++any_subs;
}
@@ -176,7 +181,7 @@ SubtitlePanel::setup_sensitivity ()
_y_offset->Enable (any_subs > 0 && use);
_scale->Enable (any_subs > 0 && use);
_stream->Enable (ffmpeg_subs == 1);
- _view_button->Enable (any_subs == 1);
+ _view_button->Enable (subrip_subs == 1);
}
void
@@ -251,7 +256,6 @@ SubtitlePanel::view_clicked ()
shared_ptr<SubRipContent> sr = dynamic_pointer_cast<SubRipContent> (c.front ());
if (sr) {
_view = new SubtitleView (this, _editor->film(), sr);
+ _view->Show ();
}
-
- _view->Show ();
}