Use local copy of Wireshark documentation on UNIX if it's available.
authorBalint Reczey <balint.reczey@ericsson.com>
Sun, 1 Aug 2010 10:45:42 +0000 (10:45 -0000)
committerBalint Reczey <balint.reczey@ericsson.com>
Sun, 1 Aug 2010 10:45:42 +0000 (10:45 -0000)
Installation has to be done manually to the location specified by --docdir
configure option.

svn path=/trunk/; revision=33683

configure.in
gtk/help_dlg.c

index 75f7d9a6d79d4e2082467836d890b409f68bd2b8..e00431334e41b0d2d5c13fae3c1c0e9d8ed0726f 100644 (file)
@@ -654,6 +654,17 @@ datafiledir=`(
 )`
 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
 
+# Create DOC_DIR #define for config.h
+docdir=`(
+    test "x$prefix" = xNONE && prefix=$ac_default_prefix
+    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+    # Ugly hack, but I don't see how this problem can be solved
+    # properly that DOC_DIR had a value starting with
+    # "${prefix}/" instead of e.g. "/usr/local/"
+    eval eval echo "$docdir"
+)`
+AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
+
 # GTK checks; we require GTK+ 2.4 or later.
 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
 # programs to be built with GTK+.
index e703442724b4412ac44e19100d58603a42a08b12..4b8220e79ad44a5921f77f1f996914c5f43734c2 100644 (file)
@@ -107,8 +107,13 @@ void help_topic_html(const gchar *topic) {
 
     url = g_string_new("");
 
-    /* try to open the HTML page from wireshark.org instead */
-    g_string_append_printf(url, "http://www.wireshark.org/docs/wsug_html_chunked/%s", topic);
+    if (g_file_test(DOC_DIR "/wsug_html_chunked", G_FILE_TEST_IS_DIR)) {
+        /* try to open the HTML page from wireshark.org instead */
+        g_string_append_printf(url, "file://" DOC_DIR "/wsug_html_chunked/%s", topic);
+    } else {
+        /* try to open the HTML page from wireshark.org instead */
+        g_string_append_printf(url, "http://www.wireshark.org/docs/wsug_html_chunked/%s", topic);
+    }
 
     browser_open_url(url->str);