[Xfce4-commits] <xfce4-panel:master> Use new help function to redirect to docs.xfce.org.

Nick Schermer noreply at xfce.org
Fri Jan 6 22:14:01 CET 2012


Updating branch refs/heads/master
         to 3047ee12ab2d3c232227ab7dc0c35d7153bb37a1 (commit)
       from e6d2321f1a4a51f640592048651a0493002ae9b0 (commit)

commit 3047ee12ab2d3c232227ab7dc0c35d7153bb37a1
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Jan 6 22:13:12 2012 +0100

    Use new help function to redirect to docs.xfce.org.

 common/panel-utils.c |   66 +------------------------------------------------
 configure.ac.in      |    2 +-
 2 files changed, 3 insertions(+), 65 deletions(-)

diff --git a/common/panel-utils.c b/common/panel-utils.c
index e8c5d7c..56b0499 100644
--- a/common/panel-utils.c
+++ b/common/panel-utils.c
@@ -44,7 +44,7 @@ panel_utils_help_button_clicked (GtkWidget       *button,
   toplevel = gtk_widget_get_toplevel (button);
   panel_utils_show_help (GTK_WINDOW (toplevel),
       xfce_panel_plugin_get_name (panel_plugin),
-      "properties");
+      NULL);
 }
 
 
@@ -114,69 +114,7 @@ panel_utils_show_help (GtkWindow   *parent,
                        const gchar *page,
                        const gchar *offset)
 {
-  GdkScreen *screen;
-  gchar     *filename;
-  gchar     *uri = NULL;
-  GError    *error = NULL;
-  gchar     *locale;
-  gboolean   exists;
-
-  panel_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
-
-  if (G_LIKELY (parent != NULL))
-    screen = gtk_window_get_screen (parent);
-  else
-    screen = gdk_screen_get_default ();
-
-  if (page == NULL)
-    page = "index";
-
-  /* get the locale of the user */
-  locale = g_strdup (setlocale (LC_MESSAGES, NULL));
-  if (G_LIKELY (locale != NULL))
-    locale = g_strdelimit (locale, "._", '\0');
-  else
-    locale = g_strdup ("C");
-
-  /* check if the help page exists on the system */
-  filename = g_strconcat (HELPDIR, G_DIR_SEPARATOR_S, locale,
-                          G_DIR_SEPARATOR_S, page, ".html", NULL);
-  exists = g_file_test (filename, G_FILE_TEST_EXISTS);
-  if (!exists)
-    {
-      g_free (filename);
-      filename = g_strconcat (HELPDIR, G_DIR_SEPARATOR_S "C"
-                              G_DIR_SEPARATOR_S, page, ".html", NULL);
-      exists = g_file_test (filename, G_FILE_TEST_EXISTS);
-    }
-
-  if (G_LIKELY (exists))
-    {
-      uri = g_strconcat ("file://", filename, offset != NULL ? "#" : NULL, offset, NULL);
-    }
-  else if (xfce_dialog_confirm (parent, "web-browser", _("_Read Online"),
-               _("You can read the user manual online. This manual may however "
-                 "not exactly match your panel version."),
-               _("The user manual is not installed on your computer")))
-    {
-      uri = g_strconcat ("http://docs.xfce.org/help.php?package=xfce4-panel&lang=",
-                         locale, "&page=", page, "&anchor=", offset, NULL);
-    }
-
-  g_free (filename);
-  g_free (locale);
-
-  /* try to run the documentation browser */
-  if (uri != NULL
-      && !exo_execute_preferred_application_on_screen ("WebBrowser", uri, NULL,
-                                                       NULL, screen, &error))
-    {
-      /* display an error message to the user */
-      xfce_dialog_show_error (parent, error, _("Failed to open the documentation browser"));
-      g_error_free (error);
-    }
-
-  g_free (uri);
+  xfce_dialog_show_help (parent, "xfce4-panel", page, offset);
 }
 
 
diff --git a/configure.ac.in b/configure.ac.in
index 367313c..4320795 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -127,7 +127,7 @@ dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.8.0])
 XDT_CHECK_PACKAGE([GARCON], [garcon-1], [0.1.5])
-XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.9.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.8.0])
 XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])


More information about the Xfce4-commits mailing list