X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_editor.cc;h=ce91c3cc49565a06e288c27dfca0f3f13c891983;hb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;hp=59b44cd8c0e3ab53949352a6ac312fb672b1ed2c;hpb=39e2134910fc916a45ebddf121664afcbd76cc19;p=dcpomatic.git diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 59b44cd8c..ce91c3cc4 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -38,9 +38,12 @@ using std::cout; using std::string; using std::list; -using boost::shared_ptr; -using boost::weak_ptr; +using std::shared_ptr; +using std::weak_ptr; using boost::optional; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif FilmEditor::FilmEditor (wxWindow* parent, weak_ptr viewer) : wxPanel (parent) @@ -52,7 +55,7 @@ FilmEditor::FilmEditor (wxWindow* parent, weak_ptr viewer) _content_panel = new ContentPanel (_main_notebook, _film, viewer); _main_notebook->AddPage (_content_panel->window(), _("Content"), true); - _dcp_panel = new DCPPanel (_main_notebook, _film); + _dcp_panel = new DCPPanel (_main_notebook, _film, viewer); _main_notebook->AddPage (_dcp_panel->panel (), _("DCP"), false); JobManager::instance()->ActiveJobsChanged.connect ( @@ -125,18 +128,21 @@ FilmEditor::set_film (shared_ptr film) _content_panel->set_film (_film); _dcp_panel->set_film (_film); - if (_film) { - _film->Change.connect (bind (&FilmEditor::film_change, this, _1, _2)); - _film->ContentChange.connect (bind (&FilmEditor::film_content_change, this, _1, _3)); + if (!_film) { + FileChanged (""); + return; } - if (_film && _film->directory()) { + _film->Change.connect (bind (&FilmEditor::film_change, this, _1, _2)); + _film->ContentChange.connect (bind (&FilmEditor::film_content_change, this, _1, _3)); + + if (_film->directory()) { FileChanged (_film->directory().get()); } else { FileChanged (""); } - if (!_film->content().empty ()) { + if (!_film->content().empty()) { _content_panel->set_selection (_film->content().front ()); } } @@ -153,3 +159,11 @@ FilmEditor::active_jobs_changed (optional j) { set_general_sensitivity (!j); } + + +void +FilmEditor::first_shown () +{ + _content_panel->first_shown (); +} +