GNOME Bugzilla – Bug 426816
Clean up printing in Evolution (phase one)
Last modified: 2008-06-22 23:12:28 UTC
This bug tracks the first phase of an effort to clean up printing in Evolution. The goals of the first phase are: - Eliminate Evolution's dependency on libgnomeprint[ui]. - Make the printing code portable again by avoiding GtkPrintUnixDialog. - Refactor the printing infrastructure to better utilize the GtkPrint API. This first phase does NOT focus on rendering issues in the printed output, though it does fix some. In particular, Evolution now honors the user's choice of paper size and print margins. But pagination in emails and contact lists is still broken, and printed calendars still have several text layout issues. Also, printed tabular views, such as the calendar's "list view" or the contact "phone list" view, are still very rudimentary and not very useful. These issues will be dealt with in the second phase. Some random notes: - The e-print API now consists of a single function: GtkPrintOperation * e_print_operation_new (void) The returned GtkPrintOperation is already configured with the custom print settings from GConf. In addition, it will automatically store the print settings after the printing operation has completed. It also handles displaying an error dialog to the user when a printing error has occurred. All the caller has to do is connect to the appropriate "draw" signals and run the operation. - The e-contact-print API has also been reduced to a single function: void e_contact_print (EBook *book, EBookQuery *query, GList *contact_list, GtkPrintOperationAction action) Also, this module uses an "EFlag" for thread synchronization. EFlag is a proposed enhancement to libedataserver (see bug #415891) that simplifies thread synchronization and largely replaces the role of EMsgPort in Evolution (see bug #362638). - The e-contact-print-envelope module is unused and appears to be unfinished. It was developed prior to Evolution 2.0 and hasn't seen much maintenance since. I have disabled the module but preserved most of the GnomePrint-based rendering code for future reference. - calendar/gui/print.c has a lot of modifications to the rendering code but it's all just refactoring with no alterations to the printed output. It was while working on this module that I decided to break the effort into two phases to keep the infrastructure work and the end-user-visible work separated (and to avoid endless nitpicking). So much of those changes are preliminary phase two work.
Created attachment 85881 [details] [review] Proposed patch
*** Bug 425973 has been marked as a duplicate of this bug. ***
Phew! Just went through the patch. It doesn't sound reviewable :) So much of changes. I would suggest to test it out very well before committing. Also we should try the patch on head as early as possible on HEAD. Matthew what do you say?
Srini, thanks for reviewing! I know it was a marathon. It might help to look at extensive changes like this through a graphical diff tool like Meld [1] rather than trying to review the patch directly (assuming that's what you were doing). I recommend applying the patch to a clean Subversion checkout and then using Meld's version control browser to view the differences. In any case, I'll give it a good shakedown before I commit. I agree it's better to get this in early in the development cycle. Better to risk breaking stuff in 2.11.1 than 2.11.91. Does your approval of this patch also imply approval of the EFlag addition to libedataserver (bug #415891), upon which this patch depends? The implementation of EFlag is borderline trivial, but I'm finding uses for it all over the place. [1] http://meld.sourceforge.net/
Matthew, I haven't reviewed the EFlag bug yet. But I will sure give this a try using meld. I reviewed the contacts part, overwhelmed by the amount of changes and thought can I review rest and gave up finally :) I will retry with meld for you :) Also I will see the EFlag stuff along with it.
Matthew, for EFlag you gotto get an review from Varadhan. I tried my best with meld, it seems fine over a review. I didnt test the patch as my system/printer is screwed up. Matthew off to you :)
Committed to Subversion trunk (revision 33440).
*** Bug 451744 has been marked as a duplicate of this bug. ***
I still see some references to gnomeprint as of evo-2.12.3: 1. tools/verify-evolution-install.sh Script looks for a "gnome-print" module. I have no idea what this script is or what uses it. 2. widgets/table/e-cell-vbox.c Two uses of GnomePrintContext type, which is a struct declared in libgnomeprint's headers. Many uses of gnome_print_* functions, which are part of libgnomeprint.
It's all dead code. The script especially -- we should either bring it up-to-date or kill it. I vote for the latter.