Index: evolution/camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.1492
diff -u -r1.1492 ChangeLog
--- evolution/camel/ChangeLog	28 May 2002 03:00:21 -0000	1.1492
+++ evolution/camel/ChangeLog	28 May 2002 15:46:24 -0000
@@ -1,3 +1,9 @@
+2002-05-28  Christian Kreibich <christian@whoop.org>
+
+	* Added additional strings to struct CamelMessageInfo to store
+	the name part and the email address part of a full email address,
+	plus functions to extract these.
+	
 2002-05-27  Jeffrey Stedfast  <fejj@ximian.com>
 
 	* providers/smtp/camel-smtp-transport.c (connect_to_server): On
Index: evolution/camel/camel-folder-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-folder-summary.c,v
retrieving revision 1.102
diff -u -r1.102 camel-folder-summary.c
--- evolution/camel/camel-folder-summary.c	14 May 2002 23:37:57 -0000	1.102
+++ evolution/camel/camel-folder-summary.c	28 May 2002 15:46:29 -0000
@@ -1516,6 +1516,63 @@
 	return ci;
 }
 
+/* Allocates and returns a new string that contains
+   the name part of a full mail address:
+
+   "John Doe <john@doe.com>" --> "John Doe"
+*/
+static char *
+message_extract_name(const char *from_string)
+{
+        char *sender = NULL;        
+	char *left_brace = NULL;
+
+        if (!from_string)
+	        return NULL;
+
+	if ( (left_brace = strchr(from_string, '<')) == NULL)
+	        return g_strdup(from_string);
+
+	do {
+	        left_brace--;
+	} while ( (*left_brace == ' ') && /* paranoid */ (left_brace > from_string));
+
+	sender = g_malloc(left_brace - from_string + 2);
+	memcpy(sender, from_string, left_brace - from_string + 1);
+	sender[left_brace - from_string + 1] = '\0';
+
+	return sender;
+}
+
+/* Allocates and returns a new string that contains
+   the address part of a full mail address:
+
+   "John Doe <john@doe.com>" --> "john@doe.com"
+*/
+static char *
+message_extract_address(const char *from_string)
+{
+        char *address = NULL;        
+	char *left_brace = NULL;
+	char *right_brace = NULL;
+
+        if (!from_string)
+	        return NULL;
+
+	if ( ((left_brace = strchr(from_string, '<')) == NULL)   ||
+	     ((right_brace = strrchr(from_string, '>')) == NULL))
+	        return g_strdup(from_string);
+
+	left_brace++;
+	right_brace--;
+
+	address = g_malloc(right_brace - left_brace + 2);
+	memcpy(address, left_brace, right_brace - left_brace + 1);
+	address[right_brace - left_brace + 1] = '\0';
+
+	return address;
+}
+
 static CamelMessageInfo *
 message_info_new(CamelFolderSummary *s, struct _header_raw *h)
 {
@@ -1526,6 +1583,7 @@
 	char *msgid;
 	int count;
 	char *subject, *from, *to, *cc, *mlist;
+	char *from_name, *from_address, *to_name, *to_address;
 	struct _header_content_type *ct = NULL;
 	const char *content, *charset = NULL;
 
@@ -1544,6 +1602,10 @@
 	to = summary_format_address(h, "to");
 	cc = summary_format_address(h, "cc");
 	mlist = header_raw_check_mailing_list(&h);
+	from_name = message_extract_name(from);
+	from_address = message_extract_address(from);
+	to_name = message_extract_name(to);
+	to_address = message_extract_address(to);
 
 	if (ct)
 		header_content_type_unref(ct);
@@ -1554,18 +1616,30 @@
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO, to, TRUE);
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_CC, cc, TRUE);
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_FROM_NAME, from_name, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_FROM_ADDRESS, from_address, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO_NAME, to_name, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO_ADDRESS, to_address, TRUE);
 #elif defined (DOESTRV)
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject);
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_FROM, from);
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO, to);
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_CC, cc);
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_FROM_NAME, from_name);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_FROM_ADDRESS, from_address);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO_NAME, to_name);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO_ADDRESS, to_address);
 #else
 	mi->subject = subject;
 	mi->from = from;
 	mi->to = to;
 	mi->cc = cc;
 	mi->mlist = mlist;
