evince r2895 - in trunk: . shell



Author: carlosgc
Date: Fri Feb  8 12:48:04 2008
New Revision: 2895
URL: http://svn.gnome.org/viewvc/evince?rev=2895&view=rev

Log:
2008-02-08  Carlos Garcia Campos  <carlosgc gnome org>
	* configure.ac:
	* shell/Makefile.am:
	* shell/ev-application.[ch]:
	* shell/ev-sidebar-links.c:
	* shell/ev-utils.[ch]:
	* shell/ev-window.[ch]:
	Remove libgnomeprint support. Fixes bug #512370.


Removed:
   trunk/shell/ev-print-job.c
   trunk/shell/ev-print-job.h
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/shell/Makefile.am
   trunk/shell/ev-application.c
   trunk/shell/ev-application.h
   trunk/shell/ev-sidebar-links.c
   trunk/shell/ev-utils.c
   trunk/shell/ev-utils.h
   trunk/shell/ev-window.c
   trunk/shell/ev-window.h

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Feb  8 12:48:04 2008
@@ -52,16 +52,13 @@
 
 LIBGNOMEUI_REQUIRED=2.14.0
 LIBGNOME_REQUIRED=2.14.0
-LIBGNOMEPRINTUI_REQUIRED=2.6.0
 GNOME_ICON_THEME_REQUIRED=2.17.1
 LIBXML_REQUIRED=2.5.0
 
-GTK_PRINT_REQUIRED=2.10.0
-
 PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
-PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gthread-2.0 libglade-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 libglade-2.0 gconf-2.0)
 
 BACKEND_LIBTOOL_FLAGS="-module -avoid-version"
 AC_SUBST(BACKEND_LIBTOOL_FLAGS)
@@ -106,55 +103,6 @@
 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
 AC_SUBST(GLIB_GENMARSHAL)
 
-dnl ========= Print support
-AC_ARG_WITH(print,
-	    [AC_HELP_STRING([--with-print=no/gtk/gnome/auto], [Compile with print support [default=auto]])],
-	    PRINT=$withval,
-            PRINT="auto")
-
-PKG_CHECK_MODULES(GNOME_PRINT, 
-		  libgnomeprintui-2.2 >= $LIBGNOMEPRINTUI_REQUIRED,
-		  enable_gnome_print=yes, enable_gnome_print=no)
-PKG_CHECK_MODULES(GTK_PRINT,
-		  gtk+-unix-print-2.0 >= $GTK_PRINT_REQUIRED,
-		  enable_gtk_print=yes, enable_gtk_print=no)
-enable_print=no
-if test x$PRINT = xgnome -a x$enable_gnome_print = xyes; then
-   enable_print=gnome
-else
-   if test x$PRINT = xgtk -a x$enable_gtk_print = xyes; then
-      enable_print=gtk
-   else
-      if test x$PRINT = xauto; then
-	 if test x$enable_gtk_print = xyes; then
-	    enable_print=gtk
-	 else
-	    if test x$enable_gnome_print = xyes; then
-	       enable_print=gnome
-	    fi
-	 fi
-      fi
-   fi
-fi
-
-if test x$enable_print = xgnome; then
-   AC_SUBST(GNOME_PRINT_CFLAGS)
-   AC_SUBST(GNOME_PRINT_LIBS)
-   AC_DEFINE([WITH_GNOME_PRINT],[1],[Enable GNOME Print Support.])
-   AC_DEFINE([WITH_PRINT],[1],[Enable Print Support.])
-fi
-
-if test x$enable_print = xgtk; then   
-   AC_SUBST(GTK_PRINT_CFLAGS)
-   AC_SUBST(GTK_PRINT_LIBS)
-   AC_DEFINE([WITH_GTK_PRINT],[1],[Enable GTK Print Support.])
-   AC_DEFINE([WITH_PRINT],[1],[Enable Print Support.])
-fi
-   
-AM_CONDITIONAL(WITH_GNOME_PRINT, test x$enable_print = xgnome)
-AM_CONDITIONAL(WITH_GTK_PRINT, test x$enable_print = xgtk)
-
-
 dnl ========= Check for DBUS
 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
 	[enable_dbus=yes],[enable_dbus=no])
