From 61724dd3c9656d1e26ae945ce784ca50c2059695 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 12 May 2020 00:10:38 +0200 Subject: [PATCH] Move bitmap_path() to wx_util.{cc,h} --- src/wx/timeline_dialog.cc | 21 --------------------- src/wx/timeline_dialog.h | 1 - src/wx/wx_util.cc | 23 +++++++++++++++++++++++ src/wx/wx_util.h | 2 +- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 3a720cfec..0d0d4f9f9 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -93,27 +93,6 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film, weak_pt _film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2)); } -wxString -TimelineDialog::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()); -} - void TimelineDialog::film_change (ChangeType type, Film::Property p) { diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h index 62649a5f2..77dfede50 100644 --- a/src/wx/timeline_dialog.h +++ b/src/wx/timeline_dialog.h @@ -35,7 +35,6 @@ public: private: void film_change (ChangeType type, Film::Property); void tool_clicked (wxCommandEvent& id); - wxString bitmap_path (std::string name); boost::weak_ptr _film; Timeline _timeline; 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()); +} + diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 8e0befba9..bff58a323 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -87,7 +87,7 @@ extern wxSplashScreen* maybe_show_splash (); extern double calculate_mark_interval (double start); extern bool display_progress (wxString title, wxString task); extern bool report_errors_from_last_job (wxWindow* parent); - +extern wxString bitmap_path (std::string name); struct Offset { -- 2.30.2