GNOME Bugzilla – Bug 672695
Set correct paper size for new printer
Last modified: 2012-04-13 12:18:13 UTC
Created attachment 210431 [details] [review] patch setting paper size correctly Current gnome-settings-daemon doesn't set correct paper size according to locale for new printers (it always sets Letter). With new cups-pk-helper-0.2.2 it is possible to set it correctly using new method PrinterAddOption (by setting option "media" to "iso-a4" or "na-letter"). Attached patch uses this new method and sets correct paper size. Marek
Created attachment 210432 [details] [review] the same patch with ignore spaces turned on
Review of attachment 210432 [details] [review]: So the surrounding code looks very similar to the control-center code in bug 672694. is there a reason you didn't make both patches "look" the same?
(In reply to comment #2) > So the surrounding code looks very similar to the control-center code in bug > 672694. is there a reason you didn't make both patches "look" the same? Because there is no function dbus_method_available() in g-s-d, so i just call the method and detect whether there is an error and check the type of the error.
Created attachment 210615 [details] [review] patch setting media size correctly This patch doesn't use the old way the g-s-d set paper size. It just uses the new method and does nothing if it is not present.
Created attachment 210616 [details] [review] the same patch with ignore spaces turned on
Review of attachment 210616 [details] [review]: ::: plugins/print-notifications/gsd-printer.c @@ +765,2 @@ builder = g_variant_builder_new (G_VARIANT_TYPE ("as")); + if (g_str_equal (gtk_paper_size_get_default (), GTK_PAPER_NAME_LETTER)) Split out in another function too.
Actually, setting of default paper size is already done in separate function in gnome-settings-daemon. Or do you want to split this specific if() ?
(In reply to comment #7) > Actually, setting of default paper size is already done in separate function in > gnome-settings-daemon. Or do you want to split this specific if() ? I'd like a separate function so that you can do: bleh = get_default_paper_size (); and bleh is already in the format that CUPS expects.
Comment on attachment 210616 [details] [review] the same patch with ignore spaces turned on I've committed the patch with the change you wanted. Regards Marek