From a29c7b6e5ac6f1f693028bf8aa34c221aedc6c9b Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Thu, 5 Feb 2009 09:01:14 +0000 Subject: [PATCH] Make use of GConf optional. Based on patch by Hib Eris. See bug #339172. 2009-02-05 Carlos Garcia Campos * configure.ac: * shell/ev-window.c: (ev_window_setup_action_sensitivity): Make use of GConf optional. Based on patch by Hib Eris. See bug #339172. svn path=/trunk/; revision=3414 --- ChangeLog | 8 ++++++++ configure.ac | 24 +++++++++++++++++++++--- shell/ev-window.c | 10 ++++++++-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01929de6..35bd25de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-02-05 Carlos Garcia Campos + + * configure.ac: + * shell/ev-window.c: (ev_window_setup_action_sensitivity): + + Make use of GConf optional. Based on patch by Hib Eris. See bug + #339172. + 2009-02-04 Christian Persch * libdocument/ev-init.c: (ev_init): Make ev_init() also bind the diff --git a/configure.ac b/configure.ac index e50c404b..c04a07b1 100644 --- a/configure.ac +++ b/configure.ac @@ -95,7 +95,7 @@ PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIR PKG_CHECK_MODULES(LIBVIEW, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED) PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED) PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED) -PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gthread-2.0 gconf-2.0) +PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gthread-2.0) PKG_CHECK_MODULES(SMCLIENT, gtk+-2.0 gthread-2.0) AC_SUBST(SMCLIENT_CFLAGS) @@ -110,6 +110,7 @@ LIBS="$LIBS $BACKEND_LIBS" AC_CHECK_FUNCS(cairo_format_stride_for_width) LIBS=$evince_save_LIBS +dnl ========= Check for Keyring AC_ARG_WITH(keyring, AC_HELP_STRING([--without-keyring],[disable the use of gnome-keyring]), [case "${withval}" in @@ -157,6 +158,22 @@ AC_SUBST([DBUS_LIBS]) AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"]) AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"]) +dnl ========= Check for GConf +AC_ARG_WITH(gconf, + AC_HELP_STRING([--without-gconf],[disable the use of gconf]), + [case "${withval}" in + yes) WITH_GCONF=yes ;; + no) WITH_GCONF=no ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-gconf) ;; + esac], + [WITH_GCONF=yes]) dnl Default value +AM_CONDITIONAL(WITH_GCONF, test x$WITH_GCONF = "xyes") + +if test x$WITH_GCONF = "xyes"; then + PKG_CHECK_MODULES(GCONF, gconf-2.0) + AC_DEFINE([WITH_GCONF],[1],[Define if GConf support is enabled]) +fi + dnl Debug mode AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], @@ -182,8 +199,8 @@ BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG AC_SUBST(BACKEND_CFLAGS) AC_SUBST(BACKEND_LIBS) -SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS" -SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $KEYRING_LIBS -lz" +SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $KEYRING_CFLAGS $GCONF_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS" +SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $KEYRING_LIBS $GCONF_LIBS -lz" AC_SUBST(SHELL_CFLAGS) AC_SUBST(SHELL_LIBS) @@ -536,6 +553,7 @@ AC_OUTPUT echo " Configure summary: + GConf Support......: $WITH_GCONF Keyring Support....: $WITH_KEYRING DBUS Support.......: $enable_dbus Nautilus Plugin....: $HAVE_NAUTILUS diff --git a/shell/ev-window.c b/shell/ev-window.c index 523a8c6a..77455c63 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -43,7 +43,9 @@ #else #include #endif +#ifdef WITH_GCONF #include +#endif #include "egg-editable-toolbar.h" #include "egg-toolbar-editor.h" @@ -340,8 +342,9 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) gboolean can_get_text = FALSE; gboolean has_pages = FALSE; gboolean can_find = FALSE; - +#ifdef WITH_GCONF GConfClient *client; +#endif if (document) { has_document = TRUE; @@ -364,10 +367,12 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) can_find = TRUE; } +#ifdef WITH_GCONF client = gconf_client_get_default (); override_restrictions = gconf_client_get_bool (client, GCONF_OVERRIDE_RESTRICTIONS, NULL); +#endif if (!override_restrictions && info && info->fields_mask & EV_DOCUMENT_INFO_PERMISSIONS) { ok_to_print = (info->permissions & EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT); ok_to_copy = (info->permissions & EV_DOCUMENT_PERMISSIONS_OK_TO_COPY); @@ -376,7 +381,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) if (has_document && !EV_IS_FILE_EXPORTER(document)) ok_to_print = FALSE; - +#ifdef WITH_GCONF if (gconf_client_get_bool (client, GCONF_LOCKDOWN_SAVE, NULL)) { ok_to_copy = FALSE; } @@ -386,6 +391,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) } g_object_unref (client); +#endif /* File menu */ ev_window_set_action_sensitive (ev_window, "FileOpenCopy", has_document); -- 2.43.5