Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/previewer
diff options
context:
space:
mode:
authorHib Eris <hib@hiberis.nl>2009-06-09 17:33:21 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-06-09 17:33:21 (GMT)
commita6fd45551db35e90ad13c0c483854740aefa312f (patch)
treee36277cbe4ceeec7176fae63f50282b9905c755b /previewer
parentea6c09ad0a1b74b26329a5f6a64d23c95c9bbd97 (diff)
[printing] Make use of gtk+-unix-print optional
Diffstat (limited to 'previewer')
-rw-r--r--previewer/ev-previewer-window.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/previewer/ev-previewer-window.c b/previewer/ev-previewer-window.c
index 15a1607..686fb0d 100644
--- a/previewer/ev-previewer-window.c
+++ b/previewer/ev-previewer-window.c
@@ -20,7 +20,9 @@
#include <config.h>
+#if GTKUNIXPRINT_ENABLED
#include <gtk/gtkunixprint.h>
+#endif
#include <glib/gi18n.h>
#include <evince-view.h>
#include "ev-page-action.h"
@@ -42,7 +44,9 @@ struct _EvPreviewerWindow {
/* Printing */
GtkPrintSettings *print_settings;
GtkPageSetup *print_page_setup;
+#if GTKUNIXPRINT_ENABLED
GtkPrinter *printer;
+#endif
gchar *print_job_title;
gchar *source_file;
};
@@ -103,6 +107,7 @@ ev_previewer_window_set_view_size (EvPreviewerWindow *window)
hsb_requisition.height + scrollbar_spacing);
}
+#if GTKUNIXPRINT_ENABLED
static void
ev_previewer_window_error_dialog_run (EvPreviewerWindow *window,
GError *error)
@@ -120,6 +125,7 @@ ev_previewer_window_error_dialog_run (EvPreviewerWindow *window,
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
+#endif
static void
ev_previewer_window_previous_page (GtkAction *action,
@@ -184,6 +190,7 @@ ev_previewer_window_action_page_activated (GtkAction *action,
gtk_widget_grab_focus (GTK_WIDGET (window->view));
}
+#if GTKUNIXPRINT_ENABLED
static void
ev_previewer_window_print_finished (GtkPrintJob *print_job,
EvPreviewerWindow *window,
@@ -273,6 +280,7 @@ ev_previewer_window_print (GtkAction *action,
(GDestroyNotify)ev_previewer_window_enumerate_finished,
FALSE);
}
+#endif
static const GtkActionEntry action_entries[] = {
{ "GoPreviousPage", GTK_STOCK_GO_UP, N_("_Previous Page"), "<control>Page_Up",
@@ -287,9 +295,11 @@ static const GtkActionEntry action_entries[] = {
{ "ViewZoomOut", GTK_STOCK_ZOOM_OUT, NULL, "<control>minus",
N_("Shrink the document"),
G_CALLBACK (ev_previewer_window_zoom_out) },
+#if GTKUNIXPRINT_ENABLED
{ "PreviewPrint", GTK_STOCK_PRINT, N_("Print"), NULL,
N_("Print this document"),
G_CALLBACK (ev_previewer_window_print) }
+#endif
};
static const GtkToggleActionEntry toggle_action_entries[] = {
@@ -368,10 +378,12 @@ ev_previewer_window_dispose (GObject *object)
window->print_page_setup = NULL;
}
+#if GTKUNIXPRINT_ENABLED
if (window->printer) {
g_object_unref (window->printer);
window->printer = NULL;
}
+#endif
if (window->print_job_title) {
g_free (window->print_job_title);