summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-15 22:25:39 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-22 23:26:18 +0000
commit620b7761a33d2e3641cd911bfe58e0fbb928c888 (patch)
tree702872826fdfefa486816a1e20a1e2e4f2bad965 /src
parent1b4d5951147bc88d771d0afaa98bbfa4ed85a822 (diff)
Fix content list in player.
Diffstat (limited to 'src')
-rw-r--r--src/wx/content_view.cc11
-rw-r--r--src/wx/content_view.h1
-rw-r--r--src/wx/controls.cc5
3 files changed, 12 insertions, 5 deletions
diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc
index aeefb65df..e1503e790 100644
--- a/src/wx/content_view.cc
+++ b/src/wx/content_view.cc
@@ -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;
+}
diff --git a/src/wx/content_view.h b/src/wx/content_view.h
index ac64600e1..471dd054b 100644
--- a/src/wx/content_view.h
+++ b/src/wx/content_view.h
@@ -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);
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index 8f1d5abda..2d28077e1 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -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>