@@ -525,7 +473,6 @@
 echo "
 Configure summary:
 	GNOME Support......:  $WITH_GNOME
-	Print Support......:  $enable_print
 	Keyring Support....:  $WITH_KEYRING
 	DBUS Support.......:  $enable_dbus
 	Nautilus Plugin....:  $HAVE_NAUTILUS

Modified: trunk/shell/Makefile.am
==============================================================================
--- trunk/shell/Makefile.am	(original)
+++ trunk/shell/Makefile.am	Fri Feb  8 12:48:04 2008
@@ -11,9 +11,7 @@
 	-DGNOMEICONDIR=\""$(datadir)/pixmaps"\" 	\
 	$(SHELL_CFLAGS)					\
 	$(WARN_CFLAGS)					\
-	$(DISABLE_DEPRECATED)				\
-	$(GNOME_PRINT_CFLAGS)				\
-	$(GTK_PRINT_CFLAGS)
+	$(DISABLE_DEPRECATED)
 
 bin_PROGRAMS=evince
 
@@ -87,13 +85,6 @@
 	ev-transition-animation.h	\
 	main.c
 
-if WITH_GNOME_PRINT
-evince_SOURCES+=			\
-	ev-print-job.c			\
-	ev-print-job.h
-endif
-
-
 evince_LDADD=									\
 	$(top_builddir)/cut-n-paste/zoom-control/libephyzoom.la			\
 	$(top_builddir)/cut-n-paste/toolbar-editor/libtoolbareditor.la		\
@@ -101,8 +92,7 @@
 	$(top_builddir)/cut-n-paste/gedit-message-area/libgeditmsgarea.la	\
 	$(top_builddir)/properties/libevproperties.la				\
 	$(top_builddir)/libdocument/libevbackend.la				\
-	$(SHELL_LIBS)								\
-	$(GNOME_PRINT_LIBS)
+	$(SHELL_LIBS)
 
 BUILT_SOURCES = ev-marshal.h ev-marshal.c
 

Modified: trunk/shell/ev-application.c
==============================================================================
--- trunk/shell/ev-application.c	(original)
+++ trunk/shell/ev-application.c	Fri Feb  8 12:48:04 2008
@@ -59,12 +59,10 @@
 
 	gchar *last_chooser_uri;
 
-#ifdef WITH_GTK_PRINT
 	GtkPrintSettings *print_settings;
 #if GTK_CHECK_VERSION (2, 11, 0)
 	gchar            *print_settings_file;
 #endif
-#endif
 };
 
 struct _EvApplicationClass {
@@ -638,7 +636,6 @@
 		application->toolbars_file = NULL;
 	}
 
-#ifdef WITH_GTK_PRINT
 #if GTK_CHECK_VERSION (2, 11, 0)
 	if (application->print_settings_file) {
 		if (application->print_settings) {
@@ -665,7 +662,6 @@
 		application->print_settings = NULL;
 	}
 #endif /* GTK 2.11.0 */
-#endif /* WITH_GTK_PRINT */
 	
 	g_free (application->last_chooser_uri);
 	g_object_unref (application);
@@ -788,7 +784,6 @@
 		totem_scrsaver_disable (application->scr_saver);	
 }
 
-#ifdef WITH_GTK_PRINT
 GtkPrintSettings *
 ev_application_get_print_settings (EvApplication *application)
 {
@@ -835,4 +830,4 @@
 	
 	application->print_settings = g_object_ref (settings);
 }
-#endif /* WITH_GTK_PRINT */
+

Modified: trunk/shell/ev-application.h
==============================================================================
--- trunk/shell/ev-application.h	(original)
+++ trunk/shell/ev-application.h	Fri Feb  8 12:48:04 2008
@@ -29,10 +29,7 @@
 
 #include <glib/gerror.h>
 #include <glib-object.h>
