diff options
author | Nick Schermer <nick@xfce.org> | 2012-01-06 22:13:12 +0100 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2012-01-06 22:13:38 +0100 |
commit | 3047ee12ab2d3c232227ab7dc0c35d7153bb37a1 (patch) | |
tree | 9f095770a5c3b8e22bd0ba86c5e3be325927b9d9 /common | |
parent | e6d2321f1a4a51f640592048651a0493002ae9b0 (diff) | |
download | xfce4-panel-3047ee12ab2d3c232227ab7dc0c35d7153bb37a1.tar.gz |
Use new help function to redirect to docs.xfce.org.
Diffstat (limited to 'common')
-rw-r--r-- | common/panel-utils.c | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/common/panel-utils.c b/common/panel-utils.c index e8c5d7ce..56b04997 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); } |