Commit Graph

50 Commits

Author SHA1 Message Date
Milan Crha a4af2d6aee Postscript attachments not shown in message preview
The application/postscript mime type had been handled by the text-hightlight
module, but thinking of it, it doesn't make much sense, because most users
would prefer to see the content rather in a postscript viewer, than
the source of the postscript file, thus this change removes the mime type
from the text-hightlight module. There had been also issues about thinking
that certain parts had been handled, while they did not, which this change
fixes as well.

The issue had been reported downstream at:
https://bugzilla.redhat.com/show_bug.cgi?id=1187327
2015-02-09 18:08:29 +01:00
Christian Schaarschmidt 5130f2110e Bug 606239 - Better indication of signed and/or encrypted received email 2015-02-06 10:21:12 +01:00
Milan Crha 59e2efa774 Share GSettings objects with e_util_ref_settings()
A simple Evolution run and move between all views means creation of
more than 100 GSettings objects, with only a bit more than 10 schemas.
Reusing the objects should have a positive impact on a performance too.
2014-11-13 10:06:04 +01:00
Milan Crha b10ef4f272 Bug 724909 - Highlight module hangs on large attachments 2014-09-09 13:25:18 +02:00
Tomas Popela 8650fb139a Bug 540362: [webkit-composer] Use webkit for composer
Merge wip/webkit-composer branch into master.
2014-06-09 16:32:25 +02:00
Milan Crha a2a2954926 [text-highlight] Fix a possible memory leak
The related part of the code could be reached also when the 'syntax' variable
had been previously set to a newly allocated string, thus (try to) free it first.
2014-03-26 10:38:34 +01:00
Milan Crha 8692b1cb72 Add an --enable-code-coverage configure option to enable gcov support
When enabled, this will compile all libraries/binaries with the necessary
gcc and ld flags to enable code coverage support using gcov.
2014-03-25 12:04:58 +01:00
Matthew Barnes f4bb7d7748 EMailFormatter: Use GOutputStream instead of CamelStream. 2014-02-28 14:38:11 -05:00
Matthew Barnes e15c81b8ee Bug 724909 - Highlight module hangs on large attachments
The previous code was writing the entire MIME part content to the
highlight utility's stdin pipe before reading the converted result.
With enough content, this caused the write operation to get stuck.
What's worse is this all happens synchronously in the UI thread.

Not sure exactly what was going on, but my hunch proved correct that
we need to simultaneously write to the stdin pipe and read from the
stdout pipe to avoid the deadlock.

Still not happy about this blocking the UI, but that would require
some major refactoring in libevolution-mail-formatter.
2014-02-24 22:57:52 -05:00
Matthew Barnes b21733d067 Bug 721545 - License text contains obsolete FSF postal address 2014-01-07 16:05:51 -05:00
Matthew Barnes 169ec754ae Bug 708390 - text-highlight: Don't interfere with printing
The text-highlight module is for enhancing the *display* of textual
email parts.  It should not interfere at all when printing an email.
2013-09-30 15:39:45 -04:00
Tomas Popela 68f27ce0c8 Bug #706008 - Workaround gnome-shell style change on focus change
Avoid redrawing (thus loosing the selection and scroll position) of
preview window on style change by defining the colors through CSS styles.
On style change we just update the CSS color definitions and preview will
update itself without redraw.
2013-09-12 15:29:58 +02:00
Matthew Barnes 04aa0fba1f Rename libemformat to libevolution-mail-formatter.
To make Evolution's shared libraries more consistent.

Also add an evolution-mail-formatter documentation module.
2013-05-28 09:56:30 -04:00
Matthew Barnes 70a9fcdf9c Rename libeshell to libevolution-shell.
To make Evolution's shared libraries more consistent.

Also rename the documentation module to evolution-shell.
2013-05-28 09:56:30 -04:00
Matthew Barnes 6c9a3243c9 Rename libeutil to libevolution-util.
To make Evolution's shared libraries more consistent.

