From d88958ff52b8865d95d33b38cd53694dc8519c5a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Jul 2014 16:17:23 +0100 Subject: Only enable viewing of subtitles with SubRip. --- src/wx/subtitle_panel.cc | 10 +++++++--- 1 file 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 fc = boost::dynamic_pointer_cast (*i); + shared_ptr sc = boost::dynamic_pointer_cast (*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 sr = dynamic_pointer_cast (c.front ()); if (sr) { _view = new SubtitleView (this, _editor->film(), sr); + _view->Show (); } - - _view->Show (); } -- cgit v1.2.3