X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fwx_util.cc;h=f8756549b44bca308ca591cace3c3859a9fea02e;hb=4edc14c8b1410e24f68b510cc14409b96c0338a3;hp=6eef0d14795020f0cab6481e76e98ba9687e6567;hpb=47e29203daec51d313ed8ab8ef759752bce18d45;p=dcpomatic.git diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 6eef0d147..f8756549b 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -567,3 +567,26 @@ get_offsets (vector& offsets) return utc; } + + +wxString +bitmap_path (string 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()); +} +