evince r3414 - in trunk: . shell



Author: carlosgc
Date: Thu Feb  5 09:01:14 2009
New Revision: 3414
URL: http://svn.gnome.org/viewvc/evince?rev=3414&view=rev

Log:
2009-02-05  Carlos Garcia Campos  <carlosgc gnome org>

	* 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.

Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/shell/ev-window.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Feb  5 09:01:14 2009
@@ -95,7 +95,7 @@
 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 @@
 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 @@
 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 @@
 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 @@
 
 echo "
 Configure summary:
+        GConf Support......:  $WITH_GCONF
 	Keyring Support....:  $WITH_KEYRING
 	DBUS Support.......:  $enable_dbus
 	Nautilus Plugin....:  $HAVE_NAUTILUS

Modified: trunk/shell/ev-window.c
==============================================================================
--- trunk/shell/ev-window.c	(original)
+++ trunk/shell/ev-window.c	Thu Feb  5 09:01:14 2009
@@ -43,7 +43,9 @@
 #else
 #include <gtk/gtkprintunixdialog.h>
 #endif
+#ifdef WITH_GCONF
 #include <gconf/gconf-client.h>
+#endif
 
 #include "egg-editable-toolbar.h"
 #include "egg-toolbar-editor.h"
@@ -340,8 +342,9 @@
 	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 @@
 		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 @@
 	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 @@
 	}
 
 	g_object_unref (client);
+#endif
 
 	/* File menu */
 	ev_window_set_action_sensitive (ev_window, "FileOpenCopy", has_document);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]