evolution r36214 - in branches/kill-bonobo: . addressbook/gui/component addressbook/gui/contact-editor addressbook/gui/widgets composer mail/importers shell shell/test smime/gui ui widgets/misc



Author: mbarnes
Date: Fri Aug 29 22:32:46 2008
New Revision: 36214
URL: http://svn.gnome.org/viewvc/evolution?rev=36214&view=rev

Log:
Progress update:

	- Contacts module partially working!

	- Implement UI merging.  Also merge EInfoLabel into ESidebar.
	  The shell window now manages the icon and labels and keeps
	  them up-to-date via EShellView properties.



Removed:
   branches/kill-bonobo/widgets/misc/e-info-label.c
   branches/kill-bonobo/widgets/misc/e-info-label.h
   branches/kill-bonobo/widgets/misc/test-info-label.c
Modified:
   branches/kill-bonobo/Makefile.am
   branches/kill-bonobo/addressbook/gui/component/Makefile.am
   branches/kill-bonobo/addressbook/gui/component/addressbook-config.c
   branches/kill-bonobo/addressbook/gui/component/addressbook-view.c
   branches/kill-bonobo/addressbook/gui/component/autocompletion-config.c
   branches/kill-bonobo/addressbook/gui/component/autocompletion-config.h
   branches/kill-bonobo/addressbook/gui/component/e-book-shell-module.c
   branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c
   branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c
   branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h
   branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c
   branches/kill-bonobo/addressbook/gui/contact-editor/e-contact-editor.h
   branches/kill-bonobo/addressbook/gui/contact-editor/eab-editor.h
   branches/kill-bonobo/addressbook/gui/widgets/Makefile.am
   branches/kill-bonobo/addressbook/gui/widgets/eab-gui-util.c
   branches/kill-bonobo/addressbook/gui/widgets/eab-popup-control.h
   branches/kill-bonobo/composer/e-msg-composer.c
   branches/kill-bonobo/mail/importers/mail-importer.c
   branches/kill-bonobo/shell/e-shell-view.c
   branches/kill-bonobo/shell/e-shell-view.h
   branches/kill-bonobo/shell/e-shell-window.c
   branches/kill-bonobo/shell/e-sidebar.c
   branches/kill-bonobo/shell/e-sidebar.h
   branches/kill-bonobo/shell/test/e-test-shell-view.c
   branches/kill-bonobo/smime/gui/Makefile.am
   branches/kill-bonobo/smime/gui/certificate-manager.c
   branches/kill-bonobo/smime/gui/certificate-manager.h
   branches/kill-bonobo/ui/evolution-contacts.ui
   branches/kill-bonobo/widgets/misc/Makefile.am
   branches/kill-bonobo/widgets/misc/e-preferences-window.c
   branches/kill-bonobo/widgets/misc/e-preferences-window.h

Modified: branches/kill-bonobo/Makefile.am
==============================================================================
--- branches/kill-bonobo/Makefile.am	(original)
+++ branches/kill-bonobo/Makefile.am	Fri Aug 29 22:32:46 2008
@@ -61,6 +61,7 @@
 	a11y			\
         widgets                 \
         shell                   \
+	$(SMIME_DIR)		\
 	addressbook		\
         art                     \
 	ui			\

Modified: branches/kill-bonobo/addressbook/gui/component/Makefile.am
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/Makefile.am	(original)
+++ branches/kill-bonobo/addressbook/gui/component/Makefile.am	Fri Aug 29 22:32:46 2008
@@ -20,7 +20,7 @@
 	$(LDAP_CFLAGS)						\
 	$(EVOLUTION_ADDRESSBOOK_CFLAGS)
 
-component_LTLIBRARIES = libevolution-addressbook.la
+module_LTLIBRARIES = libevolution-addressbook.la
 
 libevolution_addressbook_la_SOURCES = 	\
 	addressbook-config.c		\
@@ -31,9 +31,6 @@
 	autocompletion-config.h		\
 	addressbook.c			\
 	addressbook.h			\
-	addressbook-view.c		\
-	addressbook-view.h		\
-	component-factory.c		\
 	e-book-shell-module.c		\
 	e-book-shell-view.c		\
 	e-book-shell-view.h		\

Modified: branches/kill-bonobo/addressbook/gui/component/addressbook-config.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/addressbook-config.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/addressbook-config.c	Fri Aug 29 22:32:46 2008
@@ -53,8 +53,6 @@
 #define LDAPS_PORT_STRING "636"
 
 #define GLADE_FILE_NAME "ldap-config.glade"
-#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory:" BASE_VERSION
-#define LDAP_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl:" BASE_VERSION
 
 GtkWidget* supported_bases_create_table (char *name, char *string1, char *string2,
 					 int num1, int num2);

Modified: branches/kill-bonobo/addressbook/gui/component/addressbook-view.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/addressbook-view.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/addressbook-view.c	Fri Aug 29 22:32:46 2008
@@ -111,10 +111,6 @@
 
 static void addressbook_view_init	(AddressbookView      *view);
 static void addressbook_view_class_init	(AddressbookViewClass *klass);
-static void addressbook_view_dispose    (GObject *object);
-
-static ESource *find_first_source  (ESourceList *source_list);
-static ESource *get_primary_source (AddressbookView *view);
 
 static void
 set_status_message (EABView *eav, const char *message, AddressbookView *view)
@@ -234,26 +230,6 @@
 		activate_source (view, selected_source);
 }
 
-static ESource *
-find_first_source (ESourceList *source_list)
-{
-	GSList *groups, *sources, *l, *m;
-
-	groups = e_source_list_peek_groups (source_list);
-	for (l = groups; l; l = l->next) {
-		ESourceGroup *group = l->data;
-
-		sources = e_source_group_peek_sources (group);
-		for (m = sources; m; m = m->next) {
-			ESource *source = m->data;
-
-			return source;
-		}
-	}
-
-	return NULL;
-}
-
 static void
 save_primary_selection (AddressbookView *view)
 {
@@ -270,38 +246,6 @@
 				 e_source_peek_uid (source), NULL);
 }
 
-static ESource *
-get_primary_source (AddressbookView *view)
-{
-	AddressbookViewPrivate *priv = view->priv;
-	ESource *source;
-	char *uid;
-
-	uid = gconf_client_get_string (priv->gconf_client,
-				       "/apps/evolution/addressbook/display/primary_addressbook",
-				       NULL);
-	if (uid) {
-		source = e_source_list_peek_source_by_uid (priv->source_list, uid);
-		g_free (uid);
-	} else {
-		/* Try to create a default if there isn't one */
-		source = find_first_source (priv->source_list);
-	}
-
-	return source;
-}
-
-static void
-load_primary_selection (AddressbookView *view)
-{
-	AddressbookViewPrivate *priv = view->priv;
-	ESource *source;
-
-	source = get_primary_source (view);
-	if (source)
-		e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (priv->selector), source);
-}
-
 /* Folder popup menu callbacks */
 typedef struct {
 	AddressbookView *view;
@@ -377,31 +321,6 @@
 }
 
 static void
-new_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data)
-{
-	addressbook_config_create_new_source (gtk_widget_get_toplevel(ep->target->widget));
-}
-
-static void
-save_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data)
-{
-	AddressbookView *view = data;
-	EABView *v = get_current_view (view);
-       	if (v)
-		eab_view_save_as (v, TRUE);
-}
-
-static void
-edit_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data)
-{
-	AddressbookView *view = data;
-	if (view)
-		edit_addressbook_folder (view);
-}
-
-/* Callbacks.  */
-
-static void
 primary_source_selection_changed_callback (ESourceSelector *selector,
 					   AddressbookView *view)
 {
@@ -409,55 +328,6 @@
 	save_primary_selection (view);
 }
 
-static EPopupItem abv_source_popups[] = {
-	{ E_POPUP_ITEM, "10.new", N_("_New Address Book"), new_addressbook_cb, NULL, "address-book-new", 0, 0 },
- 	{ E_POPUP_ITEM, "20.saveasvcard", N_("Save As vCard..."), save_addressbook_cb, NULL,"document-save-as", 0, EAB_POPUP_SOURCE_PRIMARY },
-
-	{ E_POPUP_BAR,  "30.bar" },
-	{ E_POPUP_ITEM, "30.delete", N_("_Delete"), delete_addressbook_cb, NULL, "edit-delete", 0, EAB_POPUP_SOURCE_USER|EAB_POPUP_SOURCE_PRIMARY },
-
-	{ E_POPUP_BAR,  "99.bar" },
-	{ E_POPUP_ITEM, "99.properties", N_("_Properties"), edit_addressbook_cb, NULL,"document-properties", 0, EAB_POPUP_SOURCE_PRIMARY },
-};
-
-static void
-abv_source_popup_free(EPopup *ep, GSList *list, void *data)
-{
-	g_slist_free(list);
-}
-
-static gboolean
-popup_event_callback(ESourceSelector *selector, ESource *source, GdkEventButton *event, AddressbookView *view)
-{
-	EABPopup *ep;
-	EABPopupTargetSource *t;
-	GSList *menus = NULL;
-	int i;
-	GtkMenu *menu;
-
-	/** @HookPoint-EABPopup:Addressbook Source Selector Context Menu
-	 * @Id: org.gnome.evolution.addressbook.source.popup
-	 * @Class: org.gnome.evolution.addresbook.popup:1.0
-	 * @Target: EABPopupTargetSource
-	 *
-	 * The context menu on the source selector in the contacts window.
-	 */
-
-	ep = eab_popup_new("org.gnome.evolution.addressbook.source.popup");
-	t = eab_popup_target_new_source(ep, selector);
-	t->target.widget = (GtkWidget *)view->priv->notebook;
-
-	for (i=0;i<sizeof(abv_source_popups)/sizeof(abv_source_popups[0]);i++)
-		menus = g_slist_prepend(menus, &abv_source_popups[i]);
-
-	e_popup_add_items((EPopup *)ep, menus, NULL, abv_source_popup_free, view);
-
-	menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0);
-	gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event?event->button:0, event?event->time:gtk_get_current_event_time());
-
-	return TRUE;
-}
-
 static gboolean
 selector_tree_drag_drop (GtkWidget *widget,
 			 GdkDragContext *context,
@@ -696,58 +566,6 @@
 	gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), NULL, GTK_TREE_VIEW_DROP_BEFORE);
 }
 
