RH bug 204621 - "GtkPrint" asks for "Letter" size paper when "A4" size
was chosen
Patch by Marek Kasik.
* gtk/gtk.symbols:
* gtk/gtkprinter.[hc]: Add gtk_printer_get_default_page_size.
* gtk/gtkprintbackend.[hc]: Add fallback implementation.
* modules/printbackends/file/gtkprintbackendfile.c:
* modules/printbackends/cups/gtkprintbackendcups.c: Implement
get_default_page_size.
* gtk/gtkpagesetupunixdialog.c: When selecting a different printer,
select its default paper size.
* gtk/gtkprintunixdialog.c: If no explicit page setup has been set,
use the printer default.
* gtk/gtkprintoperation-unix.c: Don't create an empty page setup
if we don't have a default page setup.
svn path=/trunk/; revision=20120
This commit is contained in:
@ -349,7 +349,6 @@ get_print_dialog (GtkPrintOperation *op,
|
||||
{
|
||||
GtkPrintOperationPrivate *priv = op->priv;
|
||||
GtkWidget *pd, *label;
|
||||
GtkPageSetup *page_setup;
|
||||
const gchar *custom_tab_label;
|
||||
|
||||
pd = gtk_print_unix_dialog_new (NULL, parent);
|
||||
@ -366,13 +365,8 @@ get_print_dialog (GtkPrintOperation *op,
|
||||
gtk_print_unix_dialog_set_settings (GTK_PRINT_UNIX_DIALOG (pd),
|
||||
priv->print_settings);
|
||||
if (priv->default_page_setup)
|
||||
page_setup = gtk_page_setup_copy (priv->default_page_setup);
|
||||
else
|
||||
page_setup = gtk_page_setup_new ();
|
||||
|
||||
gtk_print_unix_dialog_set_page_setup (GTK_PRINT_UNIX_DIALOG (pd),
|
||||
page_setup);
|
||||
g_object_unref (page_setup);
|
||||
gtk_print_unix_dialog_set_page_setup (GTK_PRINT_UNIX_DIALOG (pd),
|
||||
priv->default_page_setup);
|
||||
|
||||
g_signal_emit_by_name (op, "create-custom-widget",
|
||||
&priv->custom_widget);
|
||||
@ -432,6 +426,10 @@ finish_print (PrintResponseData *rdata,
|
||||
{
|
||||
gtk_print_operation_set_print_settings (op, settings);
|
||||
priv->print_context = _gtk_print_context_new (op);
|
||||
|
||||
if ( (page_setup != NULL) && (gtk_print_operation_get_default_page_setup (op) == NULL))
|
||||
gtk_print_operation_set_default_page_setup (op, page_setup);
|
||||
|
||||
_gtk_print_context_set_page_setup (priv->print_context, page_setup);
|
||||
|
||||
if (!rdata->do_preview)
|
||||
|
||||
Reference in New Issue
Block a user