X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_dialog.cc;h=3a720cfecff8ec958d336c139c920bb64bcc6144;hb=4219d4b76c5cd5690b1f4fa0c248d93ced26d05a;hp=3af86b707753768aa77a0dc6c453d87c3a9a2aef;hpb=39e2134910fc916a45ebddf121664afcbd76cc19;p=dcpomatic.git diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 3af86b707..3a720cfec 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2018 Carl Hetherington + Copyright (C) 2013-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -33,8 +33,9 @@ using std::list; using std::cout; using std::string; using boost::shared_ptr; +using boost::weak_ptr; -TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film) +TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film, weak_ptr viewer) : wxDialog ( cp->window(), wxID_ANY, @@ -51,7 +52,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film) #endif ) , _film (film) - , _timeline (this, cp, film) + , _timeline (this, cp, film, viewer) { wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); @@ -95,7 +96,21 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film) wxString TimelineDialog::bitmap_path (string name) { - boost::filesystem::path p = shared_path() / String::compose("%1.png", name); + boost::filesystem::path base; + +#ifdef DCPOMATIC_DEBUG + /* Hack to allow OS X to find icons when running from the source tree */ + char* path = getenv ("DCPOMATIC_GRAPHICS"); + if (path) { + base = path; + } else { + base = shared_path(); + } +#else + base = shared_path(); +#endif + + boost::filesystem::path p = base / String::compose("%1.png", name); return std_to_wx (p.string()); }