summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Farley <sean+dev@farley.org>2018-11-17 13:04:35 -0500
committerSean Farley <sean+dev@farley.org>2018-11-17 13:04:35 -0500
commit99dfdfcd5e125f5c5ff501a8dc23353ecf90831e (patch)
treeeff3dc34f7af626855c807ef8b393f5672593281
parent55faaf1aa194142d6de4f46bee80e80f99a9cbd8 (diff)
downloadgtk+-99dfdfcd5e125f5c5ff501a8dc23353ecf90831e.tar.gz
Allow LPR backend to print PDF and PS file formats
At least from GTK v3.22.30, the code disallows attempts to print PDF and PS files using the LPR backend. Although it is not easy or possible for GTK to determine if the printer can print these formats by querying lpr, the print backend should allow lpr to try. There are two uses cases: - A filter is being used by lpr, specified in the printcap file, to process the files prior to printing them. - The printer can print PDF and PS files directly. There are many printers that can print these formats, so GTK should allow for the possibility.
-rw-r--r--modules/printbackends/gtkprintbackendlpr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/printbackends/gtkprintbackendlpr.c b/modules/printbackends/gtkprintbackendlpr.c
index aefa921515..af1e101124 100644
--- a/modules/printbackends/gtkprintbackendlpr.c
+++ b/modules/printbackends/gtkprintbackendlpr.c
@@ -375,9 +375,13 @@ gtk_print_backend_lpr_init (GtkPrintBackendLpr *backend)
{
GtkPrinter *printer;
- printer = gtk_printer_new (_("Print to LPR"),
- GTK_PRINT_BACKEND (backend),
- TRUE);
+ printer = g_object_new (GTK_TYPE_PRINTER,
+ "name", _("Print to LPR"),
+ "backend", backend,
+ "is-virtual", FALSE,
+ "accepts-pdf", TRUE,
+ "accepts-ps", TRUE,
+ NULL);
gtk_printer_set_has_details (printer, TRUE);
gtk_printer_set_icon_name (printer, "printer");
gtk_printer_set_is_active (printer, TRUE);