]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
No need for a configure check; just use the GTK_CHECK_VERSION macro. Bug
[evince.git] / shell / ev-window.c
index e883f4fdb1c6355ad6b402aa0ab710193f41a5e0..b18abe7625ce1af8df1c51166c1f8e5543f6f327 100644 (file)
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <gnome.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <libgnomevfs/gnome-vfs-async-ops.h>
 #include <gconf/gconf-client.h>
 
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <libgnomevfs/gnome-vfs-async-ops.h>
 #include <gconf/gconf-client.h>
 
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 #include <string.h>
+#include <unistd.h>
 
 char *xdg_user_dir_lookup (char *type);
 
 
 char *xdg_user_dir_lookup (char *type);
 
@@ -3130,15 +3132,45 @@ static void
 ev_window_cmd_help_contents (GtkAction *action, EvWindow *ev_window)
 {
        GError *error = NULL;
 ev_window_cmd_help_contents (GtkAction *action, EvWindow *ev_window)
 {
        GError *error = NULL;
+       char *command;
+       const char *lang;
+       char *uri = NULL;
 
 
-        g_return_if_fail (EV_IS_WINDOW (ev_window));
+       int i;
+
+       const char * const * langs = g_get_language_names ();
+
+       for (i = 0; langs[i]; i++) {
+               lang = langs[i];
+               if (strchr (lang, '.')) {
+                       continue;
+               }
 
 
-       gnome_help_display ("evince.xml", NULL, &error);
+               uri = g_build_filename(GNOMEDATADIR,
+                                      "/gnome/help/" PACKAGE,
+                                      lang,
+                                      "/evince.xml",
+                                      NULL);
+                                       
+               if (g_file_test (uri, G_FILE_TEST_EXISTS)) {
+                       break;
+               }
+       }
 
 
-       if(error != NULL) {
+       if (uri == NULL) {
+               g_warning ("Cannot find help");
+               return;
+       }
+       
+       command = g_strconcat ("gnome-help ghelp://", uri,  NULL);
+       g_free (uri);
+       
+       g_spawn_command_line_async (command, &error);
+       if (error != NULL) {
                g_warning (error->message);
                g_error_free (error);
        }
                g_warning (error->message);
                g_error_free (error);
        }
+       g_free (command);
 }
 
 static void
 }
 
 static void