-
-#ifdef WITH_GTK_PRINT
 #include <gtk/gtkprintsettings.h>
-#endif
 
 #include "ev-window.h"
 
@@ -89,11 +86,9 @@
 const gchar	 *ev_application_get_chooser_uri     (EvApplication   *application);
 void		  ev_application_screensaver_enable  (EvApplication   *application);
 void		  ev_application_screensaver_disable (EvApplication   *application);
-#ifdef WITH_GTK_PRINT
 GtkPrintSettings *ev_application_get_print_settings  (EvApplication   *application);
 void              ev_application_set_print_settings  (EvApplication   *application,
 						      GtkPrintSettings *settings);
-#endif
 
 G_END_DECLS
 

Modified: trunk/shell/ev-sidebar-links.c
==============================================================================
--- trunk/shell/ev-sidebar-links.c	(original)
+++ trunk/shell/ev-sidebar-links.c	Fri Feb  8 12:48:04 2008
@@ -323,10 +323,7 @@
 	
 		window = gtk_widget_get_toplevel (GTK_WIDGET (sidebar));
 		if (EV_IS_WINDOW (window)) {
-#ifdef WITH_PRINT
-			ev_window_print_range (EV_WINDOW (window),
-					       first_page, last_page);
-#endif
+			ev_window_print_range (EV_WINDOW (window), first_page, last_page);
 		}
 	}
 }

Modified: trunk/shell/ev-utils.c
==============================================================================
--- trunk/shell/ev-utils.c	(original)
+++ trunk/shell/ev-utils.c	Fri Feb  8 12:48:04 2008
@@ -27,8 +27,6 @@
 #include <math.h>
 #include <glib/gi18n.h>
 
-#define PRINT_CONFIG_FILENAME	"ev-print-config.xml"
-
 typedef struct
 {
   int size;
@@ -213,98 +211,6 @@
 	g_free (rectangles);
 }
 
-#ifdef WITH_GNOME_PRINT
-gboolean
-using_pdf_printer (GnomePrintConfig *config)
-{
-	const guchar *driver;
-
-	driver = gnome_print_config_get (
-		config, (const guchar *)"Settings.Engine.Backend.Driver");
-
-	if (driver) {
-		if (!strcmp ((const gchar *)driver, "gnome-print-pdf"))
-			return TRUE;
-		else
-			return FALSE;
-	}
-
-	return FALSE;
-}
-
-gboolean
-using_postscript_printer (GnomePrintConfig *config)
-{
-	const guchar *driver;
-	const guchar *transport;
-
-	driver = gnome_print_config_get (
-		config, (const guchar *)"Settings.Engine.Backend.Driver");
-
-	transport = gnome_print_config_get (
-		config, (const guchar *)"Settings.Transport.Backend");
-
-	if (driver) {
-		if (!strcmp ((const gchar *)driver, "gnome-print-ps"))
-			return TRUE;
-		else
-			return FALSE;
-	} else 	if (transport) { /* these transports default to PostScript */
-		if (!strcmp ((const gchar *)transport, "CUPS"))
-			return TRUE;
-		else if (!strcmp ((const gchar *)transport, "LPD"))
-			return TRUE;
-		else if (!strcmp ((const gchar *)transport, "PAPI"))
-			return TRUE;
-	}
-
-	return FALSE;
-}
-
-GnomePrintConfig *
-load_print_config_from_file (void)
-{
-	GnomePrintConfig *print_config = NULL;
-	char *file_name, *contents = NULL;
-
-	file_name = g_build_filename (ev_dot_dir (), PRINT_CONFIG_FILENAME,
-				      NULL);
-
-	if (g_file_get_contents (file_name, &contents, NULL, NULL)) {
-		print_config = gnome_print_config_from_string (contents, 0);
-		g_free (contents);
-	}
-
-	if (print_config == NULL) {
-		print_config = gnome_print_config_default ();
-	}
-
-	g_free (file_name);
-
-	return print_config;
-}
-
-void
-save_print_config_to_file (GnomePrintConfig *config)
-{
-	char *file_name, *str;
-
-	g_return_if_fail (config != NULL);
-
-	str = gnome_print_config_to_string (config, 0);
-	if (str == NULL) return;
-
-	file_name = g_build_filename (ev_dot_dir (),
-				      PRINT_CONFIG_FILENAME,
-				      NULL);
-
-	g_file_set_contents (file_name, str, -1, NULL);
-
-	g_free (file_name);
-	g_free (str);
-}
-#endif /* WITH_GNOME_PRINT */
-
 static void
 ev_gui_sanitise_popup_position (GtkMenu *menu,
 				GtkWidget *widget,

Modified: trunk/shell/ev-utils.h
==============================================================================
--- trunk/shell/ev-utils.h	(original)
+++ trunk/shell/ev-utils.h	Fri Feb  8 12:48:04 2008
@@ -23,9 +23,6 @@
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gtk/gtk.h>
-#ifdef WITH_GNOME_PRINT
-#include <libgnomeprintui/gnome-print-dialog.h>
-#endif
 
 G_BEGIN_DECLS
 
@@ -40,12 +37,6 @@
 							     gboolean  *push_in,
 							     gpointer   user_data);
 
