summaryrefslogtreecommitdiff
path: root/src/wx/film_viewer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx/film_viewer.cc')
-rw-r--r--src/wx/film_viewer.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 96e20a281..f2f6ba23d 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -114,6 +114,8 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
JobManager::instance()->ActiveJobsChanged.connect (
bind (&FilmViewer::active_jobs_changed, this, _1)
);
+
+ setup_sensitivity ();
}
void
@@ -142,8 +144,10 @@ FilmViewer::set_film (shared_ptr<Film> f)
return;
}
+ _film_connection = _film->Changed.connect (boost::bind (&FilmViewer::film_changed, this, _1));
+
_player->set_approximate_size ();
- _player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1));
+ _player_connection = _player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1));
calculate_sizes ();
get (_position, _last_get_accurate);
@@ -402,3 +406,24 @@ FilmViewer::player_changed (bool frequent)
calculate_sizes ();
get (_position, _last_get_accurate);
}
+
+void
+FilmViewer::setup_sensitivity ()
+{
+ bool const c = !_film->content().empty ();
+ _slider->Enable (c);
+ _back_button->Enable (c);
+ _forward_button->Enable (c);
+ _play_button->Enable (c);
+ _outline_content->Enable (c);
+ _frame_number->Enable (c);
+ _timecode->Enable (c);
+}
+
+void
+FilmViewer::film_changed (Film::Property p)
+{
+ if (p == Film::CONTENT) {
+ setup_sensitivity ();
+ }
+}