-
-static void
-destroy_callback(gpointer data, GObject *where_object_was)
-{
-	AddressbookView *view = data;
-	g_object_unref (view);
-}
-
-GType
-addressbook_view_get_type (void)
-{
-	static GType type = 0;
-
-	if (!type) {
-		static const GTypeInfo info =  {
-			sizeof (AddressbookViewClass),
-			NULL,           /* base_init */
-			NULL,           /* base_finalize */
-			(GClassInitFunc) addressbook_view_class_init,
-			NULL,           /* class_finalize */
-			NULL,           /* class_data */
-			sizeof (EABView),
-			0,             /* n_preallocs */
-			(GInstanceInitFunc) addressbook_view_init,
-		};
-
-		type = g_type_register_static (PARENT_TYPE, "AddressbookView", &info, 0);
-	}
-
-	return type;
-}
-
-static void
-addressbook_view_class_init (AddressbookViewClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	object_class->dispose = addressbook_view_dispose;
-
-	parent_class = g_type_class_peek_parent (klass);
-}
-
-static gboolean
-source_selector_key_press_event_callback (GtkWidget *widget, GdkEventKey *event, AddressbookView *view)
-{
-	if (event->keyval == GDK_Delete) {
-		delete_addressbook_folder (view);
-		return TRUE;
-	}
-	return FALSE;
-}
-
 static void
 addressbook_view_init (AddressbookView *view)
 {
@@ -755,84 +573,21 @@
 	GtkWidget *selector_scrolled_window;
 	AtkObject *a11y;
 
-	view->priv =
-		priv = g_new0 (AddressbookViewPrivate, 1);
-
-	priv->gconf_client = addressbook_component_peek_gconf_client (addressbook_component_peek ());
-
-	priv->uid_to_view = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)g_object_unref);
-	priv->uid_to_editor = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)g_free);
-
-	priv->notebook = gtk_notebook_new ();
-	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);
-	gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE);
-
-	g_object_weak_ref (G_OBJECT (priv->notebook), destroy_callback, view);
-
-	/* Create the control. */
-	priv->folder_view_control = bonobo_control_new (priv->notebook);
-
-	gtk_widget_show (priv->notebook);
-
-	e_book_get_addressbooks (&priv->source_list, NULL);
-	g_signal_connect (priv->source_list,
-			  "changed",
-			  G_CALLBACK (source_list_changed_cb), view);
-
-	priv->creatable_items_handler = e_user_creatable_items_handler_new ("contacts", NULL, NULL);
 	priv->menu = eab_menu_new("org.gnome.evolution.addressbook.view");
 
 	g_signal_connect (priv->folder_view_control, "activate",
 			  G_CALLBACK (control_activate_cb), view);
 
-	priv->activity_handler = e_activity_handler_new ();
-
-	priv->statusbar_widget = e_task_bar_new ();
-	gtk_widget_show (priv->statusbar_widget);
-
-	e_activity_handler_attach_task_bar (priv->activity_handler,
-					    E_TASK_BAR (priv->statusbar_widget));
-
-	priv->info_widget = e_info_label_new("x-office-address-book");
-	e_info_label_set_info((EInfoLabel*)priv->info_widget, _("Contacts"), "");
-	gtk_widget_show (priv->info_widget);
-
-	priv->selector = e_source_selector_new (priv->source_list);
-
 	g_signal_connect  (priv->selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), view);
 	g_signal_connect  (priv->selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave), view);
 	g_signal_connect  (priv->selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop), view);
 	g_signal_connect  (priv->selector, "drag-data-received", G_CALLBACK (selector_tree_drag_data_received), view);
 	gtk_drag_dest_set (priv->selector, GTK_DEST_DEFAULT_ALL, drag_types, num_drag_types, GDK_ACTION_COPY | GDK_ACTION_MOVE);
-	a11y = gtk_widget_get_accessible (GTK_WIDGET (priv->selector));
-	atk_object_set_name (a11y, _("Contact Source Selector"));
-
-	e_source_selector_show_selection (E_SOURCE_SELECTOR (priv->selector), FALSE);
-	gtk_widget_show (priv->selector);
-
-	selector_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window), GTK_SHADOW_IN);
-	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selector_scrolled_window),
-					GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-	gtk_container_add (GTK_CONTAINER (selector_scrolled_window), priv->selector);
-	gtk_widget_show (selector_scrolled_window);
-
-	priv->sidebar_widget = gtk_vbox_new(FALSE, 0);
-	gtk_box_pack_start(GTK_BOX (priv->sidebar_widget), priv->info_widget, FALSE, TRUE, 0);
-	gtk_box_pack_start(GTK_BOX (priv->sidebar_widget), selector_scrolled_window, TRUE, TRUE, 0);
-	gtk_widget_show (priv->sidebar_widget);
 
 	g_signal_connect_object (priv->selector, "primary_selection_changed",
 				 G_CALLBACK (primary_source_selection_changed_callback),
 				 G_OBJECT (view), 0);
-	g_signal_connect_after (priv->selector, "key_press_event",
-		       		G_CALLBACK (source_selector_key_press_event_callback),
-				G_OBJECT (view));
-	g_signal_connect_object (priv->selector, "popup_event",
-				 G_CALLBACK (popup_event_callback),
-				 G_OBJECT (view), 0);
 
-	load_primary_selection (view);
 	load_uri_for_selection (E_SOURCE_SELECTOR (priv->selector), view, TRUE);
 }
 
@@ -849,43 +604,6 @@
 	gtk_widget_destroy (GTK_WIDGET (closure->editor));
 }
 
-static void
-addressbook_view_dispose (GObject *object)
-{
-	AddressbookView *view = ADDRESSBOOK_VIEW (object);
-	AddressbookViewPrivate *priv = view->priv;
-
-	if (view->priv) {
-		if (priv->book)
-			g_object_unref (priv->book);
-
-		g_free(priv->passwd);
-
-		if (priv->source_list)
-			g_object_unref (priv->source_list);
-
-		if (priv->uid_to_view)
-			g_hash_table_destroy (priv->uid_to_view);
-
-		if (priv->uid_to_editor) {
-			g_hash_table_foreach (priv->uid_to_editor, (GHFunc)destroy_editor, NULL);
-			g_hash_table_destroy (priv->uid_to_editor);
-		}
-
-		if (priv->creatable_items_handler)
-			g_object_unref (priv->creatable_items_handler);
-
-		if (priv->menu)
-			g_object_unref (priv->menu);
-
-		g_free (view->priv);
-		view->priv = NULL;
-	}
-
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		(* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
 typedef struct {
 	EABView *view;
 	ESource *source;
@@ -1033,52 +751,6 @@
 	}
 }
 
-AddressbookView *
-addressbook_view_new (void)
-{
-	return g_object_new (ADDRESSBOOK_TYPE_VIEW, NULL);
-}
-
-EActivityHandler*
-addressbook_view_peek_activity_handler (AddressbookView *view)
-{
-	g_return_val_if_fail (ADDRESSBOOK_IS_VIEW (view), NULL);
-
-	return view->priv->activity_handler;
-}
-
-GtkWidget*
-addressbook_view_peek_info_label (AddressbookView *view)
-{
-	g_return_val_if_fail (ADDRESSBOOK_IS_VIEW (view), NULL);
-
-	return view->priv->info_widget;
-}
-
-GtkWidget*
-addressbook_view_peek_sidebar (AddressbookView *view)
-{
-	g_return_val_if_fail (ADDRESSBOOK_IS_VIEW (view), NULL);
-
-	return view->priv->sidebar_widget;
-}
-
-GtkWidget*
-addressbook_view_peek_statusbar (AddressbookView *view)
-{
-	g_return_val_if_fail (ADDRESSBOOK_IS_VIEW (view), NULL);
-
-	return view->priv->statusbar_widget;
-}
-
-BonoboControl*
-addressbook_view_peek_folder_view (AddressbookView *view)
-{
-	g_return_val_if_fail (ADDRESSBOOK_IS_VIEW (view), NULL);
-
-	return view->priv->folder_view_control;
-}
-
 void
 addressbook_view_edit_contact (AddressbookView* view,
 			       const char* source_uid,

Modified: branches/kill-bonobo/addressbook/gui/component/autocompletion-config.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/autocompletion-config.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/autocompletion-config.c	Fri Aug 29 22:32:46 2008
@@ -16,47 +16,32 @@
  * License along with this program; if not, write to the
  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
- *
- * Authors: Chris Toshok <toshok ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
 #include "autocompletion-config.h"
 
-#include "Evolution.h"
-
-#include <bonobo/bonobo-exception.h>
-
-#include <libedataserver/e-source-list.h>
-#include <libedataserverui/e-source-selector.h>
+#include <e-shell.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
-
-
-typedef struct {
-	EvolutionConfigControl *config_control;
-
-	GtkWidget *control_widget;
-
-	ESourceList *source_list;
-} AutocompletionConfig;
+#include <e-preferences-window.h>
+#include <libedataserver/e-source-list.h>
+#include <libedataserverui/e-source-selector.h>
 
 static void
-source_selection_changed (ESourceSelector *selector,
-			  AutocompletionConfig *ac)
+source_selection_changed_cb (ESourceSelector *source_selector)
 {
+	ESourceList *source_list;
 	GSList *selection;
 	GSList *l;
 	GSList *groups;
 
+	source_list = e_source_selector_get_source_list (source_selector);
+
 	/* first we clear all the completion flags from all sources */
-	for (groups = e_source_list_peek_groups (ac->source_list); groups; groups = groups->next) {
+	for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) {
 		ESourceGroup *group = E_SOURCE_GROUP (groups->data);
 		GSList *sources;
+
 		for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
 			ESource *source = E_SOURCE (sources->data);
 
@@ -66,86 +51,78 @@
 
 	/* then we loop over the selector's selection, setting the
 	   property on those sources */
-	selection = e_source_selector_get_selection (selector);
+	selection = e_source_selector_get_selection (source_selector);
 	for (l = selection; l; l = l->next) {
-		e_source_set_property (E_SOURCE (l->data), "completion", "true");
+		ESource *source = E_SOURCE (l->data);
+
+		e_source_set_property (source, "completion", "true");
 	}
 	e_source_selector_free_selection (selection);
 
-	e_source_list_sync (ac->source_list, NULL); /* XXX we should pop up a dialog if this fails */
-}
-
-static void
-config_control_destroy_notify (void *data,
-			       GObject *where_the_config_control_was)
-{
-	AutocompletionConfig *ac = (AutocompletionConfig *) data;
-
-	g_object_unref (ac->source_list);
-
-	g_free (ac);
+	/* XXX we should pop up a dialog if this fails */
+	e_source_list_sync (source_list, NULL);
 }
 
 static void
-initialize_selection (AutocompletionConfig *ac)
+initialize_selection (ESourceSelector *source_selector)
 {
+	ESourceList *source_list;
 	GSList *groups;
 
-	for (groups = e_source_list_peek_groups (ac->source_list); groups; groups = groups->next) {
+	source_list = e_source_selector_get_source_list (source_selector);
+
+	for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) {
 		ESourceGroup *group = E_SOURCE_GROUP (groups->data);
 		GSList *sources;
+
 		for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
 			ESource *source = E_SOURCE (sources->data);
-			const char *completion = e_source_get_property (source, "completion");
+			const char *completion;
+
+			completion = e_source_get_property (source, "completion");
 			if (completion && !g_ascii_strcasecmp (completion, "true"))
-				e_source_selector_select_source (E_SOURCE_SELECTOR (ac->control_widget),
-								 source);
+				e_source_selector_select_source (source_selector, source);
 		}
 	}
 }
 
-EvolutionConfigControl*
-autocompletion_config_control_new (void)
+void
+autocompletion_config_init (void)
 {
-	AutocompletionConfig *ac;
-	CORBA_Environment ev;
-	GtkWidget *scrolledwin;
-
-	ac = g_new0 (AutocompletionConfig, 1);
+	ESourceList *source_list;
+	GtkWidget *scrolled_window;
+	GtkWidget *source_selector;
+	GtkWidget *preferences_window;
 
-	CORBA_exception_init (&ev);
+	source_list = e_source_list_new_for_gconf_default (
+		"/apps/evolution/addressbook/sources");
 
-	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? */
 	/*	g_signal_connect (ac->source_list, "changed", G_CALLBACK (source_list_changed), ac); */
 
-	scrolledwin = gtk_scrolled_window_new (NULL, NULL);
-
-	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwin),
-					GTK_POLICY_AUTOMATIC,
-					GTK_POLICY_AUTOMATIC);
-	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwin),
-					     GTK_SHADOW_IN);
-
-	ac->control_widget = e_source_selector_new (ac->source_list);
-
-	gtk_container_add (GTK_CONTAINER (scrolledwin), ac->control_widget);
-
-	initialize_selection (ac);
-
-	gtk_widget_show (ac->control_widget);
-	gtk_widget_show (scrolledwin);
-
-	ac->config_control = evolution_config_control_new (scrolledwin);
-
-	g_signal_connect (ac->control_widget, "selection_changed",
-			  G_CALLBACK (source_selection_changed), ac);
-
-	g_object_weak_ref (G_OBJECT (ac->config_control), config_control_destroy_notify, ac);
-
-	CORBA_exception_free (&ev);
-
-	return ac->config_control;
+	scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+	gtk_scrolled_window_set_policy (
+		GTK_SCROLLED_WINDOW (scrolled_window),
+		GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type (
+		GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
+	gtk_widget_show (scrolled_window);
+
+	source_selector = e_source_selector_new (source_list);
+	g_signal_connect (
+		source_selector, "selection_changed",
+		G_CALLBACK (source_selection_changed_cb), NULL);
+	gtk_container_add (GTK_CONTAINER (scrolled_window), source_selector);
+	gtk_widget_show (source_selector);
+
+	initialize_selection (E_SOURCE_SELECTOR (source_selector));
+
+	e_preferences_window_add_page (
+		e_shell_get_preferences_window (),
+		"autocompletion",
+		"preferences-autocompletion",
+		_("Autocompletion"),
+		scrolled_window,
+		200);
 }
-

Modified: branches/kill-bonobo/addressbook/gui/component/autocompletion-config.h
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/autocompletion-config.h	(original)
+++ branches/kill-bonobo/addressbook/gui/component/autocompletion-config.h	Fri Aug 29 22:32:46 2008
@@ -23,8 +23,12 @@
 #ifndef _AUTOCOMPLETION_CONFIG_H
 #define _AUTOCOMPLETION_CONFIG_H
 
-#include "evolution-config-control.h"
+#include <glib.h>
 
-EvolutionConfigControl* autocompletion_config_control_new (void);
+G_BEGIN_DECLS
+
+void		autocompletion_config_init	(void);
+
+G_END_DECLS
 
 #endif /* _AUTOCOMPLETION_CONFIG_H */

Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-module.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-module.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-module.c	Fri Aug 29 22:32:46 2008
@@ -18,11 +18,22 @@
  * Boston, MA 02110-1301, USA.
  */
 
+#include <string.h>
+#include <glib/gi18n.h>
+#include <libebook/e-book.h>
+#include <libedataserver/e-url.h>
+#include <libedataserver/e-source.h>
+#include <libedataserver/e-source-list.h>
+#include <libedataserver/e-source-group.h>
+
 #include <e-shell.h>
 #include <e-shell-module.h>
 #include <e-shell-window.h>
 
-#include "e-book-shell-view.h"
+#include <eab-gui-util.h>
+#include <e-book-shell-view.h>
+#include <addressbook-config.h>
+#include <autocompletion-config.h>
 
 #define MODULE_NAME		"addressbook"
 #define MODULE_ALIASES		""
@@ -174,7 +185,7 @@
 	if (g_str_equal (action_name, "contact-new"))
 		eab_show_contact_editor (book, contact, TRUE, TRUE);
 
-	if (g_str_equal (action_name, "contact-list-new") == 0)
+	if (g_str_equal (action_name, "contact-list-new"))
 		eab_show_contact_list_editor (book, contact, TRUE, TRUE);
 
 	g_object_unref (contact);
@@ -189,6 +200,7 @@
 	GConfClient *client;
 	ESourceList *source_list;
 	const gchar *key;
+	gchar *uid;
 
 	/* This callback is used for both contacts and contact lists. */
 
@@ -260,6 +272,8 @@
 static gboolean
 book_module_shutdown (EShellModule *shell_module)
 {
+	/* FIXME */
+	return TRUE;
 }
 
 static gboolean
@@ -282,7 +296,7 @@
 		return FALSE;
 	}
 
