summaryrefslogtreecommitdiff
path: root/gtk/gtkprintunixdialog.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-06-19 04:21:22 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-06-19 04:21:22 +0000
commit2858512ebe4cc157e87904051d7cd0dbd6578a4a (patch)
treecc727b39a5b9deba520a005f653a7d37e9650947 /gtk/gtkprintunixdialog.c
parentfaef652d370e435c5d5a3aba50cf45e7560ce935 (diff)
downloadgtk+-2858512ebe4cc157e87904051d7cd0dbd6578a4a.tar.gz
Add a GENERATE_PS capability. And use it here.
2006-06-19 Matthias Clasen <mclasen@redhat.com> * gtk/gtkprintjob.h: Add a GENERATE_PS capability. * gtk/gtkprintunixdialog.c (is_printer_active): And use it here.
Diffstat (limited to 'gtk/gtkprintunixdialog.c')
-rw-r--r--gtk/gtkprintunixdialog.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index b81de906db..ee10433e06 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -573,10 +573,17 @@ is_printer_active (GtkTreeModel *model,
result = gtk_printer_is_active (printer);
- if (result)
+ if (result &&
+ priv->manual_capabilities & (GTK_PRINT_CAPABILITY_GENERATE_PDF |
+ GTK_PRINT_CAPABILITY_GENERATE_PS))
{
- if ((priv->manual_capabilities & GTK_PRINT_CAPABILITY_GENERATE_PDF) == 0)
- result = gtk_printer_accepts_ps (printer);
+ /* Check that the printer can handle at least one of the data
+ * formats that the application supports.
+ */
+ result = ((priv->manual_capabilities & GTK_PRINT_CAPABILITY_GENERATE_PDF) &&
+ gtk_printer_accepts_pdf (printer)) ||
+ ((priv->manual_capabilities & GTK_PRINT_CAPABILITY_GENERATE_PS) &&
+ gtk_printer_accepts_ps (printer));
}
g_object_unref (printer);
@@ -1148,7 +1155,7 @@ clear_per_printer_ui (GtkPrintUnixDialog *dialog)
gtk_container_foreach (GTK_CONTAINER (priv->advanced_vbox),
(GtkCallback)gtk_widget_destroy,
NULL);
- extension_point_clear_children (priv->extension_point);
+ extension_point_clear_children (GTK_CONTAINER (priv->extension_point));
}
static void
@@ -1244,7 +1251,7 @@ selected_printer_changed (GtkTreeSelection *selection,
{
priv->printer_capabilities = _gtk_printer_get_capabilities (printer);
priv->options = _gtk_printer_get_options (printer, priv->initial_settings,
- priv->page_setup);
+ priv->page_setup);
priv->options_changed_handler =
g_signal_connect_swapped (priv->options, "changed", G_CALLBACK (options_changed_cb), dialog);