diff options
author | Chris Toshok <toshok@ximian.com> | 2004-05-19 03:04:21 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2004-05-19 03:04:21 +0800 |
commit | 2eb079b0280c3337d96483c39e5b1c3551e03c0f (patch) | |
tree | db6cd79814c53f6fdd956a702bfc94364d1a4477 /addressbook/gui/widgets/eab-contact-display.c | |
parent | 3d0b57bcfeebc33b798f60f1b6703278f763baff (diff) | |
download | gsoc2013-evolution-2eb079b0280c3337d96483c39e5b1c3551e03c0f.tar gsoc2013-evolution-2eb079b0280c3337d96483c39e5b1c3551e03c0f.tar.gz gsoc2013-evolution-2eb079b0280c3337d96483c39e5b1c3551e03c0f.tar.bz2 gsoc2013-evolution-2eb079b0280c3337d96483c39e5b1c3551e03c0f.tar.lz gsoc2013-evolution-2eb079b0280c3337d96483c39e5b1c3551e03c0f.tar.xz gsoc2013-evolution-2eb079b0280c3337d96483c39e5b1c3551e03c0f.tar.zst gsoc2013-evolution-2eb079b0280c3337d96483c39e5b1c3551e03c0f.zip |
split out the DISPOSITION_AS_TO stuff here, and make it take a GList of
2004-05-18 Chris Toshok <toshok@ximian.com>
* gui/widgets/eab-gui-util.c
(eab_send_to_contact_and_email_num_list): split out the
DISPOSITION_AS_TO stuff here, and make it take a GList of
ContactAndEmailNum, so we can set it for the single contact case.
(eab_send_contact_list_as_attachment): split out the
DISPOSITION_AS_ATTACHMENT stuff here.
(eab_send_contact_list): call one or the other of the above,
munging the list if disposition is set to TO.
(eab_send_contact): call eab_send_to_contact_and_email_num_list
directly with the supplied email_num, instead of calling
eab_send_contact_list.
* gui/widgets/eab-gui-util.h (eab_send_contact) add "email_num"
arg, so we can specify the email address we want to be selected.
* gui/widgets/eab-contact-display.c (on_link_clicked): add
(ifdefed out at the moment) code to handle mailto: urls
internally, instead of farming them out to gnome_url_show.
(render_contact): same.
svn path=/trunk/; revision=25963
Diffstat (limited to 'addressbook/gui/widgets/eab-contact-display.c')
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 623b798089..a74fc3a7cb 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -22,6 +22,7 @@ #include "eab-contact-display.h" +#include "eab-gui-util.h" #include "e-util/e-html-utils.h" #include "e-util/e-icon-factory.h" @@ -92,7 +93,20 @@ static void on_link_clicked (GtkHTML *html, const char *url, EABContactDisplay *display) { GError *err = NULL; - + +#ifdef HANDLE_MAILTO_INTERNALLY + if (!strncmp (url, "internal-mailto:", strlen ("internal-mailto:"))) { + int mail_num = atoi (url + strlen ("internal-mailto:")); + + if (mail_num == -1) + return; + + eab_send_contact (display->priv->contact, mail_num, EAB_DISPOSITION_AS_TO); + + return; + } +#endif + gnome_url_show (url, &err); if (err) { @@ -276,23 +290,48 @@ render_contact (GtkHTMLStream *html_stream, EContact *contact) nl = ""; e = e_contact_get_const (contact, E_CONTACT_EMAIL_1); if (e) { +#ifdef HANDLE_MAILTO_INTERNALLY + g_string_append_printf (accum, "<a href=\"internal-mailto:0\">%s</a>", e); + nl = "<br>"; +#else g_string_append_printf (accum, "%s", e); nl = "\n"; +#endif } e = e_contact_get_const (contact, E_CONTACT_EMAIL_2); if (e) { +#ifdef HANDLE_MAILTO_INTERNALLY + g_string_append_printf (accum, "<a href=\"internal-mailto:1\">%s</a>", e); + nl = "<br>"; +#else g_string_append_printf (accum, "%s%s", nl, e); nl = "\n"; +#endif } e = e_contact_get_const (contact, E_CONTACT_EMAIL_3); if (e) { +#ifdef HANDLE_MAILTO_INTERNALLY + g_string_append_printf (accum, "<a href=\"internal-mailto:2\">%s</a>", e); + nl = "<br>"; +#else g_string_append_printf (accum, "%s%s", nl, e); + nl = "\n"; +#endif } if (accum->len) { start_block (html_stream, ""); + +#ifdef HANDLE_MAILTO_INTERNALLY + gtk_html_stream_printf (html_stream, "<tr><td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\">"); + gtk_html_stream_printf (html_stream, + "</td><td valign=\"top\" width=\"100\" nowrap><font color=" HEADER_COLOR ">%s:</font></td> <td valign=\"top\">%s</td></tr>", + _("E-mail"), accum->str); +#else render_name_value (html_stream, _("E-mail"), accum->str, NULL, E_TEXT_TO_HTML_CONVERT_ADDRESSES | E_TEXT_TO_HTML_CONVERT_NL); +#endif + end_block (html_stream); } |