-	while (*cp != NULL) {
+	while (*cp != '\0') {
 		gchar *header;
 		gchar *content;
 		gsize length;
@@ -345,7 +359,7 @@
 		source_entries, G_N_ELEMENTS (source_entries));
 }
 
-static EShellmoduleInfo module_info = {
+static EShellModuleInfo module_info = {
 
 	MODULE_NAME,
 	MODULE_ALIASES,
@@ -378,4 +392,6 @@
 	g_signal_connect_swapped (
 		shell, "window-created",
 		G_CALLBACK (book_module_window_created), shell_module);
+
+	autocompletion_config_init ();
 }

Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c	Fri Aug 29 22:32:46 2008
@@ -20,8 +20,11 @@
 
 #include "e-book-shell-view-private.h"
 
+#include <e-util/e-error.h>
 #include <e-util/e-util.h>
 
+#include <addressbook-config.h>
+
 static void
 action_address_book_copy_cb (GtkAction *action,
                              EBookShellView *book_shell_view)
@@ -101,6 +104,19 @@
 }
 
 static void
+action_address_book_new_cb (GtkAction *action,
+                            EBookShellView *book_shell_view)
+{
+	EShellView *shell_view;
+	EShellWindow *shell_window;
+
+	shell_view = E_SHELL_VIEW (book_shell_view);
+	shell_window = e_shell_view_get_window (shell_view);
+
+	addressbook_config_create_new_source (GTK_WIDGET (shell_window));
+}
+
+static void
 action_address_book_properties_cb (GtkAction *action,
                                    EBookShellView *book_shell_view)
 {
@@ -127,7 +143,7 @@
 		GtkWidget *editor;
 
 		editor = addressbook_config_edit_source (
-			GTK_WINDOW (shell_window), source);
+			GTK_WIDGET (shell_window), source);
 
 		closure = g_new (EditorUidClosure, 1);
 		closure->editor = editor;
@@ -342,19 +358,26 @@
 	  N_("Move the contacts of the selected address book to another"),
 	  G_CALLBACK (action_address_book_move_cb) },
 
+	{ "address-book-new",
+	  "address-book-new",
+	  N_("_New Address Book"),
+	  NULL,
+	  N_("Create a new address book"),
+	  G_CALLBACK (action_address_book_new_cb) },
+
 	{ "address-book-properties",
 	  GTK_STOCK_PROPERTIES,
 	  N_("Address _Book Properties"),
 	  NULL,
-	  N_("Change the properties of the selected address book"),
+	  N_("Show properties of the selected address book"),
 	  G_CALLBACK (action_address_book_properties_cb) },
 
 	{ "address-book-save-as",
 	  GTK_STOCK_SAVE_AS,
-	  N_("S_ave Address Book as VCard"),
+	  N_("S_ave Address Book as vCard"),
 	  NULL,
-	  N_("Save the contacts of the selected address book as a VCard"),
-	  G_CALLBACK (action_address_book_save_as) },
+	  N_("Save the contacts of the selected address book as a vCard"),
+	  G_CALLBACK (action_address_book_save_as_cb) },
 
 	{ "address-book-stop",
 	  GTK_STOCK_STOP,
@@ -435,9 +458,9 @@
 
 	{ "contact-save-as",
 	  GTK_STOCK_SAVE_AS,
-	  N_("Save as VCard..."),
+	  N_("Save as vCard..."),
 	  NULL,
-	  N_("Save selected contacts as a VCard"),
+	  N_("Save selected contacts as a vCard"),
 	  G_CALLBACK (action_contact_save_as_cb) },
 
 	{ "contact-select-all",
@@ -452,7 +475,39 @@
 	  N_("_Send Message to Contact..."),
 	  NULL,
 	  N_("Send a message to the selected contacts"),
-	  G_CALLBACK (action_contact_send_message_cb) }
+	  G_CALLBACK (action_contact_send_message_cb) },
+
+	/*** Menus ***/
+
+	{ "actions-menu",
+	  NULL,
+	  N_("_Actions"),
+	  NULL,
+	  NULL,
+	  NULL },
+
+	/*** Address Book Popup Actions ***/
+
+	{ "address-book-popup-delete",
+	  GTK_STOCK_DELETE,
+	  NULL,
+	  NULL,
+	  N_("Delete this address book"),
+	  G_CALLBACK (action_address_book_delete_cb) },
+
+	{ "address-book-popup-properties",
+	  GTK_STOCK_PROPERTIES,
+	  NULL,
+	  NULL,
+	  N_("Show properties of this address book"),
+	  G_CALLBACK (action_address_book_properties_cb) },
+
+	{ "address-book-popup-save-as",
+	  GTK_STOCK_SAVE_AS,
+	  N_("_Save as vCard..."),
+	  NULL,
+	  N_("Save the contents of this address book as a vCard"),
+	  G_CALLBACK (action_address_book_save_as_cb) }
 };
 
 static GtkToggleActionEntry contact_toggle_entries[] = {
@@ -473,6 +528,7 @@
 	EShellWindow *shell_window;
 	GtkActionGroup *action_group;
 	GtkUIManager *manager;
+	GtkAction *action;
 	const gchar *domain;
 
 	shell_view = E_SHELL_VIEW (book_shell_view);
@@ -491,4 +547,9 @@
 		action_group, contact_toggle_entries,
 		G_N_ELEMENTS (contact_toggle_entries), book_shell_view);
 	gtk_ui_manager_insert_action_group (manager, action_group, 0);
+
+	/* Fine tuning. */
+
+	action = ACTION (CONTACT_DELETE);
+	g_object_set (action, "short-label", _("Delete"), NULL);
 }

Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.c	Fri Aug 29 22:32:46 2008
@@ -20,12 +20,70 @@
 
 #include "e-book-shell-view-private.h"
 