+	mi->from_name = from_name;
+	mi->from_address = from_address;
+	mi->to_name = to_name;
+	mi->to_address = to_address;
 #endif
 
 	mi->user_flags = NULL;
@@ -1625,7 +1699,8 @@
 	CamelMessageInfo *mi;
 	guint count;
 	int i;
-	char *subject, *from, *to, *cc, *mlist, *uid;;
+	char *subject, *from, *to, *cc, *mlist, *uid, *from_name,
+	     *from_address, *to_name, *to_address;
 
 	mi = camel_folder_summary_info_new(s);
 
@@ -1642,6 +1717,11 @@
 	camel_file_util_decode_string(in, &cc);
 	camel_file_util_decode_string(in, &mlist);
 
+	from_name = message_extract_name(from);
+	from_address = message_extract_address(from);
+	to_name = message_extract_name(to);
+	to_address = message_extract_address(to);
+
 #ifdef DOEPOOLV
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_UID, uid, TRUE);
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject, TRUE);
@@ -1649,6 +1729,10 @@
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO, to, TRUE);
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_CC, cc, TRUE);
 	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_FROM_NAME, from_name, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_FROM_ADDRESS, from_address, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO_NAME, to_name, TRUE);
+	e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO_ADDRESS, to_address, TRUE);
 #elif defined (DOESTRV)
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_UID, uid);
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject);
@@ -1656,6 +1740,10 @@
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO, to);
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_CC, cc);
 	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_FROM_NAME, from_name);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_FROM_ADDRESS, from_address);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO_NAME, to_name);
+	e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO_ADDRESS, to_address);
 #else
 	mi->uid = uid;
 	mi->subject = subject;
@@ -1663,6 +1751,10 @@
 	mi->to = to;
 	mi->cc = cc;
 	mi->mlist = mlist;
+	mi->from_name = from_name;
+	mi->from_address = from_address;
+	mi->to_name = to_name;
+	mi->to_address = to_address;
 #endif
 
 	mi->content = NULL;
@@ -1781,6 +1873,10 @@
 	g_free(mi->to);
 	g_free(mi->cc);
 	g_free(mi->mlist);
+	g_free(mi->from_name);
+	g_free(mi->from_address);
+	g_free(mi->to_name);
+	g_free(mi->to_address);
 #endif
 	g_free(mi->references);
 	camel_flag_list_free(&mi->user_flags);
@@ -2593,6 +2689,10 @@
 	e_strv_set(to->strings, CAMEL_MESSAGE_INFO_CC, camel_message_info_cc(from));
 	e_strv_set(to->strings, CAMEL_MESSAGE_INFO_UID, camel_message_info_uid(from));
 	e_strv_set(to->strings, CAMEL_MESSAGE_INFO_UID, camel_message_info_mlist(from));
+	e_strv_set(to->strings, CAMEL_MESSAGE_INFO_FROM_NAME, camel_message_info_from_name(from));
+	e_strv_set(to->strings, CAMEL_MESSAGE_INFO_FROM_ADDRESSS, camel_message_info_from_address(from));
+	e_strv_set(to->strings, CAMEL_MESSAGE_INFO_TO_NAME, camel_message_info_to_name(from));
+	e_strv_set(to->strings, CAMEL_MESSAGE_INFO_TO_ADDRESSS, camel_message_info_to_address(from));
 #else
 	to->subject = g_strdup(from->subject);
 	to->from = g_strdup(from->from);
@@ -2600,6 +2700,10 @@
 	to->cc = g_strdup(from->cc);
 	to->uid = g_strdup(from->uid);
 	to->mlist = g_strdup(from->mlist);
+	to->from_name = g_strdup(from->from_name);
+	to->from_address = g_strdup(from->from_address);
+	to->to_name = g_strdup(from->to_name);
+	to->to_address = g_strdup(from->to_address);
 #endif
 	memcpy(&to->message_id, &from->message_id, sizeof(from->message_id));
 
@@ -2666,6 +2770,10 @@
 	g_free(mi->to);
 	g_free(mi->cc);
 	g_free(mi->mlist);
