aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-03-01 21:16:31 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-03-01 21:16:31 +0800
commit08b1d0ae8e36ef20da800bf6358ca0cd9fb4e026 (patch)
tree2731ee3191355d6bdc90b16d249f711cb1e78afd /mail/e-mail-reader.c
parent24abc4f17353ed818a09f324f5ed8822ad9b5a7e (diff)
downloadgsoc2013-evolution-08b1d0ae8e36ef20da800bf6358ca0cd9fb4e026.tar.gz
gsoc2013-evolution-08b1d0ae8e36ef20da800bf6358ca0cd9fb4e026.tar.zst
gsoc2013-evolution-08b1d0ae8e36ef20da800bf6358ca0cd9fb4e026.zip
Split the interactive parts of the message display out of EMFormatHTMLDisplay
to a new GtkHTML subclass named EMailDisplay, and have EMFormatHTML create an instance of that. EMailDisplay will handle link clicking, mousing over URIs, popup menus, and interactive search. This makes EMFormatHTMLDisplay and EMailReader more lightweight. Clean up more of the EMFormat stack. svn path=/branches/kill-bonobo/; revision=37346
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c45
1 files changed, 5 insertions, 40 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index ab7c86c160..b058fda07e 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -1620,40 +1620,6 @@ static GtkToggleActionEntry mail_reader_toggle_entries[] = {
FALSE }
};
-static void
-mail_reader_link_clicked_cb (EMailReader *reader,
- const gchar *uri,
- EMFormatHTMLDisplay *html_display)
-{
- GtkHTML *html;
- GtkWindow *window;
- MessageList *message_list;
- const gchar *folder_uri;
-
- html = EM_FORMAT_HTML (html_display)->html;
- message_list = e_mail_reader_get_message_list (reader);
- window = e_mail_reader_get_window (reader);
- folder_uri = message_list->folder_uri;
-
- if (g_str_has_prefix (uri, "##"))
- return;
-
- if (g_ascii_strncasecmp (uri, "mailto:", 7) == 0)
- em_utils_compose_new_message_with_mailto (uri, folder_uri);
-
- else if (*uri == '#')
- gtk_html_jump_to_anchor (html, uri + 1);
-
- else if (g_ascii_strncasecmp (uri, "thismessage:", 12) == 0)
- /* ignore */ ;
-
- else if (g_ascii_strncasecmp (uri, "cid:", 4) == 0)
- /* ignore */ ;
-
- else
- e_show_uri (window, uri);
-}
-
static gboolean
mail_reader_html_button_release_event_cb (EMailReader *reader,
GdkEventButton *button,
@@ -2057,6 +2023,7 @@ e_mail_reader_init (EMailReader *reader)
MessageList *message_list;
GConfBridge *bridge;
GtkAction *action;
+ GtkHTML *html;
const gchar *action_name;
const gchar *key;
@@ -2070,6 +2037,8 @@ e_mail_reader_init (EMailReader *reader)
shell = e_shell_module_get_shell (shell_module);
shell_settings = e_shell_get_shell_settings (shell);
+ html = EM_FORMAT_HTML (html_display)->html;
+
gtk_action_group_add_actions (
action_group, mail_reader_entries,
G_N_ELEMENTS (mail_reader_entries), reader);
@@ -2136,7 +2105,7 @@ e_mail_reader_init (EMailReader *reader)
e_binding_new (
G_OBJECT (shell_settings), "mail-show-animated-images",
- G_OBJECT (html_display), "animate");
+ G_OBJECT (html), "animate");
e_binding_new (
G_OBJECT (shell_settings), "mail-show-sender-photo",
@@ -2147,15 +2116,11 @@ e_mail_reader_init (EMailReader *reader)
e_mutual_binding_new (
G_OBJECT (action), "active",
- G_OBJECT (html_display), "caret-mode");
+ G_OBJECT (html), "caret-mode");
/* Connect signals. */
g_signal_connect_swapped (
- html_display, "link-clicked",
- G_CALLBACK (mail_reader_link_clicked_cb), reader);
-
- g_signal_connect_swapped (
EM_FORMAT_HTML (html_display)->html, "button-release-event",
G_CALLBACK (mail_reader_html_button_release_event_cb), reader);