+static gboolean
+book_shell_view_show_popup_menu (GdkEventButton *event,
+                                 EShellView *shell_view)
+{
+	GtkWidget *menu;
+	EShellWindow *shell_window;
+	const gchar *widget_path;
+
+	widget_path = "/address-book-popup";
+	shell_window = e_shell_view_get_window (shell_view);
+	menu = e_shell_window_get_managed_widget (shell_window, widget_path);
+
+	if (event != NULL)
+		gtk_menu_popup (
+			GTK_MENU (menu), NULL, NULL, NULL, NULL,
+			event->button, event->time);
+	else
+		gtk_menu_popup (
+			GTK_MENU (menu), NULL, NULL, NULL, NULL,
+			0, gtk_get_current_event_time ());
+
+	return TRUE;
+}
+
+static gboolean
+book_shell_view_selector_button_press_event_cb (EShellView *shell_view,
+                                                GdkEventButton *event)
+{
+	if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
+		return book_shell_view_show_popup_menu (event, shell_view);
+
+	return FALSE;
+}
+
+static gboolean
+book_shell_view_selector_popup_menu_cb (EShellView *shell_view)
+{
+	return book_shell_view_show_popup_menu (NULL, shell_view);
+}
+
+static gboolean
+book_shell_view_selector_key_press_event_cb (EShellView *shell_view,
+                                             GdkEventKey *event)
+{
+	EShellWindow *shell_window;
+
+	/* Needed for the ACTION() macro. */
+	shell_window = e_shell_view_get_window (shell_view);
+
+	if (event->keyval == GDK_Delete) {
+		gtk_action_activate (ACTION (ADDRESS_BOOK_DELETE));
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
 void
 e_book_shell_view_private_init (EBookShellView *book_shell_view)
 {
 	EBookShellViewPrivate *priv = book_shell_view->priv;
 	GHashTable *uid_to_view;
 	GHashTable *uid_to_editor;
+	GtkWidget *container;
 	GtkWidget *widget;
 
 	uid_to_view = g_hash_table_new_full (
@@ -39,8 +97,11 @@
 		(GDestroyNotify) g_free);
 
 	priv->contact_actions = gtk_action_group_new ("contacts");
+	priv->activity_handler = e_activity_handler_new ();
+	priv->uid_to_view = uid_to_view;
+	priv->uid_to_editor = uid_to_editor;
 
-	e_book_shell_view_actions_init (book_shell_view);
+	e_book_get_addressbooks (&priv->source_list, NULL);
 
 	widget = gtk_notebook_new ();
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
@@ -48,7 +109,43 @@
 	priv->notebook = g_object_ref_sink (widget);
 	gtk_widget_show (widget);
 
-	e_book_get_addressbooks (&priv->source_list, NULL);
+	widget = e_task_bar_new ();
+	e_activity_handler_attach_task_bar (
+		priv->activity_handler, E_TASK_BAR (widget));
+	priv->task_bar = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	widget = gtk_scrolled_window_new (NULL, NULL);
+	gtk_scrolled_window_set_policy (
+		GTK_SCROLLED_WINDOW (widget),
+		GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type (
+		GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
+	priv->scrolled_window = g_object_ref_sink (widget);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = e_source_selector_new (priv->source_list);
+	e_source_selector_show_selection (E_SOURCE_SELECTOR (widget), FALSE);
+	gtk_container_add (GTK_CONTAINER (container), widget);
+	priv->selector = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	g_signal_connect_swapped (
+		widget, "button-press-event",
+		G_CALLBACK (book_shell_view_selector_button_press_event_cb),
+		book_shell_view);
+
+	g_signal_connect_swapped (
+		widget, "key-press-event",
+		G_CALLBACK (book_shell_view_selector_key_press_event_cb),
+		book_shell_view);
+
+	g_signal_connect_swapped (
+		widget, "popup-menu",
+		G_CALLBACK (book_shell_view_selector_popup_menu_cb),
+		book_shell_view);
 }
 
 void
@@ -56,11 +153,20 @@
 {
 	EBookShellViewPrivate *priv = book_shell_view->priv;
 
+	DISPOSE (priv->contact_actions);
+
 	DISPOSE (priv->notebook);
-	DISPOSE (priv->source_list);
+	DISPOSE (priv->scrolled_window);
+	DISPOSE (priv->selector);
+	DISPOSE (priv->task_bar);
+
+	DISPOSE (priv->activity_handler);
 
 	g_hash_table_remove_all (priv->uid_to_view);
 	g_hash_table_remove_all (priv->uid_to_editor);
+
+	DISPOSE (priv->book);
+	DISPOSE (priv->source_list);
 }
 
 void
@@ -70,6 +176,8 @@
 
 	g_hash_table_destroy (priv->uid_to_view);
 	g_hash_table_destroy (priv->uid_to_editor);
+
+	g_free (priv->password);
 }
 
 EABView *
@@ -87,3 +195,13 @@
 
 	return EAB_VIEW (widget);
 }
+
+void
+e_book_shell_view_editor_weak_notify (EditorUidClosure *closure,
+                                      GObject *where_the_object_was)
+{
+	GHashTable *hash_table;
+
+	hash_table = closure->view->priv->uid_to_editor;
+	g_hash_table_remove (hash_table, closure->uid);
+}

Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h	(original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-private.h	Fri Aug 29 22:32:46 2008
@@ -23,6 +23,16 @@
 
 #include "e-book-shell-view.h"
 
+#include <string.h>
+#include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
+#include <libebook/e-book.h>
+#include <libedataserverui/e-source-selector.h>
+
+#include <eab-menu.h>
+#include <e-activity-handler.h>
+#include <e-addressbook-view.h>
+
 #include <e-book-shell-view-actions.h>
 
 #define E_BOOK_SHELL_VIEW_GET_PRIVATE(obj) \
@@ -60,15 +70,12 @@
 	/*** Other Stuff ***/
 
 	GtkWidget *notebook;
-	BonoboControl *folder_view_control;
+	GtkWidget *scrolled_window;
+	GtkWidget *selector;
+	GtkWidget *task_bar;
 
-	GtkWidget *statusbar_widget;
 	EActivityHandler *activity_handler;
 
-	GtkWidget *info_widget;
-	GtkWidget *sidebar_widget;
-	GtkWidget *selector;
-
 	GHashTable *uid_to_view;
 	GHashTable *uid_to_editor;
 
@@ -76,7 +83,6 @@
 	guint activity_id;
 	ESourceList *source_list;
 	gchar *password;
-	EUserCreatableItemsHandler *creatable_items_handler;
 
 	EABMenu *menu;
 };
@@ -94,6 +100,9 @@
 					(EBookShellView *book_shell_view);
 EABView *	e_book_shell_view_get_current_view
 					(EBookShellView *book_shell_view);
+void		e_book_shell_view_editor_weak_notify
+					(EditorUidClosure *closure,
+					 GObject *where_the_object_was);
 
 G_END_DECLS
 

Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view.c	Fri Aug 29 22:32:46 2008
@@ -23,6 +23,48 @@
 GType e_book_shell_view_type = 0;
 static gpointer parent_class;
 
+static ESource *
+book_shell_view_get_primary_source (EBookShellView *book_shell_view)
+{
+	GConfClient *client;
+	ESourceList *source_list;
+	ESource *source = NULL;
+	const gchar *key;
+	gchar *uid;
+
+	source_list = book_shell_view->priv->source_list;
+
+	client = gconf_client_get_default ();
+	key = "/apps/evolution/addressbook/display/primary_addressbook";
+	uid = gconf_client_get_string (client, key, NULL);
+	g_object_unref (client);
+
+	if (uid != NULL) {
+		source = e_source_list_peek_source_by_uid (source_list, uid);
+		g_free (uid);
+	} else {
+		GSList *groups;
+
+		/* Dig up the first source in the source list.
+		 * XXX libedataserver should provide API for this. */
+		groups = e_source_list_peek_groups (source_list);
+		while (groups != NULL) {
+			ESourceGroup *source_group = groups->data;
+			GSList *sources;
+
+			sources = e_source_group_peek_sources (source_group);
+			if (sources != NULL) {
+				source = sources->data;
+				break;
+			}
+
+			groups = g_slist_next (groups);
+		}
+	}
+
+	return source;
+}
+
 static void
 book_shell_view_update_actions (EBookShellView *book_shell_view,
                                 EABView *view)
@@ -111,16 +153,6 @@
 }
 
 static void
-book_shell_view_editor_weak_notify (EditorUidClosure *closure,
-                                    GObject *where_the_object_was)
-{
-	GHashTable *hash_table;
-
-	hash_table = closure->view->priv->uid_to_editor;
-	g_hash_table_remove (hash_table, closure->uid);
-}
-
-static void
 book_shell_view_source_list_changed_cb (EBookShellView *book_shell_view,
                                         ESourceList *source_list)
 {
@@ -162,7 +194,7 @@
 		closure = g_hash_table_lookup (priv->uid_to_editor, uid);
 		g_object_weak_unref (
 			G_OBJECT (closure->editor), (GWeakNotify)
-			book_shell_view_editor_weak_notify, closure);
+			e_book_shell_view_editor_weak_notify, closure);
 		gtk_widget_destroy (closure->editor);
 		g_hash_table_remove (priv->uid_to_editor, uid);
 	}
@@ -196,19 +228,56 @@
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
+static void
+book_shell_view_constructed (GObject *object)
+{
+	e_book_shell_view_actions_init (E_BOOK_SHELL_VIEW (object));
+
+	/* Chain up to parent's constructed() method. */
+	G_OBJECT_CLASS (parent_class)->constructed (object);
+}
+
 static GtkWidget *
 book_shell_view_get_content_widget (EShellView *shell_view)
 {
+	EBookShellViewPrivate *priv;
+
+	priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (shell_view);
+
+	return priv->notebook;
 }
 
 static GtkWidget *
 book_shell_view_get_sidebar_widget (EShellView *shell_view)
 {
+	EBookShellViewPrivate *priv;
+
+	priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (shell_view);
+
+	return priv->scrolled_window;
 }
 
 static GtkWidget *
 book_shell_view_get_status_widget (EShellView *shell_view)
 {
+	EBookShellViewPrivate *priv;
+
+	priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (shell_view);
+
+	return priv->task_bar;
+}
+
+static void
+book_shell_view_changed (EShellView *shell_view,
+                         gboolean visible)
+{
+	EBookShellViewPrivate *priv;
+	GtkActionGroup *action_group;
+
+	priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (shell_view);
+
+	action_group = priv->contact_actions;
+	gtk_action_group_set_visible (action_group, visible);
 }
 
 static void
@@ -218,17 +287,19 @@
 	GObjectClass *object_class;
 	EShellViewClass *shell_view_class;
 
-	parent_class = g_type_class_peek-parent (class);
+	parent_class = g_type_class_peek_parent (class);
 	g_type_class_add_private (class, sizeof (EBookShellViewPrivate));
 
 	object_class = G_OBJECT_CLASS (class);
 	object_class->dispose = book_shell_view_dispose;
 	object_class->finalize = book_shell_view_finalize;
+	object_class->constructed = book_shell_view_constructed;
 
 	shell_view_class = E_SHELL_VIEW_CLASS (class);
 	shell_view_class->label = N_("Contacts");
 	shell_view_class->icon_name = "x-office-address-book";
 	shell_view_class->type_module = type_module;
+	shell_view_class->changed = book_shell_view_changed;
 
 	shell_view_class->get_content_widget =
 		book_shell_view_get_content_widget;
