X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fhelp-menu.c;h=1dc2daf3090b1dfc28c6c94fcfa5fbc3ebac9308;hb=174fe8e41ef09534218803189529cbd797750934;hp=aeef8c10c44ba2deb1d4762177fc3b56d964211e;hpb=f9b2322d7b0662bd313d9c63450638c39b88be70;p=pspp diff --git a/src/ui/gui/help-menu.c b/src/ui/gui/help-menu.c index aeef8c10c4..1dc2daf309 100644 --- a/src/ui/gui/help-menu.c +++ b/src/ui/gui/help-menu.c @@ -72,13 +72,13 @@ about_new (GtkMenuItem *mmm, GtkWindow *parent) gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (about), "Free Software Foundation"); - gtk_about_dialog_set_translator_credits + gtk_about_dialog_set_translator_credits ( GTK_ABOUT_DIALOG (about), /* TRANSLATORS: Do not translate this string. Instead, put the names of the people who have helped in the translation. */ _("translator-credits") - ); +); gtk_window_set_transient_for (GTK_WINDOW (about), parent); @@ -131,9 +131,7 @@ static gboolean open_windows_help (const gchar *helpuri, void online_help (const char *page) { - GError *err = NULL; GError *htmlerr = NULL; - gchar *argv[3] = { "yelp", 0, 0}; gchar *htmlargv[3] = HTMLOPENARGV; gchar *htmlfilename = NULL; gchar *htmlfullname = NULL; @@ -141,23 +139,21 @@ online_help (const char *page) if (page == NULL) { - argv[1] = g_strdup_printf ("file://%s", relocate (DOCDIR "/pspp.xml")); htmlfilename = g_strdup ("index.html"); } else { gchar **tokens = NULL; const int maxtokens = 5; - int idx = 0; - argv[1] = g_strdup_printf ("file://%s#%s", - relocate (DOCDIR "/pspp.xml"), page); + int idx ; /* The page will be translated to the htmlfilename page htmlfilename GRAPH#SCATTERPLOT SCATTERPLOT.html QUICK-CLUSTER QUICK-CLUSTER.html which is valid for the multiple page html doc*/ tokens = g_strsplit (page, "#", maxtokens); - for(;tokens[idx] && idx < maxtokens;idx++); + for (idx = 0; idx < maxtokens && tokens[idx]; idx++) + ; htmlfilename = g_strdup_printf ("%s.html", tokens[idx-1]); g_strfreev (tokens); } @@ -187,9 +183,7 @@ online_help (const char *page) osx: wine is started to launch the uri... windows: not so bad, but the first access does not work*/ - if (! (g_spawn_async (NULL, argv, - NULL, G_SPAWN_SEARCH_PATH, - NULL, NULL, NULL, &err) || + if (! ( #ifdef _WIN32 open_windows_help (htmluri, &htmlerr)) #else @@ -197,21 +191,17 @@ online_help (const char *page) NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &htmlerr)) #endif - ) +) { - msg (ME, _("Cannot open reference manual via yelp: %s. " - "Cannot open via html: %s " + msg (ME, _("Cannot open via html: %s " "with uri: %s " "The PSSP manual is also available at %s"), - err->message, htmlerr->message, htmluri, PACKAGE_URL "documentation.html"); } - g_free (argv[1]); g_free (htmluri); - g_clear_error (&err); g_clear_error (&htmlerr); } @@ -231,7 +221,7 @@ create_help_menu (GtkWindow *toplevel) GtkWidget *help_ref = gtk_menu_item_new_with_mnemonic (_("_Reference Manual")); GtkAccelGroup *accel_group = gtk_accel_group_new (); - + gtk_window_add_accel_group (toplevel, accel_group); gtk_widget_add_accelerator (help_ref, @@ -244,10 +234,12 @@ create_help_menu (GtkWindow *toplevel) g_signal_connect (help_about, "activate", G_CALLBACK (about_new), toplevel); g_signal_connect (help_ref, "activate", G_CALLBACK (reference_manual), NULL); - + g_object_set (menuitem, "submenu", menu, NULL); gtk_widget_show_all (menuitem); - + + g_object_unref (accel_group); + return menuitem; }