-#ifdef WITH_GNOME_PRINT
-GnomePrintConfig* 	load_print_config_from_file (void);
-void       		save_print_config_to_file (GnomePrintConfig *config);
-gboolean		using_postscript_printer (GnomePrintConfig *config);
-gboolean		using_pdf_printer (GnomePrintConfig *config);
-#endif
 gint 			get_num_monitors (GtkWindow * window);
 
 gdouble 		get_screen_dpi (GtkWindow * window);

Modified: trunk/shell/ev-window.c
==============================================================================
--- trunk/shell/ev-window.c	(original)
+++ trunk/shell/ev-window.c	Fri Feb  8 12:48:04 2008
@@ -67,14 +67,7 @@
 #include "ev-image.h"
 #include "ev-message-area.h"
 
-#ifdef WITH_GNOME_PRINT
-#include "ev-print-job.h"
-#include <libgnomeprintui/gnome-print-dialog.h>
-#endif
-
-#ifdef WITH_GTK_PRINT
 #include <gtk/gtkprintunixdialog.h>
-#endif
 
 #ifdef ENABLE_PDF
 #include <poppler.h>
@@ -128,9 +121,7 @@
 
 	/* Dialogs */
 	GtkWidget *properties;
-#ifdef WITH_PRINT
 	GtkWidget *print_dialog;
-#endif
 	GtkWidget *password_dialog;
 
 	/* UI Builders */
@@ -174,21 +165,18 @@
 	EvWindowPageMode page_mode;
 	EvWindowTitle *title;
 
-	EvJob *load_job;
-	EvJob *thumbnail_job;
-	EvJob *save_job;
-#ifdef WITH_GNOME_PRINT
-	GnomePrintJob *print_job;
-#endif
-
-#ifdef WITH_GTK_PRINT
+	EvJob            *load_job;
+	EvJob            *thumbnail_job;
+	EvJob            *save_job;
 	EvJob            *print_job;
+
+	/* Printing */
 	gboolean          print_preview;
 	GtkPrintJob      *gtk_print_job;
 	GtkPrinter       *printer;
 	GtkPrintSettings *print_settings;
 	GtkPageSetup     *print_page_setup;
-#endif
+
 };
 
 #define EV_WINDOW_GET_PRIVATE(object) \
@@ -209,7 +197,6 @@
 #define THUMBNAILS_SIDEBAR_ID "thumbnails"
 #define ATTACHMENTS_SIDEBAR_ID "attachments"
 