@@ -241,15 +312,23 @@
 static void
 book_shell_view_init (EBookShellView *book_shell_view)
 {
+	ESourceSelector *selector;
+	ESource *source;
+
 	book_shell_view->priv =
 		E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view);
 
 	e_book_shell_view_private_init (book_shell_view);
 
 	g_signal_connect_swapped (
-		priv->source_list, "changed",
+		book_shell_view->priv->source_list, "changed",
 		G_CALLBACK (book_shell_view_source_list_changed_cb),
 		book_shell_view);
+
+	selector = E_SOURCE_SELECTOR (book_shell_view->priv->selector);
+	source = book_shell_view_get_primary_source (book_shell_view);
+	if (source != NULL)
+		e_source_selector_set_primary_selection (selector, source);
 }
 
 GType

Modified: branches/kill-bonobo/addressbook/gui/contact-editor/e-contact-editor.h
==============================================================================
--- branches/kill-bonobo/addressbook/gui/contact-editor/e-contact-editor.h	(original)
+++ branches/kill-bonobo/addressbook/gui/contact-editor/e-contact-editor.h	Fri Aug 29 22:32:46 2008
@@ -22,7 +22,6 @@
 
 #include <libgnomeui/gnome-app.h>
 #include <libgnomeui/gnome-app-helper.h>
-#include <bonobo/bonobo-ui-component.h>
 #include <glade/glade.h>
 
 #include "addressbook/gui/contact-editor/eab-editor.h"
@@ -62,9 +61,6 @@
 	EBook *target_book;
 	EContact *contact;
 
-	/* UI handler */
-	BonoboUIComponent *uic;
-
 	GladeXML *gui;
 	GtkWidget *app;
 

Modified: branches/kill-bonobo/addressbook/gui/contact-editor/eab-editor.h
==============================================================================
--- branches/kill-bonobo/addressbook/gui/contact-editor/eab-editor.h	(original)
+++ branches/kill-bonobo/addressbook/gui/contact-editor/eab-editor.h	Fri Aug 29 22:32:46 2008
@@ -22,7 +22,6 @@
 
 #include <libgnomeui/gnome-app.h>
 #include <libgnomeui/gnome-app-helper.h>
-#include <bonobo/bonobo-ui-component.h>
 #include <glade/glade.h>
 
 #include <libebook/e-book.h>

Modified: branches/kill-bonobo/addressbook/gui/widgets/Makefile.am
==============================================================================
--- branches/kill-bonobo/addressbook/gui/widgets/Makefile.am	(original)
+++ branches/kill-bonobo/addressbook/gui/widgets/Makefile.am	Fri Aug 29 22:32:46 2008
@@ -61,6 +61,9 @@
 	gal-view-factory-minicard.c		\
 	gal-view-factory-minicard.h
 
+libeabwidgets_la_LIBADD =					\
+	$(top_builddir)/widgets/misc/libemiscwidgets.la
+
 MARSHAL_GENERATED = eab-marshal.c eab-marshal.h
 @EVO_MARSHAL_RULE@
 

Modified: branches/kill-bonobo/addressbook/gui/widgets/eab-gui-util.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/widgets/eab-gui-util.c	(original)
+++ branches/kill-bonobo/addressbook/gui/widgets/eab-gui-util.c	Fri Aug 29 22:32:46 2008
@@ -48,7 +48,6 @@
 #include "addressbook/gui/contact-editor/eab-editor.h"
 #include "addressbook/gui/contact-editor/e-contact-editor.h"
 #include "addressbook/gui/contact-list-editor/e-contact-list-editor.h"
-#include "addressbook/gui/component/addressbook-component.h"
 #include "addressbook/gui/component/addressbook.h"
 
 /* the NULL's in this table correspond to the status codes
@@ -781,6 +780,7 @@
 static void
 eab_send_to_contact_and_email_num_list (GList *contact_list)
 {
+#if 0  /* NOT READY FOR COMPOSER YET */
 	EMsgComposer *composer;
 	EComposerHeaderTable *table;
 	GPtrArray *to_array;
@@ -844,6 +844,7 @@
 	e_destination_freev (convert.destinations);
 
 	gtk_widget_show (GTK_WIDGET (composer));
+#endif
 }
 
 static const char *
@@ -868,6 +869,7 @@
 static void
 eab_send_contact_list_as_attachment (GList *contacts)
 {
+#if 0 /* NOT READY FOR COMPOSER YET */
 	EMsgComposer *composer;
 	EComposerHeaderTable *table;
 	CamelMimePart *attachment;
@@ -943,6 +945,7 @@
 	}
 
 	gtk_widget_show (GTK_WIDGET (composer));
+#endif
 }
 
 void

Modified: branches/kill-bonobo/addressbook/gui/widgets/eab-popup-control.h
==============================================================================
--- branches/kill-bonobo/addressbook/gui/widgets/eab-popup-control.h	(original)
+++ branches/kill-bonobo/addressbook/gui/widgets/eab-popup-control.h	Fri Aug 29 22:32:46 2008
@@ -28,6 +28,7 @@
 #ifndef __EAB_POPUP_CONTROL_H__
 #define __EAB_POPUP_CONTROL_H__
 
+#include <bonobo/bonobo-control.h>
 #include <bonobo/bonobo-event-source.h>
 #include <libebook/e-book.h>
 #include <libebook/e-contact.h>

Modified: branches/kill-bonobo/composer/e-msg-composer.c
==============================================================================
--- branches/kill-bonobo/composer/e-msg-composer.c	(original)
+++ branches/kill-bonobo/composer/e-msg-composer.c	Fri Aug 29 22:32:46 2008
@@ -109,8 +109,6 @@
 #include "e-composer-private.h"
 #include "e-composer-header-table.h"
 
-#include "evolution-shell-component-utils.h"
-
 #ifdef HAVE_XFREE
 #include <X11/XF86keysym.h>
 #endif

Modified: branches/kill-bonobo/mail/importers/mail-importer.c
==============================================================================
--- branches/kill-bonobo/mail/importers/mail-importer.c	(original)
+++ branches/kill-bonobo/mail/importers/mail-importer.c	Fri Aug 29 22:32:46 2008
@@ -49,7 +49,6 @@
 #include "e-util/e-util-private.h"
 
 #include "mail/mail-mt.h"
-#include "mail/mail-component.h"
 #include "mail/mail-tools.h"
 
 #include "mail-importer.h"

