summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wx/wx_help.cc3
-rw-r--r--src/wx/wx_util.cc22
-rw-r--r--src/wx/wx_util.h1
3 files changed, 14 insertions, 12 deletions
diff --git a/src/wx/wx_help.cc b/src/wx/wx_help.cc
index 529977c96..552043747 100644
--- a/src/wx/wx_help.cc
+++ b/src/wx/wx_help.cc
@@ -61,7 +61,8 @@ HelpGUI::show (int index)
}
Message const& m = _messages[index];
- wxBitmap bitmap (bitmap_path("help/" + m.id));
+ boost::filesystem::path path = bitmap_directory() / "help" / String::compose("%1.png", m.id);
+ wxBitmap bitmap (std_to_wx(path.string()));
wxPoint pos;
if (m.anchor_point) {
pos = *m.anchor_point;
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index f8756549b..75cdedc00 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -569,24 +569,24 @@ get_offsets (vector<Offset>& offsets)
}
-wxString
-bitmap_path (string name)
+boost::filesystem::path
+bitmap_directory ()
{
- 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();
+ return path;
}
-#else
- base = shared_path();
#endif
- boost::filesystem::path p = base / String::compose("%1.png", name);
- return std_to_wx (p.string());
+ return shared_path();
}
+
+wxString
+bitmap_path (string name)
+{
+ boost::filesystem::path p = bitmap_directory() / 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 af938b670..e33c1a7ff 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -87,6 +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 boost::filesystem::path bitmap_directory ();
extern wxString bitmap_path (std::string name);
struct Offset