]> Pileus Git - ~andy/gtk/commitdiff
Add a GTK_PRINT_CAPABILITY_GENERATE_PDF capability.
authorMatthias Clasen <mclasen@redhat.com>
Mon, 12 Jun 2006 16:47:41 +0000 (16:47 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 12 Jun 2006 16:47:41 +0000 (16:47 +0000)
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)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkprintjob.h
gtk/gtkprintunixdialog.c

index 76fb6a37a865ed2b1a6d46826627564d465d61a7..ea933f3f813f1389f6f95d232cc863e7b9e010ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
 
index 76fb6a37a865ed2b1a6d46826627564d465d61a7..ea933f3f813f1389f6f95d232cc863e7b9e010ff 100644 (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)
 
index 3b169af00abc9c265f0cd2ce54af95d91f21083b..758fa5387c9980e506df72b79f00bc9861af1438 100644 (file)
@@ -36,11 +36,12 @@ G_BEGIN_DECLS
 
 typedef enum
 {
-  GTK_PRINT_CAPABILITY_PAGE_SET = 1 << 0,
-  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_PAGE_SET     = 1 << 0,
+  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_GENERATE_PDF = 1 << 5
 } GtkPrintCapabilities;
 
 typedef struct _GtkPrintJob          GtkPrintJob;
index b561df569f85825538f254782fe9bcf9ca66c040..dc532b0554f6a16b81311cd5662f35354ae28a6b 100644 (file)
@@ -571,6 +571,7 @@ is_printer_active (GtkTreeModel       *model,
 {
   gboolean result;
   GtkPrinter *printer;
+  GtkPrintUnixDialogPrivate *priv = dialog->priv;
 
   gtk_tree_model_get (model,
                      iter,
@@ -582,6 +583,17 @@ is_printer_active (GtkTreeModel       *model,
     return FALSE;
 
   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);
 
@@ -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
@@ -2730,8 +2744,8 @@ gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
  * Since: 2.10
  */
 void
-gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog *dialog,
-                                              GtkPrintCapabilities capabilities)
+gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog   *dialog,
+                                              GtkPrintCapabilities  capabilities)
 {
   dialog->priv->manual_capabilities = capabilities;
   update_dialog_from_capabilities (dialog);