aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-05-16 02:45:42 +0800
committerDan Winship <danw@src.gnome.org>2001-05-16 02:45:42 +0800
commitdadc54fa9885cbe38e84ed667fea13c9d3ee7603 (patch)
treea358f95b9e0d9b375a860f0b3d77a5d6fe1c7c9f /mail/mail-display.c
parent7cc37466c122693397465b443811aa20d855c04f (diff)
downloadgsoc2013-evolution-dadc54fa9885cbe38e84ed667fea13c9d3ee7603.tar
gsoc2013-evolution-dadc54fa9885cbe38e84ed667fea13c9d3ee7603.tar.gz
gsoc2013-evolution-dadc54fa9885cbe38e84ed667fea13c9d3ee7603.tar.bz2
gsoc2013-evolution-dadc54fa9885cbe38e84ed667fea13c9d3ee7603.tar.lz
gsoc2013-evolution-dadc54fa9885cbe38e84ed667fea13c9d3ee7603.tar.xz
gsoc2013-evolution-dadc54fa9885cbe38e84ed667fea13c9d3ee7603.tar.zst
gsoc2013-evolution-dadc54fa9885cbe38e84ed667fea13c9d3ee7603.zip
Load http images if the user has force-loaded images too.
* mail-display.c (on_url_requested): Load http images if the user has force-loaded images too. (mail_display_redisplay): Update for normal/headers/source changes. (mail_display_load_images): New. Force HTTP image loading for the current message. * mail-config.c (mail_config_get_message_display_style, mail_config_set_message_display_style): Updated and renamed from mail_config_{get,set}_view_source * mail-callbacks.c (load_images): New. * folder-browser.c (folder_browser_set_message_display_style): Renamed and updated from folder_browser_toggle_view_source. * folder-browser-factory.c (verbs): Add ViewLoadImages. (control_activate): Update for normal/headers/source change to radio group. svn path=/trunk/; revision=9820
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r--mail/mail-display.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 28701b566e..d1433622cb 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -37,13 +37,14 @@
#include <e-util/e-html-utils.h>
+#include "e-searching-tokenizer.h"
#include "mail-display.h"
#include "mail-config.h"
-#include "mail.h"
-#include "art/empty.xpm"
-
#include "mail-ops.h"
#include "mail-mt.h"
+#include "mail.h"
+
+#include "art/empty.xpm"
#define PARENT_TYPE (gtk_vbox_get_type ())
@@ -936,7 +937,8 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
/* See if it's something we can load. */
if (strncmp (url, "http:", 5) == 0 &&
- mail_config_get_http_mode () == MAIL_CONFIG_HTTP_ALWAYS) {
+ (mail_config_get_http_mode () == MAIL_CONFIG_HTTP_ALWAYS ||
+ g_datalist_get_data (md->data, "load_images"))) {
ba = g_byte_array_new ();
g_hash_table_insert (urls, g_strdup (url), ba);
mail_display_redisplay_when_loaded (md, ba, load_http, g_strdup (url));
@@ -1113,7 +1115,7 @@ mail_display_redisplay (MailDisplay *md, gboolean unscroll)
mail_html_write (md->html, md->stream, "%s%s", HTML_HEADER, "<BODY>\n");
if (md->current_message) {
- if (mail_config_get_view_source ())
+ if (mail_config_get_message_display_style () == MAIL_CONFIG_DISPLAY_SOURCE)
mail_format_raw_message (md->current_message, md);
else
mail_format_mime_message (md->current_message, md);
@@ -1156,6 +1158,18 @@ mail_display_set_message (MailDisplay *md, CamelMedium *medium)
}
}
+/**
+ * mail_display_load_images:
+ * @md: the mail display object
+ *
+ * Load all HTTP images in the current message
+ **/
+void
+mail_display_load_images (MailDisplay *md)
+{
+ g_datalist_set_data (md->data, "load_images", GINT_TO_POINTER (1));
+ mail_display_redisplay (md, FALSE);
+}
/*----------------------------------------------------------------------*
* Standard Gtk+ Class functions