Also rename the documentation module to evolution-util.
2013-05-28 09:56:30 -04:00
Matthew Barnes f19058ea7a Add e_mail_part_ref_mime_part(). 2013-05-19 13:07:20 -04:00
Matthew Barnes c025ffbb29 Add e_mail_part_get_id(). 2013-05-19 13:07:20 -04:00
Matthew Barnes cd5a55f981 em-format cleanups. 2013-05-19 13:07:20 -04:00
Milan Crha b064d64be7 [EMailFormatter] Use GdkRGBA and GtkStyleContext to get theme colors
It could happen that header text color had been picked white one time,
but the other time black as expected (for me usually when I started
Evolution in Calendar and moved to Mail view, the header text color
was white, while when starting in Mail view it was black). The change
to use GtkStyleContext is there only as a cleanup from deprecated
GtkStyle, and to make things easier too, because both GtkStyle
and the GtkStyleContext had set white color for some reason.
2013-04-23 14:59:09 +02:00
Matthew Barnes 2e87aa81fc Remove EMailShellSettings.
EShellSettings predates GSettings and is no longer necessary.

GSettings allows binding GObject properties to GSettings keys,
with optional mapping functions.  That fulfills the purpose of
EShellSettings.
2013-03-17 08:49:12 -04:00
Matthew Barnes c5fae912d1 Use CamelMimeFilterToHTMLFlags enum type where appropriate. 2013-02-06 13:16:40 -05:00
Matthew Barnes 9a0b1266b5 Teach EMailExtensionRegistry to find extensions.
Restore this commit with a proper bug fix to follow.
2013-02-01 08:44:50 -05:00
Milan Crha 57adde4be6 Revert "Teach EMailExtensionRegistry to find extensions."
This reverts commit bf30024dd7, because
it breaks EMailFormatter/Parser extensions, like the prefer-plain.
The thing is that the internal formatters/parsers (also extensions)
should be always added first, and only after then can be added extended
extensions, which are used before those internal. This constraint was not
satisfied with the reverted commit, the order of extension registration
was unpredictable, depended on GType.
2013-01-29 16:31:58 +01:00
Milan Crha 722a27e850 Bug #692005 - Changing character encoding doesn't work 2013-01-18 18:34:56 +01:00
Matthew Barnes 7f93dcab4d Bug 691133 - Evolution creates 'highlight' zombies
Evolution spawns the 'highlight' program with these flags:

    G_SPAWN_SEARCH_PATH
    G_SPAWN_DO_NOT_REAP_CHILD

G_SPAWN_SEARCH_PATH is not needed because configure already determines
the absolute path to the 'highlight' program.  G_SPAWN_DO_NOT_REAP_CHILD
results in zombie 'highlight' processes.  Remove both flags.
2013-01-04 10:45:17 -05:00
Matthew Barnes bed06d9ec3 Move the contact map widgets to addressbook/gui/widgets.
Move the supporting widgets for the contact maps feature alongside
EABContactDisplay.  Removing them from libeutil helps isolate our usage
of libchamplain so it's not imposed on the entire application, and even
3rd party software.  That libchamplain is an optional dependency only
further complicates the matter.

Ideally I'd like to somehow isolate this feature in an extension module,
but we currently lack sufficient hooks for such an extension.  So this
arrangement will have to suffice for now.
2012-12-12 14:33:47 -05:00
Matthew Barnes d09d8de870 Consolidate base utility libraries into libeutil.
Evolution consists of entirely too many small utility libraries, which
increases linking and loading time, places a burden on higher layers of
the application (e.g. modules) which has to remember to link to all the
small in-tree utility libraries, and makes it difficult to generate API
documentation for these utility libraries in one Gtk-Doc module.

Merge the following utility libraries under the umbrella of libeutil,
and enforce a single-include policy on libeutil so we can reorganize
the files as desired without disrupting its pseudo-public API.

   libemail-utils/libemail-utils.la
   libevolution-utils/libevolution-utils.la
   filter/libfilter.la
   widgets/e-timezone-dialog/libetimezonedialog.la
   widgets/menus/libmenus.la
   widgets/misc/libemiscwidgets.la
   widgets/table/libetable.la
   widgets/text/libetext.la

