diff options
-rw-r--r-- | addressbook/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 44 |
2 files changed, 24 insertions, 26 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e184545e0f..57af8d0338 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,11 @@ 2004-05-28 Chris Toshok <toshok@ximian.com> + * gui/widgets/eab-contact-display.c (render_contact): render all + email addresses, not just the first 3. + (eab_contact_display_class_init): use a C comment, not C++. + +2004-05-28 Chris Toshok <toshok@ximian.com> + * gui/component/select-names/e-select-names-bonobo.c (entry_set_property_fn): call e_select_names_model_load_contacts after setting text/addresses/destinations. diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index a74fc3a7cb..bffc0b1166 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -33,6 +33,8 @@ #include <gtkhtml/gtkhtml-stream.h> #include <gtk/gtkscrolledwindow.h> +/*#define HANDLE_MAILTO_INTERNALLY 1*/ + #define PARENT_TYPE (gtk_vbox_get_type ()) struct _EABContactDisplayPrivate { @@ -281,43 +283,33 @@ static void render_contact (GtkHTMLStream *html_stream, EContact *contact) { GString *accum; - const char *e; + GList *email_list, *l; +#ifdef HANDLE_MAILTO_INTERNALLY + int email_num = 0; +#endif char *nl; gtk_html_stream_printf (html_stream, "<table border=\"0\">"); accum = g_string_new (""); 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) { + + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + for (l = email_list; l; l = l->next) { #ifdef HANDLE_MAILTO_INTERNALLY - g_string_append_printf (accum, "<a href=\"internal-mailto:2\">%s</a>", e); + char *html = e_text_to_html (l->data, 0); + g_string_append_printf (accum, "%s<a href=\"internal-mailto:%d\">%s</a>", nl, email_num, html); + email_num ++; + g_free (html); nl = "<br>"; + #else - g_string_append_printf (accum, "%s%s", nl, e); + g_string_append_printf (accum, "%s%s", nl, l->data); nl = "\n"; #endif } + g_list_foreach (email_list, (GFunc)g_free, NULL); + g_list_free (email_list); if (accum->len) { start_block (html_stream, ""); @@ -670,7 +662,7 @@ eab_contact_display_init (GObject *object) static void eab_contact_display_class_init (GtkObjectClass *object_class) { - // object_class->destroy = mail_display_destroy; + /* object_class->destroy = mail_display_destroy;*/ } GType |