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 540282 - Store print settings in a key file
Store print settings in a key file
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
2.24.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
: 497327 500573 511742 512210 528364 538266 550598 571372 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-06-26 09:03 UTC by Glenn Sommer
Modified: 2013-09-13 00:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Proposed patch (7.67 KB, patch)
2008-07-01 03:49 UTC, Matthew Barnes
committed Details | Review

Description Glenn Sommer 2008-06-26 09:03:29 UTC
Please describe the problem:
The default margin in always used - even though a much larger custom margin is set.
Both the print and print preview use a fixed margin.

Steps to reproduce:
1. Select the mail you want to print in Evolution
2. File -> Page Setup...
3. Under "Paper size:" select "Manage Custom Sizes..."
4. Create a custom size with a large left margin (In this case I've used 60mm)
5. Click Close.
6. Under "Paper size:" select "custom" (Or whatever you called the custom size)
7. Click Apply.
8. File -> Print Preview.



Actual results:
When following those steps, the custom margin is not used at all.

Expected results:
The expected result would be a print preview using the correct custom margins.

Does this happen every time?
Yes

Other information:
The print preview and the actual print looks exactly the same - there's no difference there at all.
Comment 1 Matthew Barnes 2008-06-30 20:18:16 UTC
Strange.  Can't yet tell if this is a GtkPrint bug.

When the Page Setup dialog closes, we get back a GtkPageSetup object containing the user's custom settings.  From that we extract the orientation and paper size and copy it to the GtkPrintSettings object that we use for print operations.

I thought margins were part of the GtkPaperSize object, but maybe it doesn't include custom margins.  What's strange is the GtkSettings API doesn't include any "set_margin" functions, so I may have to use gtk_print_settings_set_double() and dig up the correct key name strings for margins (hopefully the names are the same for all print backends, else we're screwed).

If my analysis is correct, it seems like an oversight in GTK+.
Comment 2 Matthew Barnes 2008-07-01 01:44:19 UTC
After further reading, I learned that I was making some bad assumptions about GtkPageSetup.  We really need to be storing both it /and/ GtkPrintSettings.

Rather than add a new GConf key for page setup, I think I'm going to use this as an opportunity to migrate Evolution over to GtkPrint's shiny new keyfile-based API in GTK+ 2.12.  So print settings will move to ~/.evolution/printing as a human-readable key file.  Much cleaner than trying to cram it into GConf.

I don't see a strong need to migrate the old settings either.
Comment 3 Matthew Barnes 2008-07-01 01:46:10 UTC
Adjusting the summary to reflect the larger scope of this bug.  The original bug will be fixed as part of this effort.
Comment 4 Matthew Barnes 2008-07-01 03:49:57 UTC
Created attachment 113752 [details] [review]
Proposed patch

- Store print settings in a key file.
- Honor (and remember) custom print margins.
Comment 5 Srinivasa Ragavan 2008-07-01 09:49:50 UTC
Matt, you test and go ahead in these. 
Comment 6 Matthew Barnes 2008-07-01 14:10:05 UTC
Tested and committed to trunk (revision 35711).
Comment 7 Matthew Barnes 2009-02-17 02:12:47 UTC
*** Bug 571372 has been marked as a duplicate of this bug. ***
Comment 8 Matthew Barnes 2009-02-17 02:21:27 UTC
*** Bug 550598 has been marked as a duplicate of this bug. ***
Comment 9 Matthew Barnes 2009-02-17 02:28:12 UTC
*** Bug 511742 has been marked as a duplicate of this bug. ***
Comment 10 Matthew Barnes 2009-02-17 03:03:01 UTC
*** Bug 528364 has been marked as a duplicate of this bug. ***
Comment 11 Matthew Barnes 2009-02-17 03:07:50 UTC
*** Bug 512210 has been marked as a duplicate of this bug. ***
Comment 12 Matthew Barnes 2009-02-17 03:13:05 UTC
*** Bug 500573 has been marked as a duplicate of this bug. ***
Comment 13 Matthew Barnes 2009-02-17 03:16:10 UTC
*** Bug 497327 has been marked as a duplicate of this bug. ***
Comment 14 Milan Crha 2010-11-02 08:13:44 UTC
*** Bug 538266 has been marked as a duplicate of this bug. ***