+	g_free(mi->from_name);
+	g_free(mi->from_address);
+	g_free(mi->to_name);
+	g_free(mi->to_address);
 #endif
 	g_free(mi->references);
 	camel_flag_list_free(&mi->user_flags);
Index: evolution/camel/camel-folder-summary.h
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-folder-summary.h,v
retrieving revision 1.63
diff -u -r1.63 camel-folder-summary.h
--- evolution/camel/camel-folder-summary.h	14 May 2002 23:37:57 -0000	1.63
+++ evolution/camel/camel-folder-summary.h	28 May 2002 15:46:29 -0000
@@ -111,6 +111,10 @@
 	CAMEL_MESSAGE_INFO_TO,
 	CAMEL_MESSAGE_INFO_CC,
 	CAMEL_MESSAGE_INFO_MLIST,
+	CAMEL_MESSAGE_INFO_FROM_NAME,
+	CAMEL_MESSAGE_INFO_FROM_ADDRESS,
+	CAMEL_MESSAGE_INFO_TO_NAME,
+	CAMEL_MESSAGE_INFO_TO_ADDRESS,
 	CAMEL_MESSAGE_INFO_LAST,
 };
 #endif
@@ -130,6 +134,11 @@
 	char *mlist;
 
 	char *uid;
+
+	char *from_name;
+	char *from_address;
+	char *to_name;
+	char *to_address;
 #endif /* DOEPOOLV */
 	guint32 flags;
 	guint32 size;
@@ -307,6 +316,10 @@
 #define camel_message_info_cc(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_CC)
 #define camel_message_info_uid(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_UID)
 #define camel_message_info_mlist(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_MLIST)
+#define camel_message_info_from_name(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_FROM_NAME)
+#define camel_message_info_from_address(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_FROM_ADDRESS)
+#define camel_message_info_to_name(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_TO_NAME)
+#define camel_message_info_to_address(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_TO_ADDRESS)
 
 void camel_message_info_set_string(CamelMessageInfo *mi, int type, char *str);
 #define camel_message_info_set_subject(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_SUBJECT, s)
@@ -315,6 +328,10 @@
 #define camel_message_info_set_cc(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_CC, s)
 #define camel_message_info_set_uid(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_UID, s)
 #define camel_message_info_set_mlist(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_MLIST, s)
+#define camel_message_info_set_from_name(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_FROM_NAME, s)
+#define camel_message_info_set_from_address(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_FROM_ADDRESS, s)
+#define camel_message_info_set_to_name(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_TO_NAME, s)
+#define camel_message_info_set_to_address(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_TO_ADDRESS, s)
 
 #else
 
@@ -324,6 +341,10 @@
 #define camel_message_info_cc(x) (((CamelMessageInfo *)(x))->cc?((CamelMessageInfo *)(x))->cc:"")
 #define camel_message_info_uid(x) (((CamelMessageInfo *)(x))->uid?((CamelMessageInfo *)(x))->uid:"")
 #define camel_message_info_mlist(x) (((CamelMessageInfo *)(x))->mlist?((CamelMessageInfo *)(x))->mlist:"")
+#define camel_message_info_from_name(x) (((CamelMessageInfo *)(x))->sender_name?((CamelMessageInfo *)(x))->from_name:"")
+#define camel_message_info_from_address(x) (((CamelMessageInfo *)(x))->sender_address?((CamelMessageInfo *)(x))->from_address:"")
+#define camel_message_info_to_name(x) (((CamelMessageInfo *)(x))->sender_name?((CamelMessageInfo *)(x))->to_name:"")
+#define camel_message_info_to_address(x) (((CamelMessageInfo *)(x))->sender_address?((CamelMessageInfo *)(x))->to_address:"")
 
 #define camel_message_info_set_subject(x, s) (g_free(((CamelMessageInfo *)(x))->subject),((CamelMessageInfo *)(x))->subject = (s))
 #define camel_message_info_set_from(x, s) (g_free(((CamelMessageInfo *)(x))->from),((CamelMessageInfo *)(x))->from = (s))