-#ifdef WITH_GTK_PRINT
 static const gchar *document_print_settings[] = {
 	GTK_PRINT_SETTINGS_N_COPIES,
 	GTK_PRINT_SETTINGS_COLLATE,
@@ -220,7 +207,6 @@
 	GTK_PRINT_SETTINGS_PAGE_RANGES,
 	GTK_PRINT_SETTINGS_PAGE_SET
 };
-#endif /* WITH_GTK_PRINT */
 
 static void	ev_window_update_actions	 	(EvWindow         *ev_window);
 static void     ev_window_sidebar_visibility_changed_cb (EvSidebar        *ev_sidebar,
@@ -232,10 +218,8 @@
 							 gpointer          data);
 static void     ev_window_set_icon_from_thumbnail       (EvJobThumbnail   *job,
 							 EvWindow         *ev_window);
-#ifdef WITH_GTK_PRINT
 static void     ev_window_print_job_cb                  (EvJobPrint       *job,
 							 EvWindow         *window);
-#endif
 static void     ev_window_save_job_cb                   (EvJobSave        *save,
 							 EvWindow         *window);
 static void     ev_window_sizing_mode_changed_cb        (EvView           *view,
@@ -281,6 +265,7 @@
 static void     find_bar_search_changed_cb              (EggFindBar       *find_bar,
 							 GParamSpec       *param,
 							 EvWindow         *ev_window);
+static void     ev_window_do_preview_print              (EvWindow         *window);
 
 G_DEFINE_TYPE (EvWindow, ev_window, GTK_TYPE_WINDOW)
 
@@ -353,24 +338,13 @@
 	if (gconf_client_get_bool (client, GCONF_LOCKDOWN_PRINT, NULL)) {
 		ok_to_print = FALSE;
 	}
-#ifndef WITH_PRINT
-	ok_to_print = FALSE;
-#endif
-	g_object_unref (client);
 
+	g_object_unref (client);
 
 	/* File menu */
 	ev_window_set_action_sensitive (ev_window, "FileOpenCopy", has_document);
 	ev_window_set_action_sensitive (ev_window, "FileSaveAs", has_document && ok_to_copy);
-
-#ifdef WITH_GTK_PRINT
 	ev_window_set_action_sensitive (ev_window, "FilePrintSetup", has_pages && ok_to_print);
-#endif
-
-#ifdef WITH_GNOME_PRINT
-	ev_window_set_action_sensitive (ev_window, "FilePrintSetup", FALSE);
-#endif
-	
 	ev_window_set_action_sensitive (ev_window, "FilePrint", has_pages && ok_to_print);
 	ev_window_set_action_sensitive (ev_window, "FileProperties", has_document && has_properties);
 
@@ -1441,17 +1415,9 @@
 		gtk_widget_destroy (ev_window->priv->password_dialog);
 	ev_window->priv->password_dialog = NULL;
 	
-#ifdef WITH_PRINT
 	if (ev_window->priv->print_dialog)
 		gtk_widget_destroy (ev_window->priv->print_dialog);
 	ev_window->priv->print_dialog = NULL;
-#endif
-
-#ifdef WITH_GNOME_PRINT
-	if (ev_window->priv->print_job)
-		g_object_unref (ev_window->priv->print_job);
-	ev_window->priv->print_job = NULL;
-#endif
 	
 	if (ev_window->priv->properties)
 		gtk_widget_destroy (ev_window->priv->properties);
@@ -2031,7 +1997,6 @@
 	gtk_widget_show (fc);
 }
 
-#ifdef WITH_GTK_PRINT
 static void
 ev_window_print_page_setup_done_cb (GtkPageSetup *page_setup,
 				    EvWindow     *window)
@@ -2044,22 +2009,18 @@
 		g_object_unref (window->priv->print_page_setup);
 	window->priv->print_page_setup = g_object_ref (page_setup);
 }
