r22378 - gnucash/trunk/src/gnome-utils - Show help and guide in gnome independent way

Geert Janssens gjanssens at code.gnucash.org
Mon Sep 10 15:21:49 EDT 2012


Author: gjanssens
Date: 2012-09-10 15:21:49 -0400 (Mon, 10 Sep 2012)
New Revision: 22378
Trac: http://svn.gnucash.org/trac/changeset/22378

Modified:
   gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c
   gnucash/trunk/src/gnome-utils/gnc-ui.h
Log:
Show help and guide in gnome independent way

The idea was taken from another gnome app: planner.

Note that the documentation has to be installed properly
for this to work on linux. Our current documentation
build doesn't install the documentation in the right way
and yelp won't find it. A fix has been committed, but
it will only be available in the next documentation
release.

Modified: gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c	2012-09-10 19:21:38 UTC (rev 22377)
+++ gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c	2012-09-10 19:21:49 UTC (rev 22378)
@@ -482,9 +482,16 @@
 gnc_gnome_help (const char *file_name, const char *anchor)
 {
     GError *error = NULL;
+    gchar *uri = NULL;
 
-    DEBUG ("Attempting to opening help file %s", file_name);
-    if (gnome_help_display (file_name, anchor, &error))
+    if (anchor)
+        uri = g_strconcat ("ghelp:", file_name, "?", anchor, NULL);
+    else
+        uri = g_strconcat ("ghelp:", file_name, NULL);
+
+    DEBUG ("Attempting to opening help uri %s", uri);
+
+    if (gtk_show_uri (NULL, uri, gtk_get_current_event_time (), &error))
         return;
 
     g_assert(error != NULL);

Modified: gnucash/trunk/src/gnome-utils/gnc-ui.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-ui.h	2012-09-10 19:21:38 UTC (rev 22377)
+++ gnucash/trunk/src/gnome-utils/gnc-ui.h	2012-09-10 19:21:49 UTC (rev 22378)
@@ -46,8 +46,8 @@
 #    define HF_GUIDE         "Gnucash Guide"
 #    define HF_HELP          "Gnucash Help"
 #else
-#    define HF_GUIDE         "gnucash-guide.xml"
-#    define HF_HELP          "gnucash-help.xml"
+#    define HF_GUIDE         "gnucash-guide"
+#    define HF_HELP          "gnucash-help"
 #endif
 
 /** Links in the Help Files *****************************************/



More information about the gnucash-changes mailing list