From bd26e60016e9e08c1784ee2d90695cc7eeb7daee Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Thu, 15 Apr 2010 14:11:34 +0200 Subject: [PATCH] Make gnome-doc-utils optional --- Makefile.am | 7 +++++-- configure.ac | 30 +++++++++++++++++++++++++++++- shell/ev-window.c | 13 +++++++------ 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4647ca4f..a3ab2186 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,8 +14,11 @@ SUBDIRS = \ libmisc \ properties \ shell \ - po \ - help + po + +if ENABLE_HELP +SUBDIRS += help +endif if ENABLE_TESTS SUBDIRS += test diff --git a/configure.ac b/configure.ac index 01eef2b8..8f183579 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/shell/ev-window.c b/shell/ev-window.c index ec469761..b78c3175 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -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) { -- 2.43.0