aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-26 23:05:06 +0800
committerMichael Meeks <michael.meeks@novell.com>2010-04-07 19:23:31 +0800
commit8f42c1dd8fd57e6cb1275e3322e10005466e9d15 (patch)
treea06307eb92e21b53b7ce4bcab7a7ca730c8478f9 /widgets/misc
parent52e458fcfc493c4058ee1ab988da550a53ef4137 (diff)
downloadgsoc2013-evolution-8f42c1dd8fd57e6cb1275e3322e10005466e9d15.tar.gz
gsoc2013-evolution-8f42c1dd8fd57e6cb1275e3322e10005466e9d15.tar.zst
gsoc2013-evolution-8f42c1dd8fd57e6cb1275e3322e10005466e9d15.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/misc')
-rw-r--r--widgets/misc/e-web-view.c21
-rw-r--r--widgets/misc/e-web-view.h2
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);