diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-03-26 23:05:06 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-03-26 23:05:06 +0800 |
commit | 7f6f4dfde87156779c89f57b0ebc8150c7acca7e (patch) | |
tree | 5dfcc834dba5d02d44a5b28425864425dcb79afb /widgets | |
parent | cb10cf2a8e7bf697caab441e03e9056b863ae739 (diff) | |
download | gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.gz 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 'widgets')
-rw-r--r-- | widgets/misc/e-web-view.c | 21 | ||||
-rw-r--r-- | widgets/misc/e-web-view.h | 2 |
2 files changed, 19 insertions, 4 deletions
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index c65f9cf666..d245437e84 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -857,6 +857,16 @@ web_view_extract_uri (EWebView *web_view, } static void +web_view_load_string (EWebView *web_view, + const gchar *string) +{ + if (string != NULL && *string != '\0') + gtk_html_load_from_string (GTK_HTML (web_view), string, -1); + else + e_web_view_clear (web_view); +} + +static void web_view_copy_clipboard (EWebView *web_view) { gtk_html_command (GTK_HTML (web_view), "copy"); @@ -1078,6 +1088,7 @@ e_web_view_class_init (EWebViewClass *class) html_class->iframe_created = web_view_iframe_created; class->extract_uri = web_view_extract_uri; + class->load_string = web_view_load_string; class->copy_clipboard = web_view_copy_clipboard; class->cut_clipboard = web_view_cut_clipboard; class->paste_clipboard = web_view_paste_clipboard; @@ -1435,12 +1446,14 @@ void e_web_view_load_string (EWebView *web_view, const gchar *string) { + EWebViewClass *class; + g_return_if_fail (E_IS_WEB_VIEW (web_view)); - if (string != NULL && *string != '\0') - gtk_html_load_from_string (GTK_HTML (web_view), string, -1); - else - e_web_view_clear (web_view); + class = E_WEB_VIEW_GET_CLASS (web_view); + g_return_if_fail (class->load_string != NULL); + + class->load_string (web_view, string); } gboolean diff --git a/widgets/misc/e-web-view.h b/widgets/misc/e-web-view.h index 0fea6eb3cf..7d8eb4c8d0 100644 --- a/widgets/misc/e-web-view.h +++ b/widgets/misc/e-web-view.h @@ -69,6 +69,8 @@ struct _EWebViewClass { gchar * (*extract_uri) (EWebView *web_view, GdkEventButton *event, GtkHTML *frame); + void (*load_string) (EWebView *web_view, + const gchar *load_string); /* Signals */ void (*copy_clipboard) (EWebView *web_view); |