@@ -331,6 +352,10 @@
 #define camel_message_info_set_cc(x, s) (g_free(((CamelMessageInfo *)(x))->cc),((CamelMessageInfo *)(x))->cc = (s))
 #define camel_message_info_set_uid(x, s) (g_free(((CamelMessageInfo *)(x))->uid),((CamelMessageInfo *)(x))->uid = (s))
 #define camel_message_info_set_mlist(x, s) (g_free(((CamelMessageInfo *)(x))->mlist),((CamelMessageInfo *)(x))->mlist = (s))
+#define camel_message_info_set_from_name(x, s) (g_free(((CamelMessageInfo *)(x))->sender_name),((CamelMessageInfo *)(x))->from_name = (s))
+#define camel_message_info_set_from_address(x, s) (g_free(((CamelMessageInfo *)(x))->sender_address),((CamelMessageInfo *)(x))->from_address = (s))
+#define camel_message_info_set_to_name(x, s) (g_free(((CamelMessageInfo *)(x))->sender_name),((CamelMessageInfo *)(x))->to_name = (s))
+#define camel_message_info_set_to_address(x, s) (g_free(((CamelMessageInfo *)(x))->sender_address),((CamelMessageInfo *)(x))->to_address = (s))
 #endif
 
 
Index: evolution/mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2196
diff -u -r1.2196 ChangeLog
--- evolution/mail/ChangeLog	24 May 2002 19:55:11 -0000	1.2196
+++ evolution/mail/ChangeLog	28 May 2002 15:47:16 -0000
@@ -1,3 +1,9 @@
+2002-05-27  Christian Kreibich <christian@whoop.org>
+
+	* mail-config.[ch], mail-preferences.[ch], message-list.[ch],
+	mail-config.glade: made the way addresses are displayed in the
+	"To:" and "From:" columns in the message lists configurable.
+
 2002-05-24  Radek Doulik  <rodo@ximian.com>
 
 	* mail-composer-prefs.c (mail_composer_prefs_construct): ops,
Index: evolution/mail/mail-config.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.c,v
retrieving revision 1.214
diff -u -r1.214 mail-config.c
--- evolution/mail/mail-config.c	16 May 2002 20:56:35 -0000	1.214
+++ evolution/mail/mail-config.c	28 May 2002 15:47:19 -0000
@@ -91,6 +91,7 @@
 	gboolean confirm_unwanted_html;
 	gboolean citation_highlight;
 	guint32  citation_color;
+	MailConfigAddressStyle address_style;
 	gboolean prompt_empty_subject;
 	gboolean prompt_only_bcc;
 	gboolean confirm_expunge;
@@ -880,7 +881,12 @@
 	/* Size of vpaned in mail view */
 	config->paned_size = bonobo_config_get_long_with_default (config->db, 
                 "/Mail/Display/paned_size", 200, NULL);
-	
+
+	/* Address display style */
+	config->address_style = bonobo_config_get_long_with_default (
+	        config->db, "/Mail/Display/address_style", 
+		MAIL_CONFIG_ADDRESS_NAME_AND_ADDRESS, NULL);
+		
 	/* Goto next folder when user has reached the bottom of the message-list */
 	config->goto_next_folder = bonobo_config_get_boolean_with_default (
 		config->db, "/Mail/MessageList/goto_next_folder", FALSE, NULL);
@@ -1050,6 +1056,10 @@
 	
 	config_write_signatures ();
 
+	/* Address style  */
+	bonobo_config_set_long (config->db, "/Mail/Display/address_style", 
+				config->address_style, NULL);
+
 	len = g_slist_length (config->accounts);
 	bonobo_config_set_long (config->db,
 				"/Mail/Accounts/num", len, NULL);
@@ -1247,6 +1257,10 @@
 	/* Mark as seen timeout */
 	bonobo_config_set_long (config->db, "/Mail/Display/seen_timeout", 
 				config->seen_timeout, NULL);
