GNOME Bugzilla – Bug 540282
Store print settings in a key file
Last modified: 2013-09-13 00:59:52 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.
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+.
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.
Adjusting the summary to reflect the larger scope of this bug. The original bug will be fixed as part of this effort.
Created attachment 113752 [details] [review] Proposed patch - Store print settings in a key file. - Honor (and remember) custom print margins.
Matt, you test and go ahead in these.
Tested and committed to trunk (revision 35711).
*** Bug 571372 has been marked as a duplicate of this bug. ***
*** Bug 550598 has been marked as a duplicate of this bug. ***
*** Bug 511742 has been marked as a duplicate of this bug. ***
*** Bug 528364 has been marked as a duplicate of this bug. ***
*** Bug 512210 has been marked as a duplicate of this bug. ***
*** Bug 500573 has been marked as a duplicate of this bug. ***
*** Bug 497327 has been marked as a duplicate of this bug. ***
*** Bug 538266 has been marked as a duplicate of this bug. ***