Use web help files if local files do not exist
authorColin Clark <colin.clark@cclark.uk>
Sat, 3 Feb 2018 11:29:16 +0000 (11:29 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sat, 3 Feb 2018 11:29:16 +0000 (11:29 +0000)
src/window.c

index f672ef5..dd70cb4 100644 (file)
@@ -244,7 +244,18 @@ void help_window_show(const gchar *key)
 
        if (key && strstr(key, ".html") != 0)
                {
-               gchar *path = g_build_filename("file://", GQ_HTMLDIR, key, NULL);
+               path = g_build_filename(GQ_HTMLDIR, key, NULL);
+               if (!isfile(path))
+                       {
+                       if (g_strcmp0(key, "index.html") == 0)
+                               {
+                               path = g_build_filename("http://geeqie.org/help/", "GuideIndex.html", NULL);
+                               }
+                       else
+                               {
+                               path = g_build_filename("http://geeqie.org/help/", key, NULL);
+                               }
+                       }
                help_browser_run(path);
                g_free(path);
                return;