From ec189bd8f46c84af0323df0fbd08ebf11a2db413 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 22 Mar 2001 17:00:42 +0000 Subject: connect to button_press_event and iframe_created events of GtkHTML widget 2001-03-22 Radek Doulik * mail-display.c (mail_display_new): connect to button_press_event and iframe_created events of GtkHTML widget (html_button_press_event): new signal handler, runs popup on address fields and on links, later we should add popups for images and maybe some more? any ideas? (html_iframe_created): new signal handler, takes care of connecting to button_press_event of all iframes : plus bunch of empty methods for popup menu items - to be implemented * mail-format.c (write_address): revert back to raw HTML text, store name and email to Text objects, workaround gtkhtml tables bug (to be fixed soon ;-) svn path=/trunk/; revision=8896 --- mail/mail-format.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'mail/mail-format.c') diff --git a/mail/mail-format.c b/mail/mail-format.c index 2668208bc9..fc46526b9c 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -582,7 +582,7 @@ write_field_row_begin (const char *description, gint flags, GtkHTML *html, GtkHT encoded_desc = e_utf8_from_gtk_string (GTK_WIDGET (html), description); - mail_html_write (html, stream, "<%s align=right> %s ", + mail_html_write (html, stream, "<%s align=\"right\" valign=\"top\">%s", bold ? "th" : "td", encoded_desc, bold ? "th" : "td"); g_free (encoded_desc); @@ -600,7 +600,7 @@ write_date (CamelMimeMessage *message, int flags, GtkHTML *html, GtkHTMLStream * date = camel_mime_message_get_date (message, &offset); datestr = header_format_date (date, offset); - mail_html_write (html, stream, " %s ", datestr); + mail_html_write (html, stream, "%s ", datestr); g_free (datestr); } @@ -617,7 +617,7 @@ write_subject (const char *subject, int flags, GtkHTML *html, GtkHTMLStream *str write_field_row_begin (_("Subject:"), flags, html, stream); - mail_html_write (html, stream, " %s ", encoded_subj); + mail_html_write (html, stream, "%s ", encoded_subj); if (subject) g_free (encoded_subj); @@ -653,6 +653,7 @@ static void write_address(MailDisplay *md, const CamelInternetAddress *addr, const char *field_name, int flags) { const char *name, *email; + gboolean name_set = FALSE, mail_set = FALSE; gint i; if (addr == NULL || !camel_internet_address_get (addr, 0, NULL, NULL)) @@ -664,19 +665,40 @@ write_address(MailDisplay *md, const CamelInternetAddress *addr, const char *fie while (camel_internet_address_get (addr, i, &name, &email)) { if ((name && *name) || (email && *email)) { - - mail_html_write (md->html, md->stream, i ? ", " : ""); + /* we need these to separate HTMLText objects */ + mail_html_write (md->html, md->stream, i ? ", " : ""); + mail_html_write (md->html, md->stream, " "); - mail_html_write (md->html, md->stream, ""); + if (name && *name) { + mail_html_write (md->html, md->stream, + "", + name); + name_set = TRUE; + } + + if (email && *email) { + mail_html_write (md->html, md->stream, + "", + email); + mail_set = TRUE; + } if (name && *name) - mail_html_write (md->html, md->stream, "", name); + mail_html_write (md->html, md->stream, "%s ", name); if (email && *email) - mail_html_write (md->html, md->stream, "", email); - mail_html_write (md->html, md->stream, ""); + mail_html_write (md->html, md->stream, "%s%s%s", + name && *name ? "<" : "", + email, + name && *name ? ">" : ""); } ++i; } + if (name_set) + mail_html_write (md->html, md->stream, + ""); + if (mail_set) + mail_html_write (md->html, md->stream, + ""); mail_html_write (md->html, md->stream, ""); /* Finish up the table row */ } -- cgit v1.2.3