X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fhelp-menu.c;h=cd4d751c6af4ef6c875f63fc061c1d5bbf710a51;hb=c43efc75c86dd48cd67f23a4d3b5132964b331b8;hp=1015fda89811d0e826101da7765b1c26eb23c7fd;hpb=1aa87f10e686eb09df296411d8ebfa28fa151860;p=pspp diff --git a/src/ui/gui/help-menu.c b/src/ui/gui/help-menu.c index 1015fda898..cd4d751c6a 100644 --- a/src/ui/gui/help-menu.c +++ b/src/ui/gui/help-menu.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2006, 2007, 2010 Free Software Foundation + Copyright (C) 2006, 2007, 2010, 2011, 2012 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ about_new (GtkMenuItem *m, GtkWindow *parent) gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about), pb); - gtk_window_set_icon_name (GTK_WINDOW (about), "psppicon"); + gtk_window_set_icon_name (GTK_WINDOW (about), "pspp"); gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (about), PACKAGE_URL); @@ -71,8 +71,8 @@ about_new (GtkMenuItem *m, GtkWindow *parent) gtk_about_dialog_set_translator_credits ( GTK_ABOUT_DIALOG (about), - /* TRANSLATORS: Use this string to list the people who have helped with - translation to your language. */ + /* TRANSLATORS: Do not translate this string. Instead, put the names of the people + who have helped in the translation. */ _("translator-credits") ); @@ -85,14 +85,23 @@ about_new (GtkMenuItem *m, GtkWindow *parent) gtk_widget_hide (about); } - -static void -reference_manual (GtkMenuItem *menu, gpointer data) +/* Open the manual at PAGE */ +void +online_help (const char *page) { GError *err = NULL; - gchar *cmd = g_strdup_printf ("yelp file://%s", relocate (DOCDIR "/pspp.xml")); + gchar *cmd = NULL; - if ( ! g_spawn_command_line_async (cmd, &err) ) + gchar *argv[3] = { "yelp", 0, 0}; + + if (page == NULL) + argv[1] = g_strdup_printf ("file://%s", relocate (DOCDIR "/pspp.xml")); + else + argv[1] = g_strdup_printf ("file://%s#%s", relocate (DOCDIR "/pspp.xml"), page); + + if (! g_spawn_async (NULL, argv, + NULL, G_SPAWN_SEARCH_PATH, + NULL, NULL, NULL, &err)) { msg (ME, _("Cannot open reference manual: %s. The PSPP user manual is " "also available at %s"), @@ -104,6 +113,14 @@ reference_manual (GtkMenuItem *menu, gpointer data) g_clear_error (&err); } +static void +reference_manual (GtkMenuItem *menu, gpointer data) +{ + online_help (NULL); +} + + + void merge_help_menu (GtkUIManager *uim) {