fixup! First hacks on OOBE help. help
authorCarl Hetherington <cth@carlh.net>
Wed, 10 Jun 2020 22:52:54 +0000 (00:52 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 20 Jun 2020 18:09:15 +0000 (20:09 +0200)
src/wx/wx_help.cc
src/wx/wx_util.cc
src/wx/wx_util.h

index 529977c961270e04df7fe4f6eab88998e900da62..5520437473d09a8610136d931c3bea2f5ca1f02a 100644 (file)
@@ -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;
index f8756549b44bca308ca591cace3c3859a9fea02e..75cdedc0097f8665d609aedc21d6b4a112845120 100644 (file)
@@ -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());
+}
index af938b670f54121b9d478fe9f4546c3a69d370e7..e33c1a7ff956de8ffa77b8f3180e810d4f5b9292 100644 (file)
@@ -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