Index: addressbook/gui/component/autocompletion-config.c
===================================================================
--- addressbook/gui/component/autocompletion-config.c	(revision 36101)
+++ addressbook/gui/component/autocompletion-config.c	(working copy)
@@ -33,6 +33,7 @@
 
 #include <libedataserver/e-source-list.h>
 #include <libedataserverui/e-source-selector.h>
+#include <libedataserverui/e-name-selector-entry.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
@@ -43,6 +44,7 @@ typedef struct {
 	GtkWidget *control_widget;
 
 	ESourceList *source_list;
+	GConfClient *gconf;
 } AutocompletionConfig;
 
 static void
@@ -82,6 +84,7 @@ config_control_destroy_notify (void *dat
 	AutocompletionConfig *ac = (AutocompletionConfig *) data;
 
 	g_object_unref (ac->source_list);
+	g_object_unref (ac->gconf);
 
 	g_free (ac);
 }
@@ -104,17 +107,76 @@ initialize_selection (AutocompletionConf
 	}
 }
 
+static GtkWidget *
+add_section (GtkWidget *vbox, const gchar *caption, gboolean expand)
+{
+	GtkWidget *label, *hbox, *itembox;
+	gchar *txt;
+
+	g_return_val_if_fail (vbox != NULL, NULL);
+	g_return_val_if_fail (caption != NULL, NULL);
+
+	txt = g_strconcat ("<b>", caption, "</b>", NULL);
+
+	label = gtk_label_new (NULL);
+	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+	gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+	gtk_label_set_markup (GTK_LABEL (label), txt);
+
+	g_free (txt);
+
+	/* bold caption of the section */
+	gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+	hbox = gtk_hbox_new (FALSE, 12);
+
+	/* space on the left for the items in the section */
+	gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (""), FALSE, FALSE, 0);
+
+	/* itembox, here will all section items go */
+	itembox = gtk_vbox_new (FALSE, 2);
+	gtk_box_pack_start (GTK_BOX (hbox), itembox, TRUE, TRUE, 0);
+
+	gtk_box_pack_start (GTK_BOX (vbox), hbox, expand, expand, 0);
+
+	return itembox;
+}
+
+static void
+show_address_check_toggled_cb (GtkToggleButton *check, AutocompletionConfig *ac)
+{
+	g_return_if_fail (check != NULL);
+	g_return_if_fail (ac != NULL);
+	g_return_if_fail (ac->gconf != NULL);
+
+	gconf_client_set_bool (ac->gconf, FORCE_SHOW_ADDRESS, gtk_toggle_button_get_active (check), NULL);
+}
+
 EvolutionConfigControl*
 autocompletion_config_control_new (void)
 {
 	AutocompletionConfig *ac;
 	CORBA_Environment ev;
-	GtkWidget *scrolledwin;
+	GtkWidget *scrolledwin, *vbox, *itembox, *w;
 
 	ac = g_new0 (AutocompletionConfig, 1);
 
 	CORBA_exception_init (&ev);
 
+	ac->gconf = gconf_client_get_default ();
+
+	vbox = gtk_vbox_new (FALSE, 6);
+	gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
+
+	itembox = add_section (vbox, _("Autocompletion"), FALSE);
+
+	w = gtk_check_button_new_with_mnemonic (_("Always _show address of the autocompleted contact"));
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), gconf_client_get_bool (ac->gconf, FORCE_SHOW_ADDRESS, NULL));
+	g_signal_connect (w, "toggled", (GCallback)show_address_check_toggled_cb, ac);
+	gtk_box_pack_start (GTK_BOX (itembox), w, FALSE, FALSE, 0);
+
+	itembox = add_section (vbox, _("Look up in address books"), TRUE);
+
 	ac->source_list =  e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
 	/* XXX should we watch for the source list to change and
 	   update it in the control?  what about our local changes? */
@@ -137,7 +199,10 @@ autocompletion_config_control_new (void)
 	gtk_widget_show (ac->control_widget);
 	gtk_widget_show (scrolledwin);
 
-	ac->config_control = evolution_config_control_new (scrolledwin);
+	gtk_widget_show_all (vbox);
+	gtk_box_pack_start (GTK_BOX (itembox), scrolledwin, TRUE, TRUE, 0);
+
+	ac->config_control = evolution_config_control_new (vbox);
 
 	g_signal_connect (ac->control_widget, "selection_changed",
 			  G_CALLBACK (source_selection_changed), ac);
Index: addressbook/gui/component/apps_evolution_addressbook.schemas.in
===================================================================
--- addressbook/gui/component/apps_evolution_addressbook.schemas.in	(revision 36101)
+++ addressbook/gui/component/apps_evolution_addressbook.schemas.in	(working copy)
@@ -27,6 +27,18 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/evolution/addressbook/completion/show_address</key>
+      <applyto>/apps/evolution/addressbook/completion/show_address</applyto>
+      <owner>evolution-addressbook</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Show autocompleted name with an address</short>
+        <long>Whether force showing the mail address with the name of the autocompleted contact in the entry.</long>
+      </locale>
+    </schema>
+
     <!-- Select names last used uri -->
 
     <schema>
Index: addressbook/ChangeLog
===================================================================
--- addressbook/ChangeLog	(revision 36101)
+++ addressbook/ChangeLog	(working copy)
@@ -1,3 +1,15 @@
+2008-08-27  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #272391
+
+	* gui/component/apps_evolution_addressbook.schemas.in:
+	* gui/component/autocompletion-config.c: (struct AutocompletionConfig),
+	(config_control_destroy_notify), (add_section),
+	(show_address_check_toggled_cb), (autocompletion_config_control_new):
+	New UI for Edit->Preferences->Autocompletion, with the checkbox for
+	the key "/apps/evolution/addressbook/completion/show_address" to be
+	able to setup whether show mail address for the autocompleted contact.
+
 2008-08-18  Matthew Barnes  <mbarnes@redhat.com>
 
 	** Fixes part of bug #508732
