Add a GTK_PRINT_CAPABILITY_GENERATE_PDF capability.

2006-06-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkprintjob.h: Add a GTK_PRINT_CAPABILITY_GENERATE_PDF
	capability.

	* gtk/gtkprintunixdialog.c: Use it here to hide "Print to PDF"
	from the printer list.  (#339592, Christian Persch)
This commit is contained in:
Matthias Clasen 2006-06-12 16:47:41 +00:00 committed by Matthias Clasen
parent 8d22851ae6
commit c6d1d9dd01
4 changed files with 34 additions and 7 deletions

View File

@ -1,5 +1,11 @@
2006-06-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintjob.h: Add a GTK_PRINT_CAPABILITY_GENERATE_PDF
capability.
* gtk/gtkprintunixdialog.c: Use it here to hide "Print to PDF"
from the printer list. (#339592, Christian Persch)
* gtk/gtkfilechooserdefault.c: Add support for pasting
filenames into the filechooser. (#153212, Bastian Nocera)

View File

@ -1,5 +1,11 @@
2006-06-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintjob.h: Add a GTK_PRINT_CAPABILITY_GENERATE_PDF
capability.
* gtk/gtkprintunixdialog.c: Use it here to hide "Print to PDF"
from the printer list. (#339592, Christian Persch)
* gtk/gtkfilechooserdefault.c: Add support for pasting
filenames into the filechooser. (#153212, Bastian Nocera)

View File

@ -40,7 +40,8 @@ typedef enum
GTK_PRINT_CAPABILITY_COPIES = 1 << 1,
GTK_PRINT_CAPABILITY_COLLATE = 1 << 2,
GTK_PRINT_CAPABILITY_REVERSE = 1 << 3,
GTK_PRINT_CAPABILITY_SCALE = 1 << 4
GTK_PRINT_CAPABILITY_SCALE = 1 << 4,
GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5
} GtkPrintCapabilities;
typedef struct _GtkPrintJob GtkPrintJob;

View File

@ -571,6 +571,7 @@ is_printer_active (GtkTreeModel *model,
{
gboolean result;
GtkPrinter *printer;
GtkPrintUnixDialogPrivate *priv = dialog->priv;
gtk_tree_model_get (model,
iter,
@ -583,6 +584,17 @@ is_printer_active (GtkTreeModel *model,
result = gtk_printer_is_active (printer);
if (result)
{
/* FIXME needs some printer capabilities
*/
if ((priv->manual_capabilities & GTK_PRINT_CAPABILITY_GENERATE_PDF) == 0 &&
strcmp (gtk_printer_get_name (printer), _("Print to PDF")) == 0)
result = FALSE;
g_print ("testing printer \"%s\" result %d\n",
gtk_printer_get_name (printer), result);
}
g_object_unref (printer);
return result;
@ -1038,6 +1050,8 @@ update_dialog_from_capabilities (GtkPrintUnixDialog *dialog)
caps & GTK_PRINT_CAPABILITY_PAGE_SET);
update_collate_icon (NULL, dialog);
gtk_tree_model_filter_refilter (priv->printer_list_filter);
}
static void