aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorNat Friedman <nat@novell.com>2004-10-26 00:11:08 +0800
committerNat Friedman <nat@src.gnome.org>2004-10-26 00:11:08 +0800
commit35f50e44ed36185c64dffb6380b69ddc8542258c (patch)
tree9f08f7cd1d4a713499097d6ef77eeef9c46ed96c /addressbook/gui
parente0aa017ef2cd35fb3d2286a3122c12b2e0907719 (diff)
downloadgsoc2013-evolution-35f50e44ed36185c64dffb6380b69ddc8542258c.tar.gz
gsoc2013-evolution-35f50e44ed36185c64dffb6380b69ddc8542258c.tar.zst
gsoc2013-evolution-35f50e44ed36185c64dffb6380b69ddc8542258c.zip
Display mutlivalued contact attributes in the preview. (render_contact):
2004-10-25 Nat Friedman <nat@novell.com> * gui/widgets/eab-contact-display.c (accum_multival_attribute): Display mutlivalued contact attributes in the preview. (render_contact): Render all IM fields using the new multival function. svn path=/trunk/; revision=27720
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index c90d071192..9e7d66cf3e 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -248,6 +248,19 @@ accum_attribute (GString *gstr, EContact *contact, const char *html_label, ECont
}
}
+static void
+accum_multival_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags)
+{
+ GList *val_list, *l;
+
+ val_list = e_contact_get (contact, field);
+ for (l = val_list; l; l = l->next) {
+ const char *str = (const char *) l->data;
+ accum_name_value (gstr, html_label, str, icon, html_flags);
+ }
+ g_list_foreach (val_list, (GFunc) g_free, NULL);
+ g_list_free (val_list);
+}
static void
render_contact_list (GtkHTMLStream *html_stream, EContact *contact)
@@ -330,12 +343,12 @@ render_contact (GtkHTMLStream *html_stream, EContact *contact)
g_string_assign (accum, "");
- accum_attribute (accum, contact, _("AIM"), E_CONTACT_IM_AIM_HOME_1, AIM_ICON, 0);
- accum_attribute (accum, contact, _("GroupWise"), E_CONTACT_IM_GROUPWISE_HOME_1, GROUPWISE_ICON, 0);
- accum_attribute (accum, contact, _("ICQ"), E_CONTACT_IM_ICQ_HOME_1, ICQ_ICON, 0);
- accum_attribute (accum, contact, _("Jabber"), E_CONTACT_IM_JABBER_HOME_1, JABBER_ICON, 0);
- accum_attribute (accum, contact, _("MSN"), E_CONTACT_IM_MSN_HOME_1, MSN_ICON, 0);
- accum_attribute (accum, contact, _("Yahoo"), E_CONTACT_IM_YAHOO_HOME_1, YAHOO_ICON, 0);
+ accum_multival_attribute (accum, contact, _("AIM"), E_CONTACT_IM_AIM, AIM_ICON, 0);
+ accum_multival_attribute (accum, contact, _("GroupWise"), E_CONTACT_IM_GROUPWISE, GROUPWISE_ICON, 0);
+ accum_multival_attribute (accum, contact, _("ICQ"), E_CONTACT_IM_ICQ, ICQ_ICON, 0);
+ accum_multival_attribute (accum, contact, _("Jabber"), E_CONTACT_IM_JABBER, JABBER_ICON, 0);
+ accum_multival_attribute (accum, contact, _("MSN"), E_CONTACT_IM_MSN, MSN_ICON, 0);
+ accum_multival_attribute (accum, contact, _("Yahoo"), E_CONTACT_IM_YAHOO, YAHOO_ICON, 0);
if (accum->len > 0)
gtk_html_stream_printf (html_stream, accum->str);