+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
gtk_widget_destroy (fc);
}
+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)
{
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"))
/* 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 (