This also merges libedataserverui from the Evolution-Data-Server module,
since Evolution is its only consumer nowadays, and I'd like to make some
improvements to those APIs without concern for backward-compatibility.

And finally, start a Gtk-Doc module for libeutil.  It's going to be a
project just getting all the symbols _listed_ much less _documented_.
But the skeletal structure is in place and I'm off to a good start.
2012-12-12 14:33:43 -05:00
Matthew Barnes bf30024dd7 Teach EMailExtensionRegistry to find extensions.
Now we have the following extension points in the GType hierarchy:

   E_TYPE_MAIL_FORMATTER_EXTENSION
   E_TYPE_MAIL_FORMATTER_PRINT_EXTENSION
   E_TYPE_MAIL_FORMATTER_QUOTE_EXTENSION
   E_TYPE_MAIL_PARSER_EXTENSION

A registry just needs to be given one of these extension points, and it
can use g_type_children() to find and load all registered extensions.

This eliminates e-mail-format-extensions.[ch] as well as the dynamic
loaders I added a few commits back.  Dynamically loaded extensions are
now easier to register, at the cost of internal extensions being a tad
more cumbersome to register.  Fair tradeoff, imo.

This also makes e_mail_extension_registry_add_extension() a private
function used only by e_mail_formatter_extension_registry_load() and
e_mail_parser_extension_registry_load().
2012-12-07 17:40:28 -05:00
Matthew Barnes cab6eac8f1 Convert EMailParserExtension to an abstract class.
With the previous changes, all parser extensions derive from
GObjectClass and implement the EMailParserExtensionInterface.

Simplify things further by making EMailParserExtension an abstract base
class so parser extensions are now just direct subclasses and need not
bother with implementing GObject interfaces.
2012-12-07 14:01:05 -05:00
Matthew Barnes d9699159f0 EMailFormatterExtension: Convert get_description() to a string field.
Of the formatter extensions that provide a description, they all use a
static string.  So we don't need an instance of the extension to obtain
its description.  Just make it a string field in the class structure.
2012-12-07 14:01:05 -05:00
Matthew Barnes 7885426c2b EMailFormatterExtension: Convert get_display_name() to a string field.
Of the formatter extensions that provide a display name, they all use a
static string.  So we don't need an instance of the extension to obtain
its display name.  Just make it a string field in the class structure.
2012-12-07 14:01:05 -05:00
Matthew Barnes 00b211b0f5 Convert EMailFormatterExtension to an abstract class.
With the previous changes, all formatter extensions derive from
GObjectClass and implement the EMailFormatterExtensionInterface.

Simplify things further by making EMailFormatterExtension an abstract
base class so formatter extensions are now just direct subclasses and
need not bother with implementing GObject interfaces.
2012-12-07 14:01:05 -05:00
Matthew Barnes 54455ca1ad Remove EMailExtension.
EMailExtension is now too trivial to keep as a standalone interface.
Add a 'mime_types' string array to the EMailFormatterExtension and
EMailFormatterParser interface structs.

Alter e_mail_extension_registry_add_extension() to take a 'mime_types'
string array and the GType of an extension to instantiate, rather than
the extension instance directly.

e_mail_extension_registry_remove_extension() is no longer needed.
2012-12-07 14:01:05 -05:00
Matthew Barnes 9d34f72ec1 EMailExtension: Replace mime_types() method with a string array.
In all implementations for EMailExtension, the MIME type list is a
static string array -- with the single exception of the text-highlight
module, where the MIME type list is dynamically assembled once.

Replace the mime_types() method with a "mime_types" string array in the
EMailExtensionInterface struct.  Then the list of MIME types supported
by the class implementing the EMailExtensionInterface can be obtained
without requiring an instance of the class.
2012-12-07 14:01:04 -05:00
Matthew Barnes 3924dc759d EMailParserExtension: Collect EMailParts in a GQueue.
Collect EMailParts in a GQueue provided to the EMailParserExtension,
and change the return type of parse() to gboolean to indicate whether
the given CamelMimePart was handled (even if no parts were added to
the output GQueue).

