summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2007-05-28 10:41:09 +0000
committerCarlos Garcia Campos <carlosgc@src.gnome.org>2007-05-28 10:41:09 +0000
commiteb7f97bb9bda3daf3b09f3035f10f6719749e69f (patch)
tree2a5306e0dd380c6349174dd910f41cdc2c8cd527 /modules
parente95f511143dc2c29ab13be04ed366047e1a4545d (diff)
downloadgtk+-eb7f97bb9bda3daf3b09f3035f10f6719749e69f.tar.gz
Add new capability GTK_PRINT_CAPABILITY_NUMBER_UP.
2007-05-28 Carlos Garcia Campos <carlosgc@gnome.org> * gtk/gtkprinter.[ch]: Add new capability GTK_PRINT_CAPABILITY_NUMBER_UP. * docs/reference/gtk/tmpl/gtkprintunixdialog.sgml: * gtk/gtkprintunixdialog.c: (update_dialog_from_capabilities): * modules/printbackends/file/gtkprintbackendfile.c: (file_printer_get_options), (file_printer_get_settings_from_options): * modules/printbackends/cups/gtkprintbackendcups.c: (cups_printer_get_capabilities): Add a new print capability to specify whether print dialog will offer printing multiple pages per sheet. (#398414) svn path=/trunk/; revision=17963
Diffstat (limited to 'modules')
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c3
-rw-r--r--modules/printbackends/file/gtkprintbackendfile.c15
2 files changed, 14 insertions, 4 deletions
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index fe8f8652e2..f4108f56ec 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -2875,5 +2875,6 @@ cups_printer_get_capabilities (GtkPrinter *printer)
return
GTK_PRINT_CAPABILITY_COPIES |
GTK_PRINT_CAPABILITY_COLLATE |
- GTK_PRINT_CAPABILITY_REVERSE;
+ GTK_PRINT_CAPABILITY_REVERSE |
+ GTK_PRINT_CAPABILITY_NUMBER_UP;
}
diff --git a/modules/printbackends/file/gtkprintbackendfile.c b/modules/printbackends/file/gtkprintbackendfile.c
index c596aec0b8..6356c8d4d9 100644
--- a/modules/printbackends/file/gtkprintbackendfile.c
+++ b/modules/printbackends/file/gtkprintbackendfile.c
@@ -480,7 +480,8 @@ file_printer_get_options (GtkPrinter *printer,
{
GtkPrinterOptionSet *set;
GtkPrinterOption *option;
- const gchar *n_up[] = { "1" };
+ const gchar *n_up[] = {"1", "2", "4", "6", "9", "16" };
+ const gchar *pages_per_sheet = NULL;
const gchar *format_names[N_FORMATS] = { N_("PDF"), N_("Postscript") };
const gchar *supported_formats[N_FORMATS];
gchar *display_format_names[N_FORMATS];
@@ -496,7 +497,12 @@ file_printer_get_options (GtkPrinter *printer,
option = gtk_printer_option_new ("gtk-n-up", _("Pages per _sheet:"), GTK_PRINTER_OPTION_TYPE_PICKONE);
gtk_printer_option_choices_from_array (option, G_N_ELEMENTS (n_up),
(char **) n_up, (char **) n_up /* FIXME i18n (localised digits)! */);
- gtk_printer_option_set (option, "1");
+ if (settings)
+ pages_per_sheet = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_NUMBER_UP);
+ if (pages_per_sheet)
+ gtk_printer_option_set (option, pages_per_sheet);
+ else
+ gtk_printer_option_set (option, "1");
gtk_printer_option_set_add (set, option);
g_object_unref (option);
@@ -572,7 +578,10 @@ file_printer_get_settings_from_options (GtkPrinter *printer,
option = gtk_printer_option_set_lookup (options, "output-file-format");
if (option)
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT, option->value);
-
+
+ option = gtk_printer_option_set_lookup (options, "gtk-n-up");
+ if (option)
+ gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_NUMBER_UP, option->value);
}
static void