aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2012-07-25 17:29:22 +0800
committerDan Vrátil <dvratil@redhat.com>2012-07-25 17:29:22 +0800
commit8663b54cae296883452850f3baad6d4cbc92e220 (patch)
treef895a43b817e0115a57bc639b2b6a9e40caa1193 /mail
parentb456ff5423b9f4ffe5719e460e4b769bed28c934 (diff)
downloadgsoc2013-evolution-8663b54cae296883452850f3baad6d4cbc92e220.tar
gsoc2013-evolution-8663b54cae296883452850f3baad6d4cbc92e220.tar.gz
gsoc2013-evolution-8663b54cae296883452850f3baad6d4cbc92e220.tar.bz2
gsoc2013-evolution-8663b54cae296883452850f3baad6d4cbc92e220.tar.lz
gsoc2013-evolution-8663b54cae296883452850f3baad6d4cbc92e220.tar.xz
gsoc2013-evolution-8663b54cae296883452850f3baad6d4cbc92e220.tar.zst
gsoc2013-evolution-8663b54cae296883452850f3baad6d4cbc92e220.zip
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)
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-display.c6
-rw-r--r--mail/e-mail-request.c24
2 files changed, 18 insertions, 12 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index be99ea226c..6cbbaa6091 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -177,6 +177,12 @@ mail_display_button_press_event (GtkWidget *widget,
GList *extensions, *iter;
EWebView *web_view = E_WEB_VIEW (widget);
+ if (event->button != 3) {
+ return GTK_WIDGET_CLASS (
+ e_mail_display_parent_class)->button_press_event (
+ widget, event);
+ }
+
hit_test = webkit_web_view_get_hit_test_result (
WEBKIT_WEB_VIEW (web_view), event);
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index 0f185c2031..aee9c9cc91 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -54,6 +54,7 @@ struct _EMailRequestPrivate {
GHashTable *uri_query;
gchar *uri_base;
+ gchar *full_uri;
gchar *ret_mime_type;
};
@@ -105,6 +106,7 @@ handle_mail_request (GSimpleAsyncResult *res,
context.message_uid = part_list->message_uid;
context.folder = part_list->folder;
context.parts = part_list->list;
+ context.uri = request->priv->full_uri;
if (context.mode == E_MAIL_FORMATTER_MODE_PRINTING)
formatter = e_mail_formatter_print_new ();
@@ -285,25 +287,22 @@ mail_request_finalize (GObject *object)
g_clear_object (&request->priv->output_stream);
- if (request->priv->mime_type) {
- g_free (request->priv->mime_type);
- request->priv->mime_type = NULL;
- }
+ g_free (request->priv->mime_type);
+ request->priv->mime_type = NULL;
if (request->priv->uri_query) {
g_hash_table_destroy (request->priv->uri_query);
request->priv->uri_query = NULL;
}
- if (request->priv->ret_mime_type) {
- g_free (request->priv->ret_mime_type);
- request->priv->ret_mime_type = NULL;
- }
+ g_free (request->priv->ret_mime_type);
+ request->priv->ret_mime_type = NULL;
- if (request->priv->uri_base) {
- g_free (request->priv->uri_base);
- request->priv->uri_base = NULL;
- }
+ g_free (request->priv->uri_base);
+ request->priv->uri_base = NULL;
+
+ g_free (request->priv->full_uri);
+ request->priv->full_uri = NULL;
G_OBJECT_CLASS (e_mail_request_parent_class)->finalize (object);
}
@@ -337,6 +336,7 @@ mail_request_send_async (SoupRequest *request,
emr->priv->uri_query = NULL;
}
+ emr->priv->full_uri = soup_uri_to_string (uri, FALSE);
uri_str = g_strdup_printf (
"%s://%s%s", uri->scheme, uri->host, uri->path);
emr->priv->uri_base = uri_str;