Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kretzschmar <martink@src.gnome.org>2005-07-25 20:25:15 (GMT)
committer Martin Kretzschmar <martink@src.gnome.org>2005-07-25 20:25:15 (GMT)
commitbfd77d338cda84284c5a01ac7817b0f52caae386 (patch)
tree0bd3b030ea5b4824ae375532b4be0be799cfbecd
parent082a08309e217bcbe1d31622a5eb55dec8475e77 (diff)
(using_pdf_printer): new function.
(ev_window_print_range): print a less techy message if someone tries to print to PDF.
-rw-r--r--ChangeLog6
-rw-r--r--shell/ev-window.c33
2 files changed, 37 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b80c16b..dd93913 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2005-07-25 Martin Kretzschmar <martink@gnome.org>
+ * shell/ev-window.c (using_pdf_printer): new function.
+ (ev_window_print_range): print a less techy message if someone
+ tries to print to PDF.
+
+2005-07-25 Martin Kretzschmar <martink@gnome.org>
+
* pdf/ev-poppler.cc (font_type_to_string): Remove trailing space
from "unknown font" string. Bug #311431
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 1982f8c..ea2cf73 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1252,6 +1252,24 @@ ev_window_cmd_save_as (GtkAction *action, EvWindow *ev_window)
}
static 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;
+}
+
+static gboolean
using_postscript_printer (GnomePrintConfig *config)
{
const guchar *driver;
@@ -1268,7 +1286,7 @@ using_postscript_printer (GnomePrintConfig *config)
return TRUE;
else
return FALSE;
- } else if (transport) {
+ } else if (transport) { /* these transports default to PostScript */
if (!strcmp ((const gchar *)transport, "CUPS"))
return TRUE;
else if (!strcmp ((const gchar *)transport, "LPD"))
@@ -1343,7 +1361,18 @@ ev_window_print_range (EvWindow *ev_window, int first_page, int last_page)
/* FIXME: Change this when we have the first backend
* that can print more than postscript
*/
- if (!using_postscript_printer (config)) {
+ 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);
+
+ continue;
+ } else if (!using_postscript_printer (config)) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (