]> www.fi.muni.cz Git - evince.git/commitdiff
Make gnome-doc-utils optional
authorHib Eris <hib@hiberis.nl>
Thu, 15 Apr 2010 12:11:34 +0000 (14:11 +0200)
committerHib Eris <hib@hiberis.nl>
Thu, 15 Apr 2010 12:51:57 +0000 (14:51 +0200)
Makefile.am
configure.ac
shell/ev-window.c

index 4647ca4f93d33a528e5b17f2273cc2df1cf4eeba..a3ab21864f2d388c029b3ba7457479a15e6c15da 100644 (file)
@@ -14,8 +14,11 @@ SUBDIRS = \
        libmisc \
        properties \
        shell \
-       po \
-       help
+       po
+
+if ENABLE_HELP
+SUBDIRS += help
+endif
 
 if ENABLE_TESTS
 SUBDIRS += test
index 01eef2b868b01c919b6fdd23400d52fb90dad76b..8f1835790ba2c0cf4bc14c65b157871dfa9b46b2 100644 (file)
@@ -66,7 +66,6 @@ AC_PROG_SED
 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
 
-GNOME_DOC_INIT
 GNOME_MAINTAINER_MODE_DEFINES
 GNOME_COMPILE_WARNINGS
 GNOME_CXX_WARNINGS
@@ -714,6 +713,34 @@ AC_SUBST(EVINCE_MIME_TYPES)
 
 AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
 
+# *****************
+# Help files
+# *****************
+
+GNOME_DOC_INIT([], gnome_doc_utils=yes, gnome_doc_utils=no)
+
+AC_ARG_ENABLE(help,
+    [AS_HELP_STRING([--disable-help], [Disable offline help files])],
+    [enable_help=$enableval],
+    [enable_help=yes])
+
+if test "x$enable_help" = "xyes" && test "x$os_win32" = "xyes" ; then
+    AC_MSG_WARN([Offline help is disabled (not implemented on Windows).])
+    enable_help=no
+fi
+
+if test "x$enable_help" = "xyes" && test "x$gnome_doc_utils" == "xno"; then
+    AC_MSG_ERROR(
+       [gnome-doc-utils not found; use --disable-help to disable help files]
+    )
+fi
+
+if test "x$enable_help" = "xyes"; then
+    AC_DEFINE([OFFLINE_HELP_ENABLED], [1], [Enable offline help])
+fi
+
+AM_CONDITIONAL(ENABLE_HELP, test "x$enable_help" = "xyes")
+
 # *****************
 # API documentation
 # *****************
@@ -825,6 +852,7 @@ Configure summary:
        Keyring Support....:  $with_keyring
        DBUS Support.......:  $enable_dbus
        SM client support..:  $with_smclient
+       Help files.........:  $enable_help
        Nautilus Plugin....:  $enable_nautilus
        Thumbnailer........:  $enable_thumbnailer
        Previewer..........:  $enable_previewer
index ec469761fa35f91aa489b8cf5a5d97a3ec6a8347..b78c3175ac232fdf115ca90d867672c34decfe22 100644 (file)
@@ -433,11 +433,6 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
        ev_window_set_action_sensitive (ev_window, ZOOM_CONTROL_ACTION,  has_pages);
        ev_window_set_action_sensitive (ev_window, NAVIGATION_ACTION,  FALSE);
 
-        /* Help menu */
-#ifdef G_OS_WIN32
-       ev_window_set_action_sensitive (ev_window, "HelpContents", FALSE);
-#endif
-
         ev_window_update_actions (ev_window);
 }
 
@@ -3938,13 +3933,19 @@ ev_window_cmd_view_autoscroll (GtkAction *action, EvWindow *ev_window)
        ev_view_autoscroll_start (EV_VIEW (ev_window->priv->view));
 }
 
+#if OFFLINE_HELP_ENABLED
+#define EV_HELP "ghelp:evince"
+#else
+#define EV_HELP "http://library.gnome.org/users/evince/stable/"
+#endif
+
 static void
 ev_window_cmd_help_contents (GtkAction *action, EvWindow *ev_window)
 {
        GError  *error = NULL;
 
        gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (ev_window)),
-                     "ghelp:evince",
+                     EV_HELP,
                      gtk_get_current_event_time (),
                      &error);
        if (error) {