-#endif /* WITH_GTK_PRINT */
 
 static void
 ev_window_cmd_file_print_setup (GtkAction *action, EvWindow *ev_window)
 {
-#ifdef WITH_GTK_PRINT
 	gtk_print_run_page_setup_dialog_async (
 		GTK_WINDOW (ev_window),
 		ev_window->priv->print_page_setup,
 		ev_window->priv->print_settings,
 		(GtkPageSetupDoneFunc) ev_window_print_page_setup_done_cb,
 		ev_window);
-#endif /* WITH_GTK_PRINT */
 }
 
-#ifdef WITH_GTK_PRINT
 static void
 ev_window_clear_print_job (EvWindow *window)
 {
@@ -2442,124 +2403,6 @@
 
 	gtk_widget_show (dialog);
 }
-#endif /* WITH_GTK_PRINT */
-
-#ifdef WITH_GNOME_PRINT
-static gboolean
-ev_window_print_dialog_response_cb (GtkDialog *print_dialog,
-				    gint       response,
-				    EvWindow  *ev_window)
-{
-	EvPrintJob *print_job;
-	GnomePrintConfig *config;
-    
-	if (response != GNOME_PRINT_DIALOG_RESPONSE_PRINT) {
-		gtk_widget_destroy (GTK_WIDGET (print_dialog));
-		ev_window->priv->print_dialog = NULL;
-		g_object_unref (ev_window->priv->print_job);
-		ev_window->priv->print_job = NULL;
-		
-		return FALSE;
-	}
-
-	config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (print_dialog));
-
-	/* FIXME: Change this when we have the first backend
-	 * that can print more than postscript
-	 */
-	if (using_pdf_printer (config)) {
-		GtkWidget *dialog;
-		
-		dialog = gtk_message_dialog_new (GTK_WINDOW (print_dialog), GTK_DIALOG_MODAL,
-						 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
-						 _("Generating PDF is not supported"));
-		gtk_dialog_run (GTK_DIALOG (dialog));
-		gtk_widget_destroy (dialog);
-		
-		return FALSE;
-	} else if (!using_postscript_printer (config)) {
-		GtkWidget *dialog;
-
-		dialog = gtk_message_dialog_new (GTK_WINDOW (print_dialog), GTK_DIALOG_MODAL,
-						 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
-						 _("Printing is not supported on this printer."));
-		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-							  _("You were trying to print to a printer using the â%sâ driver. "
-							    "This program requires a PostScript printer driver."),
-							  gnome_print_config_get (config, (guchar *)"Settings.Engine.Backend.Driver"));
-		gtk_dialog_run (GTK_DIALOG (dialog));
-		gtk_widget_destroy (dialog);
-		
-		return FALSE;
-	}
-
-	save_print_config_to_file (config);
-    
-	print_job = g_object_new (EV_TYPE_PRINT_JOB,
-				  "gnome_print_job", ev_window->priv->print_job,
-				  "document", ev_window->priv->document,
-				  "print_dialog", print_dialog,
-				  NULL);
-
-	if (print_job != NULL) {
-		ev_print_job_print (print_job, GTK_WINDOW (ev_window));
-		g_object_unref (print_job);
-	}
-
-	g_object_unref (config);
-
-	gtk_widget_destroy (GTK_WIDGET (print_dialog));
-	ev_window->priv->print_dialog = NULL;
-	g_object_unref (ev_window->priv->print_job);
-	ev_window->priv->print_job = NULL;
-
-	return FALSE;
-}
-
-void
-ev_window_print_range (EvWindow *ev_window, int first_page, int last_page)
-{
-	GnomePrintConfig *config;
-	gchar *pages_label;
-
-        g_return_if_fail (EV_IS_WINDOW (ev_window));
-	g_return_if_fail (ev_window->priv->document != NULL);
-
-	config = load_print_config_from_file ();
-
-	if (ev_window->priv->print_job == NULL)
-		ev_window->priv->print_job = gnome_print_job_new (config);
-	
-	if (ev_window->priv->print_dialog == NULL) {
-		ev_window->priv->print_dialog =
-			gnome_print_dialog_new (ev_window->priv->print_job,
-						(guchar *) _("Print"),
-						(GNOME_PRINT_DIALOG_RANGE |
-						 GNOME_PRINT_DIALOG_COPIES));
-	}
-	
-	gtk_window_set_transient_for (GTK_WINDOW (ev_window->priv->print_dialog),
-				      GTK_WINDOW (ev_window));								
-	g_object_unref (config);								
-
-	pages_label = g_strconcat (_("Pages"), " ", NULL);
-	gnome_print_dialog_construct_range_page (GNOME_PRINT_DIALOG (ev_window->priv->print_dialog),
-						 GNOME_PRINT_RANGE_ALL |
-						 GNOME_PRINT_RANGE_RANGE,
-						 first_page, last_page,
-						 NULL, (const guchar *)pages_label);
-	g_free (pages_label);
-						 
-	gtk_dialog_set_response_sensitive (GTK_DIALOG (ev_window->priv->print_dialog),
-					   GNOME_PRINT_DIALOG_RESPONSE_PREVIEW,
-					   FALSE);
-
-	g_signal_connect (G_OBJECT (ev_window->priv->print_dialog), "response",
-			  G_CALLBACK (ev_window_print_dialog_response_cb),
-			  ev_window);
-	gtk_widget_show (ev_window->priv->print_dialog);
-}
-#endif /* WITH_GNOME_PRINT */
 
 static void
 ev_window_print (EvWindow *window)