This avoids the awkward corner case of a parser extension returning a
linked list node with a NULL data member to indicate the CamelMimePart
was handled but no EMailParts produced, and then having to watch out
for that NULL data member corner case throughout the application.

Also, remove the GCancellable parameter from e_mail_parser_error() and
e_mail_parser_wrap_as_attachment() since neither function blocks.
2012-12-07 14:01:04 -05:00
Matthew Barnes 91822b42dc Make EMailPartList thread-safe.
Exposing data members in the public struct is unwise, especially when
EMailPartList is used from multiple threads.  Instead keep the members
private and provide a set of thread-safe functions to manipulate them.
2012-12-07 14:01:04 -05:00
Matthew Barnes 2f0d83cf74 EMailFormatterContext: Keep a reference to EMailPartList.
Replace the individual components of an EMailPartList with a reference
on the EMailPartList itself in EMailFormatContext.  Easier to manage.
2012-12-07 14:01:04 -05:00
Dan Vrátil 14ea179597 Don't rely on user's $PATH, use HIGHLIGHT_COMMAND defined by configure 2012-10-09 00:32:54 +02:00
Dan Vrátil 5437fa7c35 Bug #684447 - Check for highlight during configure.
If the highlight program cannot be found width AC_PATH_PROGS,
configure will abort with an error message.

You can either
a) install highlight
b) specify the patch with HIGHLIGHT=/path/to/highlight
c) pass --disable-text-highlight to configure to exclude the module

This also makes text-highlight module to fallback to text/plain
formatter when highlight program would crash or fail to ensure
the content is delivered to user.
2012-10-08 23:27:29 +02:00
Antoine Jacoutot 1cfe0327ca portability: don't use too generic variable names
OpenBSD (and maybe other OS) already declare stdout and stdin in <stdio.h>
which breaks evolution build, so prefix both with "pipe_" to prevent clashing.

https://bugzilla.gnome.org/show_bug.cgi?id=685471
2012-10-04 15:46:49 +02:00
Dan Vrátil 164d4aeadd Bug #680786 - [text-highlight] Correctly display binary patches 2012-08-23 11:12:39 +02:00
Matthew Barnes c85109fc32 Coding style and whitespace cleanup. 2012-08-19 14:17:55 -04:00
Dan Vrátil 2ba06f65fa Bug #680786 - [text-highlight] Prefer Content-Type header over file name extension 2012-08-10 14:26:04 +02:00
Matthew Barnes 6fc650ff53 text-highlight: Add missing linker flags. 2012-07-27 14:35:19 -04:00
Dan Vrátil 9574b77d63 Bug #680577 - [text-highlight] - Failed to load part 2012-07-26 21:24:23 +02:00
Dan Vrátil 7878c06f05 Bug #680634 - Missing image attachment 2012-07-26 21:23:29 +02:00
Dan Vrátil 8663b54cae Highlighting of text parts and source codes
This adds 'Format as' submenu to the preview pane context menu.
The submenu is available only for text/plain parts or parts
with a source code (we support about 40 various types). Using
the 'highlight' utility, the formatter processes the part and
highlights the source code it contains.

(discussion in bug #680026)
2012-07-25 11:29:22 +02:00
Matthew Barnes cc8bf823ec Coding style and whitespace cleanup. 2012-06-24 20:31:43 -04:00
Matthew Barnes f960fd2dff Reduce usage of g_type_class_peek_parent().
G_DEFINE_TYPE macros define a static "parent_class" variable.
2012-06-24 20:31:42 -04:00
Dan Vrátil 9311914746 Mail formatter rewrite - convert some plugins to modules
audio-inline, itip-formatter, prefer-plain, tnef-attachments
and vcard-inline plugins were converted to modules so that they
can fit into concept of the new formatter.

Every module still installs .eplug file, because there is no
suitable API at the moment to register plugins to the plugins dialog
and to extend the Preferences dialog.
2012-06-06 15:29:38 +02:00