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 748569 - Media Size can't be changed
Media Size can't be changed
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-28 06:29 UTC by Chris Murphy
Modified: 2015-06-12 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove unused function (3.31 KB, patch)
2015-05-22 09:26 UTC, Marek Kašík
committed Details | Review
Fix setting of page size (3.15 KB, patch)
2015-05-22 09:32 UTC, Marek Kašík
none Details | Review
Fix setting of page size (3.67 KB, patch)
2015-06-12 14:09 UTC, Marek Kašík
committed Details | Review

Description Chris Murphy 2015-04-28 06:29:21 UTC
Originally filed as
https://bugzilla.redhat.com/show_bug.cgi?id=1215909

Description of problem: Media Size defaults to Letter, when I try to change it, it snaps back to Letter.

control-center-3.16.1-1.fc22.x86_64

Steps to Reproduce:
1. Add Epson Stylus Pro 3880
2. Click Options
3. Click Media Size > Letter and choose e.g. Super B 13x19

There's no error message in the GUI, which there probably should be if there is in fact some error preventing this. I can change Paper Type. The journal doesn't seem to contain anything useful, but I've included the most recent output at the time of the Media Size change attempt in the Fedora report.
Comment 1 Marek Kašík 2015-05-21 14:35:15 UTC
Thank you for this report.

The base problem here is that CUPS uses 2 systems for storing default settings and I've used one when configuring new printer (IPP - media) and the second one for the setting of paper in Options dialog (PPD - PageSize).
The problem you see is result of this inconsistency.

Another 'problem' is that when we are showing the combo for setting of paper size we open the printer's PPD, mark default options (probably from the PPD) and then mark options taken from the destination (printer). This shows us the IPP setting which we can not change in the dialog.

Ideally we would set paper size in the both system but here is another 'problem'; paper sizes don't have the same names in those systems (e.g. 'na-letter' vs. 'Letter', 'iso-a4' vs. 'A4' and many many others).

I have to think about this a little. But I will probably give higher priority to the PPD because we use it for creating the Options dialog (another thing is that handling of PPDs will be deprecated in CUPS...). This means that I will set 'PageSize' when creating printer instead of 'media' and maybe remove cupsMarkOptions() from PpPPOptionWidget's update function.
Comment 2 Marek Kašík 2015-05-21 14:51:48 UTC
Basically we are reading setting from PPD and overriding it with a IPP version of the same in /etc/printers.conf or in lpoptions files if such exists for given setting in the PpPPDOptionWidget. The PpIPPOptionWidget shows just the IPP and lpoptions setting but we use it for limited set of options now (number-up, sides and orientation-requested).
It then depends on the specific application (or its gui toolkit - gtk+) which option it will use for default value of the setting.
Comment 3 Marek Kašík 2015-05-22 09:26:31 UTC
Created attachment 303803 [details] [review]
Remove unused function
Comment 4 Marek Kašík 2015-05-22 09:32:25 UTC
Created attachment 303804 [details] [review]
Fix setting of page size

This patch sets 'PageSize' instead of 'media' for new printers since we use PPD
for construction of the combo for selecting of default paper size.

It also removes marking of IPP and user's local options as default in PpPPDOptionWidget
since it should use just PPD (we can change PPD values only in this widget).

As I said before, ideal solution would be a joint IPP PPD widget which would set corresponding both IPP-PPD options but this would need a mapping between IPP and PPD options and their values (I'm trying to do something like this in gtk+ but it is not finished yet).
Comment 5 Bastien Nocera 2015-06-12 13:32:22 UTC
Review of attachment 303803 [details] [review]:

Sure.
Comment 6 Bastien Nocera 2015-06-12 13:34:23 UTC
Review of attachment 303804 [details] [review]:

The commit message doesn't explain things to me...
Comment 7 Marek Kašík 2015-06-12 13:50:43 UTC
"Set 'PageSize' instead of 'media' for new printers since we use PPD
for construction of the combo for selecting of default paper size."

 - Previously, we've been setting 'media' attribute for new printers. Attribute 'media' is used by IPP but we set paper size using 'PageSize' which comes from PPD in the options dialog. Sometimes (quite often) IPP gets priority over PPD in print systems. Therefore there was inconsistency of what user set as default paper size on the options dialog and what was used.


Also don't mark IPP and user's local options as default in PpPPDOptionWidget
since it should use just PPD (we can change PPD values only in this widget).

 - Since we use PPD for setting of paper size in the options dialog, we shouldn't show a value which user does not change actually (IPP's 'media' vs. PPD's 'PageSize').


Is it better?
Comment 8 Bastien Nocera 2015-06-12 14:02:38 UTC
Better indeed.
Comment 9 Marek Kašík 2015-06-12 14:09:24 UTC
Created attachment 305149 [details] [review]
Fix setting of page size
Comment 10 Bastien Nocera 2015-06-12 14:11:51 UTC
Review of attachment 305149 [details] [review]:

Looks good.
Comment 11 Marek Kašík 2015-06-12 14:26:55 UTC
Thank you for the reviews, I've pushed the patches to 3.16 and master branches.