@@ -2570,9 +2413,7 @@
 	page_cache = ev_page_cache_get (window->priv->document);
 	last_page = ev_page_cache_get_n_pages (page_cache);
 
-#ifdef WITH_PRINT
 	ev_window_print_range (window, 1, last_page);
-#endif
 }
 
 static void
@@ -3338,9 +3179,6 @@
 	ev_window_run_presentation (window);
 }
 
-#ifdef WITH_GTK_PRINT
-static void ev_window_do_preview_print (EvWindow *window);
-
 static gboolean
 ev_window_enumerate_printer_cb (GtkPrinter *printer,
 				EvWindow   *window)
@@ -3432,12 +3270,9 @@
 	gtk_widget_hide (GTK_WIDGET (window));
 }
 
-#endif /* WITH_GTK_PRINT */
-
 static void
 ev_window_cmd_preview_print (GtkAction *action, EvWindow *window)
 {
-#ifdef WITH_GTK_PRINT
 	EvWindowPrivate *priv = window->priv;
 	GtkPrintSettings *print_settings = NULL;
 #if GTK_CHECK_VERSION (2, 11, 0)
@@ -3468,7 +3303,6 @@
 
 	gtk_enumerate_printers ((GtkPrinterFunc) ev_window_enumerate_printer_cb,
 				window, NULL, FALSE);
-#endif /* WITH_GTK_PRINT */
 }
 
 static void
@@ -4165,8 +3999,6 @@
 	}
 	
 	ev_window_close_dialogs (window);
-
-#ifdef WITH_GTK_PRINT
 	ev_window_clear_print_job (window);
 
 	if (window->priv->gtk_print_job) {
@@ -4188,7 +4020,6 @@
 		g_object_unref (window->priv->print_page_setup);
 		window->priv->print_page_setup = NULL;
 	}
-#endif
 
 	if (priv->link) {
 		g_object_unref (priv->link);

Modified: trunk/shell/ev-window.h
==============================================================================
--- trunk/shell/ev-window.h	(original)
+++ trunk/shell/ev-window.h	Fri Feb  8 12:48:04 2008
@@ -82,12 +82,10 @@
 					   gboolean        unlink_temp_file,
 					   const gchar    *print_settings);
 gboolean	ev_window_is_empty	  (const EvWindow *ev_window);
-
-#ifdef WITH_PRINT
 void		ev_window_print_range     (EvWindow       *ev_window,
 					   int             first_page,
 					   int		   last_page);
-#endif
+
 G_END_DECLS
 
 #endif /* !EV_WINDOW_H */



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