+
+	/* Address style  */
+	bonobo_config_set_long (config->db, "/Mail/Display/address_style", 
+				config->address_style, NULL);
 	
 	/* Format */
 	bonobo_config_set_boolean (config->db, "/Mail/Format/send_html", 
@@ -1678,6 +1692,18 @@
 mail_config_set_citation_color (guint32 citation_color)
 {
 	config->citation_color = citation_color;
+}
+
+MailConfigAddressStyle 
+mail_config_get_address_display (void)
+{
+	return config->address_style;
+}
+
+void                  
+mail_config_set_address_display (MailConfigAddressStyle style)
+{
+	config->address_style = style;
 }
 
 gboolean
Index: evolution/mail/mail-config.glade
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.glade,v
retrieving revision 1.94
diff -u -r1.94 mail-config.glade
--- evolution/mail/mail-config.glade	23 May 2002 19:37:48 -0000	1.94
+++ evolution/mail/mail-config.glade	28 May 2002 15:47:21 -0000
@@ -2984,6 +2984,80 @@
 	      </child>
 	    </widget>
 	  </widget>
+
+	  <widget>
+	    <class>GtkVBox</class>
+	    <name>vbox158</name>
+	    <homogeneous>False</homogeneous>
+	    <spacing>0</spacing>
+	    <child>
+	      <padding>0</padding>
+	      <expand>True</expand>
+	      <fill>True</fill>
+	    </child>
+
+	    <widget>
+	      <class>GtkLabel</class>
+	      <name>lblMailAddressDisplay</name>
+	      <label>In folders, display sender and recipient of message using:   </label>
+	      <justify>GTK_JUSTIFY_LEFT</justify>
+	      <wrap>False</wrap>
+	      <xalign>0</xalign>
+	      <yalign>0.5</yalign>
+	      <xpad>0</xpad>
+	      <ypad>0</ypad>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+
+	    <widget>
+	      <class>GtkRadioButton</class>
+	      <name>radAddressNameAndAddress</name>
+	      <can_focus>True</can_focus>
+	      <label>Name and email address</label>
+	      <active>False</active>
+	      <draw_indicator>True</draw_indicator>
+	      <group>display_address</group>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+
+	    <widget>
+	      <class>GtkRadioButton</class>
+	      <name>radAddressName</name>
+	      <can_focus>True</can_focus>
+	      <label>Name only</label>
+	      <active>False</active>
+	      <draw_indicator>True</draw_indicator>
+	      <group>display_address</group>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+
+	    <widget>
+	      <class>GtkRadioButton</class>
+	      <name>radAddressAddress</name>
+	      <can_focus>True</can_focus>
+	      <label>Email address only</label>
+	      <active>False</active>
+	      <draw_indicator>True</draw_indicator>
+	      <group>display_address</group>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+	  </widget>
 	</widget>
       </widget>
 
Index: evolution/mail/mail-config.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.h,v
retrieving revision 1.85
diff -u -r1.85 mail-config.h
--- evolution/mail/mail-config.h	16 May 2002 20:56:36 -0000	1.85
+++ evolution/mail/mail-config.h	28 May 2002 15:47:21 -0000
@@ -110,6 +110,12 @@
 } MailConfigDisplayStyle;
 
 typedef enum {
+	MAIL_CONFIG_ADDRESS_NAME_AND_ADDRESS,
+	MAIL_CONFIG_ADDRESS_NAME,
+	MAIL_CONFIG_ADDRESS_ADDRESS
+} MailConfigAddressStyle;
+
+typedef enum {
 	MAIL_CONFIG_NOTIFY_NOT,
 	MAIL_CONFIG_NOTIFY_BEEP,
 	MAIL_CONFIG_NOTIFY_PLAY_SOUND,
@@ -192,6 +198,9 @@
 
 guint32  mail_config_get_citation_color       (void);
 void     mail_config_set_citation_color       (guint32);
+
+MailConfigAddressStyle mail_config_get_address_display (void);
+void                   mail_config_set_address_display (MailConfigAddressStyle style);
 
 const char *mail_config_get_label_name  (int label);
 void        mail_config_set_label_name  (int label, const char *name);
Index: evolution/mail/mail-preferences.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-preferences.c,v
retrieving revision 1.9
diff -u -r1.9 mail-preferences.c
--- evolution/mail/mail-preferences.c	16 May 2002 20:56:36 -0000	1.9
+++ evolution/mail/mail-preferences.c	28 May 2002 15:47:23 -0000
@@ -240,6 +240,24 @@
 	gtk_signal_connect (GTK_OBJECT (prefs->citation_color), "color-set",
 			    color_set, prefs);
 	
+	prefs->address_display_name_and_address = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radAddressNameAndAddress"));
+	gtk_toggle_button_set_active (prefs->address_display_name_and_address,
+				      mail_config_get_address_display () == MAIL_CONFIG_ADDRESS_NAME_AND_ADDRESS);
+	gtk_signal_connect (GTK_OBJECT (prefs->address_display_name_and_address), "toggled",
+			    toggle_button_toggled, prefs);
+
+	prefs->address_display_name = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radAddressName"));
+	gtk_toggle_button_set_active (prefs->address_display_name,
+				      mail_config_get_address_display () == MAIL_CONFIG_ADDRESS_NAME);
+	gtk_signal_connect (GTK_OBJECT (prefs->address_display_name), "toggled",
+			    toggle_button_toggled, prefs);
+
+	prefs->address_display_address = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radAddressAddress"));
+	gtk_toggle_button_set_active (prefs->address_display_address,
+				      mail_config_get_address_display () == MAIL_CONFIG_ADDRESS_ADDRESS);
+	gtk_signal_connect (GTK_OBJECT (prefs->address_display_address), "toggled",
+			    toggle_button_toggled, prefs);
+
 	/* Deleting Mail */
 	prefs->empty_trash = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEmptyTrashOnExit"));
 	gtk_toggle_button_set_active (prefs->empty_trash, mail_config_get_empty_trash_on_exit ());
@@ -381,6 +399,13 @@
 	rgb = colorpicker_get_color (prefs->citation_color);
 	mail_config_set_citation_color (rgb);
 	
+	if (gtk_toggle_button_get_active (prefs->address_display_name_and_address))
+		mail_config_set_address_display (MAIL_CONFIG_ADDRESS_NAME_AND_ADDRESS);
+	else if (gtk_toggle_button_get_active (prefs->address_display_name))
+		mail_config_set_address_display (MAIL_CONFIG_ADDRESS_NAME);
+	else
+		mail_config_set_address_display (MAIL_CONFIG_ADDRESS_ADDRESS);
+
 	/* Deleting Mail */
 	mail_config_set_empty_trash_on_exit (gtk_toggle_button_get_active (prefs->empty_trash));
 	
Index: evolution/mail/mail-preferences.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-preferences.h,v
retrieving revision 1.4
diff -u -r1.4 mail-preferences.h
--- evolution/mail/mail-preferences.h	29 Apr 2002 07:05:51 -0000	1.4
+++ evolution/mail/mail-preferences.h	28 May 2002 15:47:23 -0000
@@ -68,7 +68,10 @@
 	GtkOptionMenu *charset;
 	GtkToggleButton *citation_highlight;
 	GnomeColorPicker *citation_color;
-	
+	GtkToggleButton  *address_display_name_and_address;
+	GtkToggleButton  *address_display_name;
+	GtkToggleButton  *address_display_address;
+		
 	/* Deleting Mail */
 	GtkToggleButton *empty_trash;
 	GtkToggleButton *confirm_expunge;
Index: evolution/mail/message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.303
diff -u -r1.303 message-list.c
--- evolution/mail/message-list.c	16 May 2002 20:56:36 -0000	1.303
+++ evolution/mail/message-list.c	28 May 2002 15:47:26 -0000
@@ -898,7 +898,15 @@
 	case COL_ATTACHMENT:
 		return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_ATTACHMENTS) != 0);
 	case COL_FROM:
