aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-display.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-26 23:05:06 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-03-26 23:05:06 +0800
commit7f6f4dfde87156779c89f57b0ebc8150c7acca7e (patch)
tree5dfcc834dba5d02d44a5b28425864425dcb79afb /mail/e-mail-display.c
parentcb10cf2a8e7bf697caab441e03e9056b863ae739 (diff)
downloadgsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar
gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.gz
gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.bz2
gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.lz
gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.xz
gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.zst
gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.zip
Minor EMailReader cleanup.
Add a load_string() method to EWebView. Have EMailDisplay override load_string() and check that the formatter is not busy before loading the string. Have EMailReader call e_web_view_load_string() directly on the EMailDisplay instance, and eliminate update_webview_content().
Diffstat (limited to 'mail/e-mail-display.c')
-rw-r--r--mail/e-mail-display.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 70789c0d47..9f9569dd8a 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -208,6 +208,22 @@ mail_display_style_set (GtkWidget *widget,
}
static void
+mail_display_load_string (EWebView *web_view,
+ const gchar *string)
+{
+ EMailDisplayPrivate *priv;
+
+ priv = E_MAIL_DISPLAY_GET_PRIVATE (web_view);
+ g_return_if_fail (priv->formatter != NULL);
+
+ if (em_format_busy (EM_FORMAT (priv->formatter)))
+ return;
+
+ /* Chain up to parent's load_string() method. */
+ E_WEB_VIEW_CLASS (parent_class)->load_string (web_view, string);
+}
+
+static void
mail_display_url_requested (GtkHTML *html,
const gchar *uri,
GtkHTMLStream *stream)
@@ -270,6 +286,7 @@ mail_display_class_init (EMailDisplayClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
+ EWebViewClass *web_view_class;
GtkHTMLClass *html_class;
parent_class = g_type_class_peek_parent (class);
@@ -284,6 +301,9 @@ mail_display_class_init (EMailDisplayClass *class)
widget_class->realize = mail_display_realize;
widget_class->style_set = mail_display_style_set;
+ web_view_class = E_WEB_VIEW_CLASS (class);
+ web_view_class->load_string = mail_display_load_string;
+
html_class = GTK_HTML_CLASS (class);
html_class->url_requested = mail_display_url_requested;
html_class->link_clicked = mail_display_link_clicked;