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 426816 - Clean up printing in Evolution (phase one)
Clean up printing in Evolution (phase one)
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
2.10.x (obsolete)
Other Linux
: Normal enhancement
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
: 425973 451744 (view as bug list)
Depends on: 415891
Blocks:
 
 
Reported: 2007-04-06 04:53 UTC by Matthew Barnes
Modified: 2008-06-22 23:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (182.26 KB, patch)
2007-04-06 04:54 UTC, Matthew Barnes
reviewed Details | Review

Description Matthew Barnes 2007-04-06 04:53:08 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.
Comment 1 Matthew Barnes 2007-04-06 04:54:30 UTC
Created attachment 85881 [details] [review]
Proposed patch
Comment 2 André Klapper 2007-04-11 14:42:55 UTC
*** Bug 425973 has been marked as a duplicate of this bug. ***
Comment 3 Srinivasa Ragavan 2007-04-13 10:21:51 UTC
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?
Comment 4 Matthew Barnes 2007-04-13 14:04:34 UTC
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/
Comment 5 Srinivasa Ragavan 2007-04-13 17:05:48 UTC
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.
Comment 6 Srinivasa Ragavan 2007-04-16 06:36:46 UTC
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 :)
Comment 7 Matthew Barnes 2007-04-20 07:03:18 UTC
Committed to Subversion trunk (revision 33440).
Comment 8 C de-Avillez 2007-06-28 14:46:27 UTC
*** Bug 451744 has been marked as a duplicate of this bug. ***
Comment 9 Daniel Macks 2008-06-22 22:51:28 UTC
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.



Comment 10 Matthew Barnes 2008-06-22 23:12:28 UTC
It's all dead code.  The script especially -- we should either bring it up-to-date or kill it.  I vote for the latter.