Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@openedhand.com>2007-05-04 15:14:02 (GMT)
committer Ross Burton <rburton@src.gnome.org>2007-05-04 15:14:02 (GMT)
commitc31fd74da4f237f783d2fc2ef7c614cf5db7ba28 (patch)
tree0fd4c978fcbc6d5670cce953c4814dfb6e806c35
parentb97df17e5b2d540896e14398a6291a79440e7e2a (diff)
Don't use libgnome to open help, instead call Yelp directly.
2007-05-04 Ross Burton <ross@openedhand.com> * shell/ev-window.c: Don't use libgnome to open help, instead call Yelp directly. svn path=/trunk/; revision=2435
-rw-r--r--ChangeLog5
-rw-r--r--shell/ev-window.c37
2 files changed, 38 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8aace31..99c8bb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-05-04 Ross Burton <ross@openedhand.com>
+ * shell/ev-window.c:
+ Don't use libgnome to open help, instead call Yelp directly.
+
+2007-05-04 Ross Burton <ross@openedhand.com>
+
* shell/ev-sidebar-attachments.c:
Don't use libgnome to lookup icons for MIME types, instead copy
code from GTK+ to do it manually.
diff --git a/shell/ev-window.c b/shell/ev-window.c
index cb7f71b..b18abe7 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -87,7 +87,6 @@
#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>
@@ -3133,15 +3132,45 @@ static void
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_free (command);
}
static void