Fix content list in player.
authorCarl Hetherington <cth@carlh.net>
Thu, 15 Nov 2018 22:25:39 +0000 (22:25 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 22 Nov 2018 23:26:18 +0000 (23:26 +0000)
src/wx/content_view.cc
src/wx/content_view.h
src/wx/controls.cc

index aeefb65df7cdc20e963f49f53fb476043c1cd70d..e1503e790f15d67161e11fb73c59881f8b8f4af3 100644 (file)
@@ -33,6 +33,7 @@
 #include <wx/progdlg.h>
 
 using std::string;
+using std::cout;
 using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::optional;
@@ -64,10 +65,6 @@ ContentView::selected () const
 void
 ContentView::update ()
 {
-       if (!IsShown()) {
-               return;
-       }
-
        shared_ptr<Film> film = _film.lock ();
        if (!film) {
                return;
@@ -158,3 +155,9 @@ ContentView::get (string digest) const
 
        return shared_ptr<Content>();
 }
+
+void
+ContentView::set_film (weak_ptr<Film> film)
+{
+       _film = film;
+}
index ac64600e10a95feba9dc4cfd647e855b95eb4c78..471dd054bd95f81ab3ec29644a64c6a53ce465d4 100644 (file)
@@ -35,6 +35,7 @@ public:
        void update ();
 
        boost::shared_ptr<Content> get (std::string digest) const;
+       void set_film (boost::weak_ptr<Film> film);
 
 private:
        void add (boost::shared_ptr<Content> content);
index 8f1d5abdada753e61140c6a4d9267f1b96aee901..2d28077e189602830ac4a02c35071afe5df2aa4d 100644 (file)
@@ -42,6 +42,7 @@
 
 using std::string;
 using std::list;
+using std::cout;
 using std::make_pair;
 using std::exception;
 using boost::optional;
@@ -195,7 +196,6 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
        film_changed ();
 
        setup_sensitivity ();
-       _content_view->update ();
        update_playlist_directory ();
 
        JobManager::instance()->ActiveJobsChanged.connect (
@@ -554,6 +554,9 @@ Controls::film_changed ()
        if (_film) {
                _film->Change.connect (boost::bind (&Controls::film_change, this, _1, _2));
        }
+
+       _content_view->set_film (film);
+       _content_view->update ();
 }
 
 shared_ptr<Film>