-		return (void *)camel_message_info_from(msg_info);
+		switch (mail_config_get_address_display ()) {
+		case MAIL_CONFIG_ADDRESS_NAME:
+			return (void *)camel_message_info_from_name(msg_info);
+		case MAIL_CONFIG_ADDRESS_ADDRESS:
+			return (void *)camel_message_info_from_address(msg_info);
+		case MAIL_CONFIG_ADDRESS_NAME_AND_ADDRESS:
+		default:
+			return (void *)camel_message_info_from(msg_info);
+		}
 	case COL_SUBJECT:
 		return (void *)camel_message_info_subject(msg_info);
 	case COL_SENT:
@@ -906,7 +914,15 @@
 	case COL_RECEIVED:
 		return GINT_TO_POINTER (msg_info->date_received);
 	case COL_TO:
-		return (void *)camel_message_info_to(msg_info);
+		switch (mail_config_get_address_display ()) {
+		case MAIL_CONFIG_ADDRESS_NAME:
+			return (void *)camel_message_info_to_name(msg_info);
+		case MAIL_CONFIG_ADDRESS_ADDRESS:
+			return (void *)camel_message_info_to_address(msg_info);
+		case MAIL_CONFIG_ADDRESS_NAME_AND_ADDRESS:
+		default:
+			return (void *)camel_message_info_to(msg_info);
+		}
 	case COL_SIZE:
 		return GINT_TO_POINTER (msg_info->size);
 	case COL_DELETED:
@@ -1189,6 +1205,11 @@
 {
 	MessageList *message_list = MESSAGE_LIST (object);
 
+	bonobo_event_source_client_remove_listener (message_list->db,
+						    message_list->listener_id,
+						    NULL);
+	bonobo_object_release_unref (message_list->db, NULL);
+
 	mail_async_event_destroy(message_list->async_event);
 
 	if (message_list->folder) {
@@ -1226,7 +1247,7 @@
 	g_free(message_list->cursor_uid);
 
 	g_mutex_free(message_list->hide_lock);
-
+	
 	GTK_OBJECT_CLASS (message_list_parent_class)->destroy (object);
 }
 
@@ -1262,8 +1283,23 @@
 }
 
 static void
+message_list_config_change_listener_cb (BonoboListener    *listener,
+					char              *event_name,
+					CORBA_any         *any,
+					CORBA_Environment *ev,
+					gpointer           user_data)
+{
+	MessageList *message_list = (MessageList*) user_data;
+
+	gtk_widget_queue_draw (GTK_WIDGET(message_list));
+}
+
+static void
 message_list_construct (MessageList *message_list)
 {
+	Bonobo_ConfigDatabase db;
+	CORBA_Environment ev;
+
 	gboolean construct_failed;
 	message_list->model =
 		e_tree_memory_callbacks_new (ml_tree_icon_at,
@@ -1313,6 +1349,32 @@
 	
 	gtk_signal_connect (GTK_OBJECT (message_list->tree), "click",
 			    GTK_SIGNAL_FUNC (on_click), message_list);
+
+
+	/* Set up listener for changes to config settings: */
+
+	message_list->db = CORBA_OBJECT_NIL;
+
+	CORBA_exception_init (&ev);
+
+	db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+	if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+		char *err;
+		g_error ("Very serious error, cannot activate config database '%s'",
+			 (err = bonobo_exception_get_text (&ev)));
+		g_free (err);
+		CORBA_exception_free (&ev);
+
+		return;
+ 	}
+	
+	CORBA_exception_free (&ev);
+
+	message_list->db = db;
+	message_list->listener_id =
+		bonobo_event_source_client_add_listener (db, message_list_config_change_listener_cb,
+							 "Bonobo/ConfigDatabase:change/Mail/Display:address_style",
+							 NULL, message_list);
 }
 
 GtkWidget *
Index: evolution/mail/message-list.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.h,v
retrieving revision 1.68
diff -u -r1.68 message-list.h
--- evolution/mail/message-list.h	14 Mar 2002 20:14:08 -0000	1.68
+++ evolution/mail/message-list.h	28 May 2002 15:47:27 -0000
@@ -5,6 +5,8 @@
 #include <gtk/gtkobject.h>
 #include <gtk/gtkwidget.h>
 
+#include <bonobo.h>
+#include <bonobo-conf/bonobo-config-database.h>
 #include <gal/e-table/e-table-simple.h>
 #include <gal/e-table/e-tree-scrolled.h>
 #include "mail-types.h"
@@ -87,6 +89,11 @@
 
 	/* for message/folder chagned event handling */
 	struct _MailAsyncEvent *async_event;
+
+	/* Listener ID to receive notification when the email address
+	   display mode changed, so that we can refresh the display: */
+	Bonobo_ConfigDatabase db;
+	Bonobo_EventSource_ListenerId listener_id;	
 };
 
 typedef struct {