Modified: branches/kill-bonobo/shell/e-shell-view.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-view.c	(original)
+++ branches/kill-bonobo/shell/e-shell-view.c	Fri Aug 29 22:32:46 2008
@@ -31,6 +31,9 @@
 	((obj), E_TYPE_SHELL_VIEW, EShellViewPrivate))
 
 struct _EShellViewPrivate {
+	gchar *icon_name;
+	gchar *primary_text;
+	gchar *secondary_text;
 	gchar *title;
 	gint page_num;
 	gpointer window;  /* weak pointer */
@@ -38,12 +41,21 @@
 
 enum {
 	PROP_0,
+	PROP_ICON_NAME,
 	PROP_PAGE_NUM,
+	PROP_PRIMARY_TEXT,
+	PROP_SECONDARY_TEXT,
 	PROP_TITLE,
 	PROP_WINDOW
 };
 
+enum {
+	CHANGED,
+	LAST_SIGNAL
+};
+
 static gpointer parent_class;
+static gulong signals[LAST_SIGNAL];
 
 static void
 shell_view_set_page_num (EShellView *shell_view,
@@ -71,12 +83,30 @@
                          GParamSpec *pspec)
 {
 	switch (property_id) {
+		case PROP_ICON_NAME:
+			e_shell_view_set_icon_name (
+				E_SHELL_VIEW (object),
+				g_value_get_string (value));
+			return;
+
 		case PROP_PAGE_NUM:
 			shell_view_set_page_num (
 				E_SHELL_VIEW (object),
 				g_value_get_int (value));
 			return;
 
+		case PROP_PRIMARY_TEXT:
+			e_shell_view_set_primary_text (
+				E_SHELL_VIEW (object),
+				g_value_get_string (value));
+			return;
+
+		case PROP_SECONDARY_TEXT:
+			e_shell_view_set_secondary_text (
+				E_SHELL_VIEW (object),
+				g_value_get_string (value));
+			return;
+
 		case PROP_TITLE:
 			e_shell_view_set_title (
 				E_SHELL_VIEW (object),
@@ -100,12 +130,30 @@
                          GParamSpec *pspec)
 {
 	switch (property_id) {
+		case PROP_ICON_NAME:
+			g_value_set_string (
+				value, e_shell_view_get_icon_name (
+				E_SHELL_VIEW (object)));
+			return;
+
 		case PROP_PAGE_NUM:
 			g_value_set_int (
 				value, e_shell_view_get_page_num (
 				E_SHELL_VIEW (object)));
 			return;
 
+		case PROP_PRIMARY_TEXT:
+			g_value_set_string (
+				value, e_shell_view_get_primary_text (
+				E_SHELL_VIEW (object)));
+			return;
+
+		case PROP_SECONDARY_TEXT:
+			g_value_set_string (
+				value, e_shell_view_get_secondary_text (
+				E_SHELL_VIEW (object)));
+			return;
+
 		case PROP_TITLE:
 			g_value_set_string (
 				value, e_shell_view_get_title (
@@ -146,6 +194,9 @@
 
 	priv = E_SHELL_VIEW_GET_PRIVATE (object);
 
+	g_free (priv->icon_name);
+	g_free (priv->primary_text);
+	g_free (priv->secondary_text);
 	g_free (priv->title);
 
 	/* Chain up to parent's finalize() method. */
@@ -153,6 +204,16 @@
 }
 
 static void
+shell_view_constructed (GObject *object)
+{
+	/* XXX GObjectClass doesn't implement constructed(), so we will.
+	 *     Then subclasses won't have to check the function pointer
+	 *     before chaining up.
+	 *
+	 *     http://bugzilla.gnome.org/show_bug?id=546593 */
+}
+
+static void
 shell_view_class_init (EShellViewClass *class)
 {
 	GObjectClass *object_class;
@@ -165,6 +226,18 @@
 	object_class->get_property = shell_view_get_property;
 	object_class->dispose = shell_view_dispose;
 	object_class->finalize = shell_view_finalize;
+	object_class->constructed = shell_view_constructed;
+
+	g_object_class_install_property (
+		object_class,
+		PROP_ICON_NAME,
+		g_param_spec_string (
+			"icon-name",
+			_("Icon Name"),
+			_("The icon name for the sidebar header"),
+			NULL,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
 
 	g_object_class_install_property (
 		object_class,
@@ -181,6 +254,28 @@
 
 	g_object_class_install_property (
 		object_class,
+		PROP_PRIMARY_TEXT,
+		g_param_spec_string (
+			"primary-text",
+			_("Primary Text"),
+			_("The primary text for the sidebar header"),
+			NULL,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (
+		object_class,
+		PROP_SECONDARY_TEXT,
+		g_param_spec_string (
+			"secondary-text",
+			_("Secondary Text"),
+			_("The secondary text for the sidebar header"),
+			NULL,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (
+		object_class,
 		PROP_TITLE,
 		g_param_spec_string (
 			"title",
@@ -200,6 +295,16 @@
 			GTK_TYPE_WINDOW,
 			G_PARAM_READWRITE |
 			G_PARAM_CONSTRUCT_ONLY));
+
+	signals[CHANGED] = g_signal_new (
+		"changed",
+		G_OBJECT_CLASS_TYPE (object_class),
+		G_SIGNAL_RUN_LAST,
+		G_STRUCT_OFFSET (EShellViewClass, changed),
+		NULL, NULL,
+		g_cclosure_marshal_VOID__BOOLEAN,
+		G_TYPE_NONE, 1,
+		G_TYPE_BOOLEAN);
 }
 
 static void
@@ -253,6 +358,83 @@
 }
 
 const gchar *
+e_shell_view_get_icon_name (EShellView *shell_view)
+{
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+	return shell_view->priv->icon_name;
+}
+
+void
+e_shell_view_set_icon_name (EShellView *shell_view,
+                            const gchar *icon_name)
+{
+	g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+
+	if (icon_name == NULL) {
+		EShellViewClass *class;
+
+		/* Fall back to the switcher icon. */
+		class = E_SHELL_VIEW_GET_CLASS (shell_view);
+		icon_name = class->icon_name;
+	}
+
+	g_free (shell_view->priv->icon_name);
+	shell_view->priv->icon_name = g_strdup (icon_name);
+
+	g_object_notify (G_OBJECT (shell_view), "icon-name");
+}
+
+const gchar *
+e_shell_view_get_primary_text (EShellView *shell_view)
+{
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+	return shell_view->priv->primary_text;
+}
+
+void
+e_shell_view_set_primary_text (EShellView *shell_view,
+                               const gchar *primary_text)
+{
+	g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+
+	if (primary_text == NULL) {
+		EShellViewClass *class;
+
+		/* Fall back to the switcher label. */
+		class = E_SHELL_VIEW_GET_CLASS (shell_view);
+		primary_text = class->label;
+	}
+
+	g_free (shell_view->priv->primary_text);
+	shell_view->priv->primary_text = g_strdup (primary_text);
+
+	g_object_notify (G_OBJECT (shell_view), "primary-text");
+}
+
+const gchar *
+e_shell_view_get_secondary_text (EShellView *shell_view)
+{
+	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+	return shell_view->priv->secondary_text;
+}
+
+void
+e_shell_view_set_secondary_text (EShellView *shell_view,
+                                 const gchar *secondary_text)
+{
+	g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+
+	g_free (shell_view->priv->secondary_text);
+	shell_view->priv->secondary_text = g_strdup (secondary_text);
+	g_debug ("%s: %s", G_STRFUNC, secondary_text);
+
+	g_object_notify (G_OBJECT (shell_view), "secondary-text");
+}
+
+const gchar *
 e_shell_view_get_title (EShellView *shell_view)
 {
 	g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
@@ -345,3 +527,21 @@
 
 	return class->get_status_widget (shell_view);
 }
+
+void
+e_shell_view_changed (EShellView *shell_view)
+{
+	EShellWindow *shell_window;
+	EShellView *current_view;
+	const gchar *view_name;
+	gboolean visible;
+
+	g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+
+	shell_window = e_shell_view_get_window (shell_view);
+	view_name = e_shell_window_get_current_view (shell_window);
+	current_view = e_shell_window_get_view (shell_window, view_name);
+	visible = (current_view == shell_view);
+
+	g_signal_emit (shell_view, signals[CHANGED], 0, visible);
+}

Modified: branches/kill-bonobo/shell/e-shell-view.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-view.h	(original)
+++ branches/kill-bonobo/shell/e-shell-view.h	Fri Aug 29 22:32:46 2008
@@ -68,10 +68,24 @@
 	GtkWidget *	(*get_content_widget)	(EShellView *shell_view);
 	GtkWidget *	(*get_sidebar_widget)	(EShellView *shell_view);
 	GtkWidget *	(*get_status_widget)	(EShellView *shell_view);
+
+	/* Signals */
+
+	void		(*changed)		(EShellView *shell_view,
+						 gboolean visible);
 };
 
 GType		e_shell_view_get_type		(void);
 const gchar *	e_shell_view_get_name		(EShellView *shell_view);
+const gchar *	e_shell_view_get_icon_name	(EShellView *shell_view);
+void		e_shell_view_set_icon_name	(EShellView *shell_view,
+						 const gchar *icon_name);
+const gchar *	e_shell_view_get_primary_text	(EShellView *shell_view);
+void		e_shell_view_set_primary_text	(EShellView *shell_view,
+						 const gchar *primary_text);
+const gchar *	e_shell_view_get_secondary_text	(EShellView *shell_view);
+void		e_shell_view_set_secondary_text	(EShellView *shell_view,
+						 const gchar *secondary_text);
 const gchar *	e_shell_view_get_title		(EShellView *shell_view);
 void		e_shell_view_set_title		(EShellView *shell_view,
 						 const gchar *title);
@@ -81,6 +95,7 @@
 GtkWidget *	e_shell_view_get_content_widget (EShellView *shell_view);
 GtkWidget *	e_shell_view_get_sidebar_widget (EShellView *shell_view);
 GtkWidget *	e_shell_view_get_status_widget	(EShellView *shell_view);
+void		e_shell_view_changed		(EShellView *shell_view);
 
 G_END_DECLS
 

Modified: branches/kill-bonobo/shell/e-shell-window.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window.c	(original)
+++ branches/kill-bonobo/shell/e-shell-window.c	Fri Aug 29 22:32:46 2008
@@ -41,6 +41,31 @@
 
 static gpointer parent_class;
 
+static void
+shell_window_update_sidebar (EShellWindow *shell_window)
+{
+	ESidebar *sidebar;
+	EShellView *shell_view;
+	const gchar *view_name;
+	const gchar *icon_name;
+	const gchar *primary_text;
+	const gchar *secondary_text;
+
+	sidebar = E_SIDEBAR (shell_window->priv->sidebar);
+	view_name = e_shell_window_get_current_view (shell_window);
+	shell_view = e_shell_window_get_view (shell_window, view_name);
+
+	/* Update the sidebar header. */
+
+	icon_name = e_shell_view_get_icon_name (shell_view);
+	primary_text = e_shell_view_get_primary_text (shell_view);
+	secondary_text = e_shell_view_get_secondary_text (shell_view);
+
+	e_sidebar_set_icon_name (sidebar, icon_name);
+	e_sidebar_set_primary_text (sidebar, primary_text);
+	e_sidebar_set_secondary_text (sidebar, secondary_text);
+}
+
 static EShellView *
 shell_window_new_view (EShellWindow *shell_window,
                        GType shell_view_type,
@@ -51,6 +76,7 @@
 	GtkNotebook *notebook;
 	GtkWidget *widget;
 	const gchar *name;
+	gulong handler_id;
 	gint page_num;
 
 	/* Determine the page number for the new shell view. */
@@ -79,6 +105,13 @@
 	widget = e_shell_view_get_status_widget (shell_view);
 	gtk_notebook_append_page (notebook, widget, NULL);
 
+	handler_id = g_signal_connect_swapped (
+		shell_view, "notify",
+		G_CALLBACK (shell_window_update_sidebar), shell_window);
+
+	/* This will be unblocked when the shell view is selected. */
+	g_signal_handler_block (shell_view, handler_id);
+
 	return shell_view;
 }
 
@@ -327,8 +360,6 @@
 			continue;
 		}
 
-		g_debug ("Comparing %s to %s (%s)", view_name, class->type_module->name, g_type_name (shell_view_type));
-
 		if (strcmp (view_name, class->type_module->name) == 0)
 			shell_view = shell_window_new_view (
 				shell_window, shell_view_type, class->label);
@@ -444,23 +475,31 @@
 {
 	GtkNotebook *notebook;
 	EShellView *shell_view;
-	const gchar *current_view;
+	GList *list;
+	const gchar *view_name;
 	gint page_num;
 
 	g_return_if_fail (E_IS_SHELL_WINDOW (shell_window));
 
-	current_view = name_or_alias;
+	if (shell_window->priv->current_view != NULL) {
+		view_name = e_shell_window_get_current_view (shell_window);
+		shell_view = e_shell_window_get_view (shell_window, view_name);
 
-	if (current_view != NULL)
-		current_view =
-			e_shell_registry_get_canonical_name (current_view);
+		g_signal_handlers_block_by_func (
+			shell_view, shell_window_update_sidebar, shell_window);
+	}
+
+	view_name = name_or_alias;
 
-	if (current_view == NULL)
-		current_view = shell_window->priv->default_view;
+	if (view_name != NULL)
+		view_name = e_shell_registry_get_canonical_name (view_name);
 
-	g_return_if_fail (current_view != NULL);
+	if (view_name == NULL)
+		view_name = shell_window->priv->default_view;
 
-	shell_view = e_shell_window_get_view (shell_window, current_view);
+	g_return_if_fail (view_name != NULL);
+
+	shell_view = e_shell_window_get_view (shell_window, view_name);
 	page_num = e_shell_view_get_page_num (shell_view);
 	g_return_if_fail (page_num >= 0);
 
@@ -473,9 +512,18 @@
 	notebook = GTK_NOTEBOOK (shell_window->priv->status_notebook);
 	gtk_notebook_set_current_page (notebook, page_num);
 
-	shell_window->priv->current_view = current_view;
-
+	shell_window->priv->current_view = view_name;
 	g_object_notify (G_OBJECT (shell_window), "current-view");
+
+	g_signal_handlers_unblock_by_func (
+		shell_view, shell_window_update_sidebar, shell_window);
+
+	shell_window_update_sidebar (shell_window);
+
+	/* Notify all loaded views. */
+	list = g_hash_table_get_values (shell_window->priv->loaded_views);
+	g_list_foreach (list, (GFunc) e_shell_view_changed, NULL);
+	g_list_free (list);
 }
 
 gboolean

Modified: branches/kill-bonobo/shell/e-sidebar.c
==============================================================================
--- branches/kill-bonobo/shell/e-sidebar.c	(original)
+++ branches/kill-bonobo/shell/e-sidebar.c	Fri Aug 29 22:32:46 2008
@@ -28,6 +28,16 @@
 #define V_PADDING 6
 
 struct _ESidebarPrivate {
+
+	/* Header */
+	GtkWidget *event_box;
+	GtkWidget *image;
+	GtkWidget *primary_label;
+	GtkWidget *secondary_label;
+	gchar *primary_text;
+	gchar *secondary_text;
+
+	/* Switcher */
 	GList *proxies;
 	gboolean actions_visible;
 	gboolean style_set;
@@ -39,6 +49,9 @@
 enum {
 	PROP_0,
 	PROP_ACTIONS_VISIBLE,
+	PROP_ICON_NAME,
+	PROP_PRIMARY_TEXT,
+	PROP_SECONDARY_TEXT,
 	PROP_TOOLBAR_STYLE
 };
 
@@ -63,7 +76,6 @@
 	int x, y;
 	int i;
 
-	/*y = allocation->y + allocation->height - V_PADDING - 1;*/
 	y = allocation->y + allocation->height - 1;
 
 	if (num_btns == 0)
@@ -172,6 +184,24 @@
 				g_value_get_boolean (value));
 			return;
 
+		case PROP_ICON_NAME:
+			e_sidebar_set_icon_name (
+				E_SIDEBAR (object),
+				g_value_get_string (value));
+			return;
+
+		case PROP_PRIMARY_TEXT:
+			e_sidebar_set_primary_text (
+				E_SIDEBAR (object),
+				g_value_get_string (value));
+			return;
+
+		case PROP_SECONDARY_TEXT:
+			e_sidebar_set_secondary_text (
+				E_SIDEBAR (object),
+				g_value_get_string (value));
+			return;
+
 		case PROP_TOOLBAR_STYLE:
 			e_sidebar_set_style (
 				E_SIDEBAR (object),
@@ -195,6 +225,24 @@
 				E_SIDEBAR (object)));
 			return;
 
+		case PROP_ICON_NAME:
+			g_value_set_string (
+				value, e_sidebar_get_icon_name (
+				E_SIDEBAR (object)));
+			return;
+
+		case PROP_PRIMARY_TEXT:
+			g_value_set_string (
+				value, e_sidebar_get_primary_text (
+				E_SIDEBAR (object)));
+			return;
+
+		case PROP_SECONDARY_TEXT:
+			g_value_set_string (
+				value, e_sidebar_get_secondary_text (
+				E_SIDEBAR (object)));
+			return;
+
 		case PROP_TOOLBAR_STYLE:
 			g_value_set_enum (
 				value, e_sidebar_get_style (
@@ -208,7 +256,29 @@
 static void
 sidebar_dispose (GObject *object)
 {
-	ESidebarPrivate *priv = E_SIDEBAR (object)->priv;
+	ESidebarPrivate *priv;
+
+	priv = E_SIDEBAR_GET_PRIVATE (object);
+
+	if (priv->event_box != NULL) {
+		g_object_unref (priv->event_box);
+		priv->event_box = NULL;
+	}
+
+	if (priv->image != NULL) {
+		g_object_unref (priv->image);
+		priv->image = NULL;
+	}
+
+	if (priv->primary_label != NULL) {
+		g_object_unref (priv->primary_label);
+		priv->image = NULL;
+	}
+
+	if (priv->secondary_label != NULL) {
+		g_object_unref (priv->secondary_label);
+		priv->secondary_label = NULL;
+	}
 
 	while (priv->proxies != NULL) {
 		GtkWidget *widget = priv->proxies->data;
@@ -220,10 +290,25 @@
 }
 
 static void
+sidebar_finalize (GObject *object)
+{
+	ESidebarPrivate *priv;
+
+	priv = E_SIDEBAR_GET_PRIVATE (object);
+
+	g_free (priv->primary_text);
+	g_free (priv->secondary_text);
+
+	/* Chain up to parent's finalize() method. */
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
 sidebar_size_request (GtkWidget *widget,
                       GtkRequisition *requisition)
 {
 	ESidebarPrivate *priv;
+	GtkRequisition child_requisition;
 	GtkWidget *child;
 	GList *iter;
 
@@ -237,6 +322,11 @@
 		gtk_widget_size_request (child, requisition);
 	}
 
+	child = priv->event_box;
+	gtk_widget_size_request (child, &child_requisition);
+	requisition->width = MAX (requisition->width, child_requisition.width);
+	requisition->height += child_requisition.height;
+
 	if (!priv->actions_visible)
 		return;
 
@@ -260,6 +350,8 @@
                        GtkAllocation *allocation)
 {
 	ESidebarPrivate *priv;
+	GtkAllocation child_allocation;
+	GtkRequisition child_requisition;
 	GtkWidget *child;
 	gint y;
 
@@ -267,6 +359,18 @@
 
 	widget->allocation = *allocation;
 
+	child = priv->event_box;
+	gtk_widget_size_request (child, &child_requisition);
+
+	child_allocation.x = allocation->x;
+	child_allocation.y = allocation->y;
+	child_allocation.width = allocation->width;
+	child_allocation.height = child_requisition.height;
+
+	gtk_widget_size_allocate (child, &child_allocation);
+
+	allocation->y += child_requisition.height;
+
 	if (priv->actions_visible)
 		y = sidebar_layout_actions (E_SIDEBAR (widget));
 	else
@@ -275,8 +379,6 @@
 	child = gtk_bin_get_child (GTK_BIN (widget));
 
 	if (child != NULL) {
-		GtkAllocation child_allocation;
-
 		child_allocation.x = allocation->x;
 		child_allocation.y = allocation->y;
 		child_allocation.width = allocation->width;
@@ -330,6 +432,13 @@
 	priv = E_SIDEBAR_GET_PRIVATE (container);
 
 	/* Look in the internal widgets first. */
+
+	if (widget == priv->event_box) {
+		gtk_widget_unparent (priv->event_box);
+		gtk_widget_queue_resize (GTK_WIDGET (container));
+		return;
+	}
+
 	link = g_list_find (priv->proxies, widget);
 	if (link != NULL) {
 		GtkWidget *widget = link->data;
@@ -354,9 +463,11 @@
 
 	priv = E_SIDEBAR_GET_PRIVATE (container);
 
-	if (include_internals)
+	if (include_internals) {
+		callback (priv->event_box, callback_data);
 		g_list_foreach (
 			priv->proxies, (GFunc) callback, callback_data);
+	}
 
 	/* Chain up to parent's forall() method. */
 	GTK_CONTAINER_CLASS (parent_class)->forall (
@@ -418,6 +529,7 @@
 	object_class->set_property = sidebar_set_property;
 	object_class->get_property = sidebar_get_property;
 	object_class->dispose = sidebar_dispose;
+	object_class->finalize = sidebar_finalize;
 
 	widget_class = GTK_WIDGET_CLASS (class);
 	widget_class->size_request = sidebar_size_request;
@@ -438,8 +550,41 @@
 			NULL,
 			NULL,
 			TRUE,
-			G_PARAM_CONSTRUCT |
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (
+		object_class,
+		PROP_ICON_NAME,
+		g_param_spec_string (
+			"icon-name",
+			NULL,
+			NULL,
+			NULL,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (
+		object_class,
+		PROP_PRIMARY_TEXT,
+		g_param_spec_string (
+			"primary-text",
+			NULL,
+			NULL,
+			NULL,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (
+		object_class,
+		PROP_SECONDARY_TEXT,
+		g_param_spec_string (
+			"secondary-text",
+			NULL,
+			NULL,
+			NULL,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
 
 	g_object_class_install_property (
 		object_class,
@@ -450,8 +595,8 @@
 			NULL,
 			GTK_TYPE_TOOLBAR_STYLE,
 			E_SIDEBAR_DEFAULT_TOOLBAR_STYLE,
-			G_PARAM_CONSTRUCT |
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
 
 	signals[STYLE_CHANGED] = g_signal_new (
 		"style-changed",
@@ -467,9 +612,51 @@
 static void
 sidebar_init (ESidebar *sidebar)
 {
+	GtkStyle *style;
+	GtkWidget *container;
+	GtkWidget *widget;
+	const GdkColor *color;
+
 	sidebar->priv = E_SIDEBAR_GET_PRIVATE (sidebar);
 
 	GTK_WIDGET_SET_FLAGS (sidebar, GTK_NO_WINDOW);
+
+	widget = gtk_event_box_new ();
+	style = gtk_widget_get_style (widget);
+	color = &style->bg[GTK_STATE_ACTIVE];
+	gtk_container_set_border_width (GTK_CONTAINER (widget), 1);
+	gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, color);
+	gtk_widget_set_parent (widget, GTK_WIDGET (sidebar));
+	sidebar->priv->event_box = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = gtk_hbox_new (FALSE, 6);
+	gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
+	gtk_container_add (GTK_CONTAINER (container), widget);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	widget = gtk_image_new ();
+	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+	sidebar->priv->image = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	widget = gtk_label_new (NULL);
+	gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END);
+	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+	sidebar->priv->primary_label = g_object_ref (widget);
+	gtk_widget_show (widget);
+
+	widget = gtk_label_new (NULL);
+	gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_MIDDLE);
+	gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
+	gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+	sidebar->priv->secondary_label = g_object_ref (widget);
+	gtk_widget_show (widget);
 }
 
 static void
@@ -570,6 +757,102 @@
 	g_object_notify (G_OBJECT (sidebar), "actions-visible");
 }
 
+const gchar *
+e_sidebar_get_icon_name (ESidebar *sidebar)
+{
+	GtkImage *image;
+	const gchar *icon_name;
+
+	g_return_val_if_fail (E_IS_SIDEBAR (sidebar), NULL);
+
+	image = GTK_IMAGE (sidebar->priv->image);
+	gtk_image_get_icon_name (image, &icon_name, NULL);
+
+	return icon_name;
+}
+
+void
+e_sidebar_set_icon_name (ESidebar *sidebar,
+                         const gchar *icon_name)
+{
+	GtkImage *image;
+
+	g_return_if_fail (E_IS_SIDEBAR (sidebar));
+
+	if (icon_name == NULL)
+		icon_name = "image-missing";
+
+	image = GTK_IMAGE (sidebar->priv->image);
+	gtk_image_set_from_icon_name (image, icon_name, GTK_ICON_SIZE_MENU);
+
+	gtk_widget_queue_resize (GTK_WIDGET (sidebar));
+	g_object_notify (G_OBJECT (sidebar), "icon-name");
+}
+
+const gchar *
+e_sidebar_get_primary_text (ESidebar *sidebar)
+{
+	g_return_val_if_fail (E_IS_SIDEBAR (sidebar), NULL);
+
+	return sidebar->priv->primary_text;
+}
+
+void
+e_sidebar_set_primary_text (ESidebar *sidebar,
+                            const gchar *primary_text)
+{
+	GtkLabel *label;
+	gchar *markup;
+
+	g_return_if_fail (E_IS_SIDEBAR (sidebar));
+
+	g_free (sidebar->priv->primary_text);
+	sidebar->priv->primary_text = g_strdup (primary_text);
+
+	if (primary_text == NULL)
+		primary_text = "";
+
+	label = GTK_LABEL (sidebar->priv->primary_label);
+	markup = g_markup_printf_escaped ("<b>%s</b>", primary_text);
+	gtk_label_set_markup (label, markup);
+	g_free (markup);
+
+	gtk_widget_queue_resize (GTK_WIDGET (sidebar));
+	g_object_notify (G_OBJECT (sidebar), "primary-text");
+}
+
+const gchar *
+e_sidebar_get_secondary_text (ESidebar *sidebar)
+{
+	g_return_val_if_fail (E_IS_SIDEBAR (sidebar), NULL);
+
+	return sidebar->priv->secondary_text;
+}
+
+void
+e_sidebar_set_secondary_text (ESidebar *sidebar,
+                              const gchar *secondary_text)
+{
+	GtkLabel *label;
+	gchar *markup;
+
+	g_return_if_fail (E_IS_SIDEBAR (sidebar));
+
+	g_free (sidebar->priv->secondary_text);
+	sidebar->priv->secondary_text = g_strdup (secondary_text);
+
+	if (secondary_text == NULL)
+		secondary_text = "";
+
+	label = GTK_LABEL (sidebar->priv->secondary_label);
+	markup = g_markup_printf_escaped ("<small>%s</small>", secondary_text);
+	gtk_label_set_markup (label, markup);
+	g_free (markup);
+
+	gtk_widget_queue_resize (GTK_WIDGET (sidebar));
+	g_object_notify (G_OBJECT (sidebar), "secondary-text");
+}
+
 GtkToolbarStyle
 e_sidebar_get_style (ESidebar *sidebar)
 {

Modified: branches/kill-bonobo/shell/e-sidebar.h
==============================================================================
--- branches/kill-bonobo/shell/e-sidebar.h	(original)
+++ branches/kill-bonobo/shell/e-sidebar.h	Fri Aug 29 22:32:46 2008
@@ -69,6 +69,15 @@
 gboolean	e_sidebar_get_actions_visible	(ESidebar *sidebar);
 void		e_sidebar_set_actions_visible	(ESidebar *sidebar,
 						 gboolean visible);
+const gchar *	e_sidebar_get_icon_name		(ESidebar *sidebar);
+void		e_sidebar_set_icon_name		(ESidebar *sidebar,
+						 const gchar *icon_name);
+const gchar *	e_sidebar_get_primary_text	(ESidebar *sidebar);
+void		e_sidebar_set_primary_text	(ESidebar *sidebar,
+						 const gchar *primary_text);
+const gchar *	e_sidebar_get_secondary_text	(ESidebar *sidebar);
+void		e_sidebar_set_secondary_text	(ESidebar *sidebar,
+						 const gchar *secondary_text);
 GtkToolbarStyle	e_sidebar_get_style		(ESidebar *sidebar);
 void		e_sidebar_set_style		(ESidebar *sidebar,
 						 GtkToolbarStyle style);

Modified: branches/kill-bonobo/shell/test/e-test-shell-view.c
==============================================================================
--- branches/kill-bonobo/shell/test/e-test-shell-view.c	(original)
+++ branches/kill-bonobo/shell/test/e-test-shell-view.c	Fri Aug 29 22:32:46 2008
@@ -90,6 +90,13 @@
 }
 
 static void
+test_shell_view_changed (EShellView *shell_view,
+                         gboolean visible)
+{
+	g_debug ("%s (visible=%d)", G_STRFUNC, visible);
+}
+
+static void
 test_shell_view_class_init (ETestShellViewClass *class,
                             GTypeModule *type_module)
 {
@@ -102,6 +109,7 @@
 	shell_view_class->label = "Test";
 	shell_view_class->icon_name = "face-monkey";
 	shell_view_class->type_module = type_module;
+	shell_view_class->changed = test_shell_view_changed;
 
 	shell_view_class->get_content_widget =
 		test_shell_view_get_content_widget;

Modified: branches/kill-bonobo/smime/gui/Makefile.am
==============================================================================
--- branches/kill-bonobo/smime/gui/Makefile.am	(original)
+++ branches/kill-bonobo/smime/gui/Makefile.am	Fri Aug 29 22:32:46 2008
@@ -6,6 +6,8 @@
 	-I$(top_builddir)/smime/lib			\
 	-I$(top_srcdir)/shell				\
 	-I$(top_builddir)/shell				\
+	-I$(top_srcdir)/widgets/misc			\
+	-I$(top_builddir)/widgets/misc			\
 	-DEVOLUTION_DATADIR=\""$(datadir)"\"		\
 	-DEVOLUTION_GLADEDIR=\""$(gladedir)"\"		\
 	-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\"	\

Modified: branches/kill-bonobo/smime/gui/certificate-manager.c
==============================================================================
--- branches/kill-bonobo/smime/gui/certificate-manager.c	(original)
+++ branches/kill-bonobo/smime/gui/certificate-manager.c	Fri Aug 29 22:32:46 2008
@@ -32,7 +32,6 @@
 #include <glib/gi18n.h>
 
 #include <glade/glade.h>
-#include "evolution-config-control.h"
 #include "ca-trust-dialog.h"
 #include "cert-trust-dialog.h"
 #include "certificate-manager.h"
@@ -49,7 +48,9 @@
 #include <pkcs11.h>
 #include <pk11func.h>
 
-#include "e-util/e-util-private.h"
+#include <e-shell.h>
+#include <e-preferences-window.h>
+#include <e-util/e-util-private.h>
 
 typedef struct {
 	GladeXML *gui;
@@ -975,11 +976,11 @@
 	gtk_tree_view_expand_all (GTK_TREE_VIEW (cfm->contactcerts_treeview));
 }
 
-EvolutionConfigControl*
-certificate_manager_config_control_new (void)
+void
+certificate_manager_config_init (void)
 {
 	CertificateManagerData *cfm_data;
-	GtkWidget *control_widget;
+	GtkWidget *widget;
 	char *gladefile;
 
 	/* We need to peek the db here to make sure it (and NSS) are fully initialized. */
@@ -1019,14 +1020,19 @@
 
 	populate_ui (cfm_data);
 
-	control_widget = glade_xml_get_widget (cfm_data->gui, "cert-manager-notebook");
-	g_object_ref (control_widget);
+	widget = glade_xml_get_widget (cfm_data->gui, "cert-manager-notebook");
+	g_object_ref (widget);
 
-	gtk_container_remove (GTK_CONTAINER (control_widget->parent), control_widget);
+	gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
 
 	/* FIXME: remove when implemented */
 	gtk_widget_set_sensitive(cfm_data->backup_your_button, FALSE);
 	gtk_widget_set_sensitive(cfm_data->backup_all_your_button, FALSE);
 
-	return evolution_config_control_new (control_widget);
+	e_preferences_window_add_page (
+		e_shell_get_preferences_window (),
+		"certificates",
+		"preferences-certificates",
+		_("Certificates"),
+		widget, 700);
 }

Modified: branches/kill-bonobo/smime/gui/certificate-manager.h
==============================================================================
--- branches/kill-bonobo/smime/gui/certificate-manager.h	(original)
+++ branches/kill-bonobo/smime/gui/certificate-manager.h	Fri Aug 29 22:32:46 2008
@@ -23,8 +23,12 @@
 #ifndef _CERTIFICATE_MANAGER_H_
 #define _CERTIFICATE_MANAGER_H
 
-#include "evolution-config-control.h"
+#include <glib.h>
 
-EvolutionConfigControl* certificate_manager_config_control_new (void);
+G_BEGIN_DECLS
+
+void		certificate_manager_config_init	(void);
+
+G_END_DECLS
 
 #endif /* _CERTIFICATE_MANAGER_H_ */

Modified: branches/kill-bonobo/ui/evolution-contacts.ui
==============================================================================
--- branches/kill-bonobo/ui/evolution-contacts.ui	(original)
+++ branches/kill-bonobo/ui/evolution-contacts.ui	Fri Aug 29 22:32:46 2008
@@ -27,7 +27,7 @@
       <menuitem action='contact-preview'/>
     </menu>
     <placeholder name='custom-menus'>
-      <menu action='action-menu'>
+      <menu action='actions-menu'>
         <menuitem action='contact-forward'/>
         <menuitem action='contact-send-message'/>
         <menuitem action='address-book-stop'/>
@@ -42,4 +42,17 @@
       </menu>
     </placeholder>
   </menubar>
+  <toolbar name='main-toolbar'>
+    <toolitem action='contact-print'/>
+    <toolitem action='contact-delete'/>
+    <toolitem action='address-book-stop'/>
+  </toolbar>
+  <popup name="address-book-popup">
+    <menuitem action='address-book-new'/>
+    <menuitem action='address-book-popup-save-as'/>
+    <separator/>
+    <menuitem action='address-book-popup-delete'/>
+    <separator/>
+    <menuitem action='address-book-popup-properties'/>
+  </popup>
 </ui>

Modified: branches/kill-bonobo/widgets/misc/Makefile.am
==============================================================================
--- branches/kill-bonobo/widgets/misc/Makefile.am	(original)
+++ branches/kill-bonobo/widgets/misc/Makefile.am	Fri Aug 29 22:32:46 2008
@@ -52,7 +52,6 @@
 	e-expander.h				\
 	e-icon-entry.h				\
 	e-image-chooser.h			\
-	e-info-label.h				\
 	e-map.h					\
 	e-menu-tool-button.h			\
 	e-preferences-window.h			\
@@ -99,7 +98,6 @@
 	e-expander.c				\
 	e-icon-entry.c				\
 	e-image-chooser.c			\
-	e-info-label.c				\
 	e-map.c					\
 	e-menu-tool-button.c			\
 	e-preferences-window.c			\
@@ -156,8 +154,7 @@
 	test-calendar			\
 	test-dateedit			\
 	test-dropdown-button		\
-	test-preferences-window		\
-	test-info-label
+	test-preferences-window	
 
 # test-calendar
 
@@ -199,16 +196,6 @@
 	$(top_builddir)/e-util/libeutil.la	\
 	$(E_WIDGETS_LIBS)
 
-# test-info-label
-
-test_info_label_SOURCES = 	\
-	test-info-label.c
-
-test_info_label_LDADD = 			\
-	libemiscwidgets.la			\
-	$(top_builddir)/e-util/libeutil.la	\
-	$(E_WIDGETS_LIBS)
-
 
 EXTRA_DIST =			\
 	$(glade_DATA)		\

Modified: branches/kill-bonobo/widgets/misc/e-preferences-window.c
==============================================================================
--- branches/kill-bonobo/widgets/misc/e-preferences-window.c	(original)
+++ branches/kill-bonobo/widgets/misc/e-preferences-window.c	Fri Aug 29 22:32:46 2008
@@ -303,8 +303,8 @@
                                const gchar *page_name,
                                const gchar *icon_name,
                                const gchar *caption,
-                               gint sort_order,
-                               GtkWidget *widget)
+                               GtkWidget *widget,
+                               gint sort_order)
 {
 	GtkTreeRowReference *reference;
 	GtkIconView *icon_view;
@@ -346,6 +346,8 @@
 
 	if (page == 0)
 		e_preferences_window_show_page (dialog, page_name);
+
+	gtk_widget_queue_resize (GTK_WIDGET (dialog));
 }
 
 void

Modified: branches/kill-bonobo/widgets/misc/e-preferences-window.h
==============================================================================
--- branches/kill-bonobo/widgets/misc/e-preferences-window.h	(original)
+++ branches/kill-bonobo/widgets/misc/e-preferences-window.h	Fri Aug 29 22:32:46 2008
@@ -63,8 +63,8 @@
 						 const gchar *page_name,
 						 const gchar *icon_name,
 						 const gchar *caption,
-						 gint sort_order,
-						 GtkWidget *widget);
+						 GtkWidget *widget,
+						 gint sort_order);
 void		e_preferences_window_show_page	(EPreferencesWindow *window,
 						 const gchar *page_name);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]