After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 672695 - Set correct paper size for new printer
Set correct paper size for new printer
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: printers
3.3.x
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-03-23 14:27 UTC by Marek Kašík
Modified: 2012-04-13 12:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch setting paper size correctly (8.22 KB, patch)
2012-03-23 14:27 UTC, Marek Kašík
none Details | Review
the same patch with ignore spaces turned on (3.04 KB, patch)
2012-03-23 14:28 UTC, Marek Kašík
none Details | Review
patch setting media size correctly (5.14 KB, patch)
2012-03-26 11:37 UTC, Marek Kašík
none Details | Review
the same patch with ignore spaces turned on (4.44 KB, patch)
2012-03-26 11:37 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2012-03-23 14:27:40 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
Comment 1 Marek Kašík 2012-03-23 14:28:03 UTC
Created attachment 210432 [details] [review]
the same patch with ignore spaces turned on
Comment 2 Ray Strode [halfline] 2012-03-23 21:13:13 UTC
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?
Comment 3 Marek Kašík 2012-03-24 19:55:17 UTC
(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.
Comment 4 Marek Kašík 2012-03-26 11:37:03 UTC
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.
Comment 5 Marek Kašík 2012-03-26 11:37:39 UTC
Created attachment 210616 [details] [review]
the same patch with ignore spaces turned on
Comment 6 Bastien Nocera 2012-04-12 12:47:00 UTC
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.
Comment 7 Marek Kašík 2012-04-12 14:41:02 UTC
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() ?
Comment 8 Bastien Nocera 2012-04-12 15:01:28 UTC
(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 9 Marek Kašík 2012-04-13 12:17:59 UTC
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