[evolution/account-mgmt: 23/48] Adapt modules/calendar to the new ESource API.



commit bc408681ef8053a284032ad4dd3bb9d3cd9b157f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Dec 23 08:58:10 2010 -0500

    Adapt modules/calendar to the new ESource API.

 modules/Makefile.am                          |    4 +-
 modules/calendar/Makefile.am                 |    4 +-
 modules/calendar/e-cal-attachment-handler.c  |   60 +++--
 modules/calendar/e-cal-shell-backend.c       |  384 ++++----------------------
 modules/calendar/e-cal-shell-backend.h       |    8 -
 modules/calendar/e-cal-shell-content.c       |    4 +-
 modules/calendar/e-cal-shell-migrate.c       |  223 ---------------
 modules/calendar/e-cal-shell-sidebar.c       |  228 ++++++----------
 modules/calendar/e-cal-shell-sidebar.h       |    2 +
 modules/calendar/e-cal-shell-view-actions.c  |  167 ++++++------
 modules/calendar/e-cal-shell-view-memopad.c  |   19 ++-
 modules/calendar/e-cal-shell-view-private.c  |   20 +-
 modules/calendar/e-cal-shell-view-private.h  |    5 +-
 modules/calendar/e-cal-shell-view-taskpad.c  |   19 ++-
 modules/calendar/e-cal-shell-view.c          |    9 +-
 modules/calendar/e-calendar-preferences.c    |   97 ++------
 modules/calendar/e-calendar-preferences.h    |    4 +-
 modules/calendar/e-memo-shell-backend.c      |  308 ++++-----------------
 modules/calendar/e-memo-shell-backend.h      |    8 -
 modules/calendar/e-memo-shell-content.c      |    8 +-
 modules/calendar/e-memo-shell-migrate.c      |  158 +-----------
 modules/calendar/e-memo-shell-sidebar.c      |  166 ++++--------
 modules/calendar/e-memo-shell-view-actions.c |  136 +++++-----
 modules/calendar/e-memo-shell-view-private.c |    5 +-
 modules/calendar/e-memo-shell-view-private.h |    3 +-
 modules/calendar/e-memo-shell-view.h         |    1 -
 modules/calendar/e-task-shell-backend.c      |  311 ++++-----------------
 modules/calendar/e-task-shell-backend.h      |    8 -
 modules/calendar/e-task-shell-content.c      |   12 +-
 modules/calendar/e-task-shell-migrate.c      |  166 +-----------
 modules/calendar/e-task-shell-sidebar.c      |  167 ++++--------
 modules/calendar/e-task-shell-view-actions.c |  136 +++++-----
 modules/calendar/e-task-shell-view-private.c |    5 +-
 modules/calendar/e-task-shell-view-private.h |    3 +-
 modules/calendar/e-task-shell-view.h         |    1 -
 widgets/misc/Makefile.am                     |    2 +
 widgets/misc/e-alarm-selector.c              |  102 +++++++
 widgets/misc/e-alarm-selector.h              |   63 +++++
 38 files changed, 873 insertions(+), 2153 deletions(-)
---
diff --git a/modules/Makefile.am b/modules/Makefile.am
index 1018a4f..dd363d2 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -22,12 +22,10 @@ if ENABLE_WINDOWS_SENS
 WINDOWS_SENS_DIR = windows-sens
 endif
 
-# ACCOUNT_MGMT: Disable SUBDIRS
-# calendar (comes after bogofilter)
-
 SUBDIRS = \
 	addressbook \
 	bogofilter \
+	calendar \
 	mail \
 	composer-autosave \
 	mailto-handler \
diff --git a/modules/calendar/Makefile.am b/modules/calendar/Makefile.am
index 4f09f92..98e2a7c 100644
--- a/modules/calendar/Makefile.am
+++ b/modules/calendar/Makefile.am
@@ -13,6 +13,8 @@ libevolution_module_calendar_la_CPPFLAGS =		\
 
 libevolution_module_calendar_la_SOURCES =		\
 	evolution-module-calendar.c			\
+	e-calendar-preferences.c			\
+	e-calendar-preferences.h			\
 	e-cal-attachment-handler.c			\
 	e-cal-attachment-handler.h			\
 	e-cal-config-calendar-item.c			\
@@ -51,8 +53,6 @@ libevolution_module_calendar_la_SOURCES =		\
 	e-cal-shell-view-private.c			\
 	e-cal-shell-view-private.h			\
 	e-cal-shell-view-taskpad.c			\
-	e-calendar-preferences.c			\
-	e-calendar-preferences.h			\
 	e-memo-shell-backend.c				\
 	e-memo-shell-backend.h				\
 	e-memo-shell-content.c				\
diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c
index 24a73f6..6ba21e6 100644
--- a/modules/calendar/e-cal-attachment-handler.c
+++ b/modules/calendar/e-cal-attachment-handler.c
@@ -29,9 +29,12 @@
 #include <libical/ical.h>
 #include <libecal/e-cal-client.h>
 #include <camel/camel.h>
+#include <libecal/e-source-calendar.h>
 #include <libedataserverui/e-source-selector.h>
 #include <libedataserverui/e-client-utils.h>
 
+#include <shell/e-shell.h>
+
 typedef struct _ImportContext ImportContext;
 
 struct _ECalAttachmentHandlerPrivate {
@@ -175,7 +178,7 @@ attachment_handler_import_event (GObject *source_object,
 		g_warn_if_fail (client == NULL);
 		g_warning (
 			"%s: Failed to open '%s': %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_object_unref (attachment);
 		g_error_free (error);
@@ -231,7 +234,7 @@ attachment_handler_import_todo (GObject *source_object,
 		g_warn_if_fail (client == NULL);
 		g_warning (
 			"%s: Failed to open '%s': %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_object_unref (attachment);
 		g_error_free (error);
@@ -280,30 +283,32 @@ attachment_handler_run_dialog (GtkWindow *parent,
                                ECalClientSourceType source_type,
                                const gchar *title)
 {
+	EShell *shell;
 	GtkWidget *dialog;
 	GtkWidget *container;
 	GtkWidget *widget;
+	ESourceRegistry *registry;
 	ESourceSelector *selector;
-	ESourceList *source_list;
 	ESource *source;
+	const gchar *extension_name;
 	icalcomponent *component;
-	GError *error = NULL;
-
-	component = attachment_handler_get_component (attachment);
-	g_return_if_fail (component != NULL);
 
-	e_cal_client_get_sources (&source_list, source_type, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Failed to get cal sources: %s",
-			G_STRFUNC, error->message);
-		g_clear_error (&error);
-		return;
+	switch (source_type) {
+		case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
+			extension_name = E_SOURCE_EXTENSION_CALENDAR;
+			break;
+		case E_CAL_CLIENT_SOURCE_TYPE_TASKS:
+			extension_name = E_SOURCE_EXTENSION_TASK_LIST;
+			break;
+		case E_CAL_CLIENT_SOURCE_TYPE_MEMOS:
+			extension_name = E_SOURCE_EXTENSION_MEMO_LIST;
+			break;
+		default:
+			g_return_if_reached ();
 	}
 
-	source = e_source_list_peek_source_any (source_list);
-	g_return_if_fail (source != NULL);
+	component = attachment_handler_get_component (attachment);
+	g_return_if_fail (component != NULL);
 
 	dialog = gtk_dialog_new_with_buttons (
 		title, parent, GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -332,10 +337,11 @@ attachment_handler_run_dialog (GtkWindow *parent,
 
 	container = widget;
 
-	widget = e_source_selector_new (source_list);
+	shell = e_shell_get_default ();
+	registry = e_shell_get_registry (shell);
+	widget = e_source_selector_new (registry, extension_name);
 	selector = E_SOURCE_SELECTOR (widget);
-	e_source_selector_set_primary_selection (selector, source);
-	e_source_selector_show_selection (selector, FALSE);
+	e_source_selector_set_show_toggles (selector, FALSE);
 	gtk_container_add (GTK_CONTAINER (container), widget);
 	gtk_widget_show (widget);
 
@@ -352,14 +358,16 @@ attachment_handler_run_dialog (GtkWindow *parent,
 
 	switch (source_type) {
 	case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
-		e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL,
-			e_client_utils_authenticate_handler, NULL,
-			attachment_handler_import_event, g_object_ref (attachment));
+		e_client_utils_open_new (
+			source, E_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL,
+			attachment_handler_import_event,
+			g_object_ref (attachment));
 		break;
 	case E_CAL_CLIENT_SOURCE_TYPE_TASKS:
-		e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_TASKS, FALSE, NULL,
-			e_client_utils_authenticate_handler, NULL,
-			attachment_handler_import_todo, g_object_ref (attachment));
+		e_client_utils_open_new (
+			source, E_CLIENT_SOURCE_TYPE_TASKS, FALSE, NULL,
+			attachment_handler_import_todo,
+			g_object_ref (attachment));
 		break;
 	default:
 		break;
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index 5693994..8f0ba70 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -29,9 +29,9 @@
 #include <glib/gi18n.h>
 #include <libecal/e-cal-client.h>
 #include <libecal/e-cal-time-util.h>
+#include <libecal/e-source-calendar.h>
 #include <libedataserver/e-url.h>
 #include <libedataserver/e-source.h>
-#include <libedataserver/e-source-group.h>
 #include <libedataserverui/e-client-utils.h>
 
 #include "e-util/e-import.h"
@@ -39,10 +39,11 @@
 #include "shell/e-shell-backend.h"
 #include "shell/e-shell-window.h"
 #include "widgets/misc/e-preferences-window.h"
+#include "widgets/misc/e-source-config-dialog.h"
 
 #include "calendar/gui/comp-util.h"
-#include "calendar/gui/dialogs/calendar-setup.h"
 #include "calendar/gui/dialogs/event-editor.h"
+#include "calendar/gui/e-cal-source-config.h"
 #include "calendar/gui/e-calendar-view.h"
 #include "calendar/gui/gnome-cal.h"
 #include "calendar/importers/evolution-calendar-importer.h"
@@ -56,184 +57,13 @@
 #include "e-calendar-preferences.h"
 
 struct _ECalShellBackendPrivate {
-	ESourceList *source_list;
-};
-
-enum {
-	PROP_0,
-	PROP_SOURCE_LIST
+	gint placeholder;
 };
 
 static gpointer parent_class;
 static GType cal_shell_backend_type;
 
 static void
-cal_shell_backend_ensure_sources (EShellBackend *shell_backend)
-{
-	/* XXX This is basically the same algorithm across all backends.
-	 *     Maybe we could somehow integrate this into EShellBackend? */
-
-	ECalShellBackend *cal_shell_backend;
-	ESourceGroup *on_this_computer;
-	ESourceGroup *contacts;
-	ESourceList *source_list;
-	ESource *birthdays;
-	ESource *personal;
-	EShell *shell;
-	EShellSettings *shell_settings;
-	GSList *sources, *iter;
-	const gchar *name;
-	gchar *property;
-	gboolean save_list = FALSE;
-	GError *error = NULL;
-
-	birthdays = NULL;
-	personal = NULL;
-
-	cal_shell_backend = E_CAL_SHELL_BACKEND (shell_backend);
-
-	shell = e_shell_backend_get_shell (shell_backend);
-	shell_settings = e_shell_get_shell_settings (shell);
-
-	e_cal_client_get_sources (
-		&cal_shell_backend->priv->source_list,
-		E_CAL_CLIENT_SOURCE_TYPE_EVENTS, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Could not get calendar sources: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-		return;
-	}
-
-	source_list = cal_shell_backend->priv->source_list;
-
-	on_this_computer = e_source_list_ensure_group (
-		source_list, _("On This Computer"), "local:", TRUE);
-	contacts = e_source_list_ensure_group (
-		source_list, _("Contacts"), "contacts://", TRUE);
-	e_source_list_ensure_group (
-		source_list, _("On The Web"), "webcal://", FALSE);
-	e_source_list_ensure_group (
-		source_list, _("Weather"), "weather://", FALSE);
-
-	g_return_if_fail (on_this_computer != NULL);
-	g_return_if_fail (contacts != NULL);
-
-	sources = e_source_group_peek_sources (on_this_computer);
-
-	/* Make sure this group includes a "Personal" source. */
-	for (iter = sources; iter != NULL; iter = iter->next) {
-		ESource *source = iter->data;
-		const gchar *relative_uri;
-
-		relative_uri = e_source_peek_relative_uri (source);
-		if (g_strcmp0 (relative_uri, "system") == 0) {
-			personal = source;
-			break;
-		}
-	}
-
-	name = _("Personal");
-
-	if (personal == NULL) {
-		ESource *source;
-		GSList *selected;
-		gchar *primary;
-
-		source = e_source_new (name, "system");
-		e_source_set_color_spec (source, "#BECEDD");
-		e_source_group_add_source (on_this_computer, source, -1);
-		g_object_unref (source);
-		save_list = TRUE;
-
-		primary = e_shell_settings_get_string (
-			shell_settings, "cal-primary-calendar");
-
-		selected = e_cal_shell_backend_get_selected_calendars (
-			cal_shell_backend);
-
-		if (primary == NULL && selected == NULL) {
-			const gchar *uid;
-
-			uid = e_source_peek_uid (source);
-			selected = g_slist_prepend (NULL, g_strdup (uid));
-
-			e_shell_settings_set_string (
-				shell_settings, "cal-primary-calendar", uid);
-			e_cal_shell_backend_set_selected_calendars (
-				cal_shell_backend, selected);
-		}
-
-		g_slist_foreach (selected, (GFunc) g_free, NULL);
-		g_slist_free (selected);
-		g_free (primary);
-	} else {
-		/* Force the source name to the current locale. */
-		e_source_set_name (personal, name);
-	}
-
-	sources = e_source_group_peek_sources (contacts);
-
-	if (sources != NULL) {
-		GSList *trash;
-
-		/* There is only one source under Contacts. */
-		birthdays = E_SOURCE (sources->data);
-		sources = g_slist_next (sources);
-
-		/* Delete any other sources in this group.
-		 * Earlier versions allowed you to create
-		 * additional sources under Contacts. */
-		trash = g_slist_copy (sources);
-		while (trash != NULL) {
-			ESource *source = trash->data;
-			e_source_group_remove_source (contacts, source);
-			trash = g_slist_delete_link (trash, trash);
-			save_list = TRUE;
-		}
-	}
-
-	/* XXX e_source_group_get_property() returns a newly-allocated
-	 *     string when it could just as easily return a const string.
-	 *     Unfortunately, fixing that would break the API. */
-	property = e_source_group_get_property (contacts, "create_source");
-	if (property == NULL)
-		e_source_group_set_property (contacts, "create_source", "no");
-	g_free (property);
-
-	name = _("Birthdays & Anniversaries");
-
-	if (birthdays == NULL) {
-		ESource *source;
-
-		source = e_source_new (name, "/");
-		e_source_group_add_source (contacts, source, -1);
-		g_object_unref (source);
-		save_list = TRUE;
-
-		/* This is now a borrowed reference. */
-		birthdays = source;
-	} else {
-		/* Force the source name to the current locale. */
-		e_source_set_name (birthdays, name);
-	}
-
-	if (e_source_get_property (birthdays, "delete") == NULL)
-		e_source_set_property (birthdays, "delete", "no");
-
-	if (e_source_peek_color_spec (birthdays) == NULL)
-		e_source_set_color_spec (birthdays, "#DDBECE");
-
-	g_object_unref (on_this_computer);
-	g_object_unref (contacts);
-
-	if (save_list)
-		e_source_list_sync (source_list, NULL);
-}
-
-static void
 cal_shell_backend_new_event (ESource *source,
                              GAsyncResult *result,
                              EShell *shell,
@@ -254,7 +84,7 @@ cal_shell_backend_new_event (ESource *source,
 		g_warn_if_fail (client == NULL);
 		g_warning (
 			"%s: Failed to open '%s': %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_error_free (error);
 		return;
@@ -343,13 +173,12 @@ action_event_new_cb (GtkAction *action,
 {
 	EShell *shell;
 	EShellView *shell_view;
-	EShellBackend *shell_backend;
-	EShellSettings *shell_settings;
-	ESource *source = NULL;
-	ESourceList *source_list;
-	EClientSourceType source_type;
+	ESource *source;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
 	const gchar *action_name;
-	gchar *uid;
+
+	shell = e_shell_window_get_shell (shell_window);
 
 	/* With a 'calendar' active shell view pass the new appointment
 	 * request to it, thus the event will inherit selected time from
@@ -386,50 +215,57 @@ action_event_new_cb (GtkAction *action,
 
 	source_type = E_CLIENT_SOURCE_TYPE_EVENTS;
 
-	shell = e_shell_window_get_shell (shell_window);
-	shell_settings = e_shell_get_shell_settings (shell);
-	shell_backend = e_shell_get_backend_by_name (shell, "calendar");
-
-	g_object_get (shell_backend, "source-list", &source_list, NULL);
-	g_return_if_fail (E_IS_SOURCE_LIST (source_list));
-
-	uid = e_shell_settings_get_string (
-		shell_settings, "cal-primary-calendar");
-
-	if (uid != NULL) {
-		source = e_source_list_peek_source_by_uid (source_list, uid);
-		g_free (uid);
-	}
-
-	if (source == NULL)
-		source = e_source_list_peek_default_source (source_list);
-
-	g_return_if_fail (E_IS_SOURCE (source));
+	registry = e_shell_get_registry (shell);
+	source = e_source_registry_get_default_calendar (registry);
 
 	/* Use a callback function appropriate for the action.
 	 * FIXME Need to obtain a better default time zone. */
 	action_name = gtk_action_get_name (action);
 	if (strcmp (action_name, "event-all-day-new") == 0)
-		e_client_utils_open_new (source, source_type, FALSE, NULL,
-			e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
-			cal_shell_backend_event_all_day_new_cb, g_object_ref (shell));
+		e_client_utils_open_new (
+			source, source_type, FALSE, NULL,
+			cal_shell_backend_event_all_day_new_cb,
+			g_object_ref (shell));
 	else if (strcmp (action_name, "event-meeting-new") == 0)
-		e_client_utils_open_new (source, source_type, FALSE, NULL,
-			e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
-			cal_shell_backend_event_meeting_new_cb, g_object_ref (shell));
+		e_client_utils_open_new (
+			source, source_type, FALSE, NULL,
+			cal_shell_backend_event_meeting_new_cb,
+			g_object_ref (shell));
 	else
-		e_client_utils_open_new (source, source_type, FALSE, NULL,
-			e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
-			cal_shell_backend_event_new_cb, g_object_ref (shell));
-
-	g_object_unref (source_list);
+		e_client_utils_open_new (
+			source, source_type, FALSE, NULL,
+			cal_shell_backend_event_new_cb,
+			g_object_ref (shell));
 }
 
 static void
 action_calendar_new_cb (GtkAction *action,
                         EShellWindow *shell_window)
 {
-	calendar_setup_new_calendar (GTK_WINDOW (shell_window));
+	EShell *shell;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
+
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_EVENTS;
+	config = e_cal_source_config_new (registry, NULL, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("New Calendar"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static GtkActionEntry item_entries[] = {
@@ -506,7 +342,7 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	ECalClient *client;
 	ECalComponent *comp;
 	ESource *source;
-	ESourceList *source_list;
+	ESourceRegistry *registry;
 	ECalClientSourceType source_type;
 	EUri *euri;
 	icalcomponent *icalcomp;
@@ -603,21 +439,10 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	 * we successfully open it is another matter... */
 	handled = TRUE;
 
-	e_cal_client_get_sources (&source_list, source_type, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Could not get calendar sources: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-		goto exit;
-	}
-
-	source = e_source_list_peek_source_by_uid (source_list, source_uid);
-
+	registry = e_shell_get_registry (shell);
+	source = e_source_registry_lookup_by_uid (registry, source_uid);
 	if (source == NULL) {
-		g_warning ("%s: No source for UID '%s'", G_STRFUNC, source_uid);
-		g_object_unref (source_list);
+		g_printerr ("No source for UID '%s'\n", source_uid);
 		goto exit;
 	}
 
@@ -629,9 +454,10 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	if (error != NULL) {
 		g_warning (
 			"%s: Failed to create/open client '%s': %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
-		g_object_unref (source_list);
+		if (client != NULL)
+			g_object_unref (client);
 		g_error_free (error);
 		goto exit;
 	}
@@ -651,7 +477,7 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 		g_warning (
 			"%s: Failed to get object from client: %s",
 			G_STRFUNC, error->message);
-		g_object_unref (source_list);
+		g_object_unref (client);
 		g_error_free (error);
 		goto exit;
 	}
@@ -668,10 +494,10 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	if (icalprop != NULL)
 		flags |= COMP_EDITOR_MEETING;
 
-	if (itip_organizer_is_user (comp, client))
+	if (itip_organizer_is_user (registry, comp, client))
 		flags |= COMP_EDITOR_USER_ORG;
 
-	if (itip_sentby_is_user (comp, client))
+	if (itip_sentby_is_user (registry, comp, client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	if (!e_cal_component_has_attendees (comp))
@@ -685,7 +511,6 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 present:
 	gtk_window_present (GTK_WINDOW (editor));
 
-	g_object_unref (source_list);
 	g_object_unref (client);
 
 exit:
@@ -719,40 +544,6 @@ cal_shell_backend_window_added_cb (EShellBackend *shell_backend,
 }
 
 static void
-cal_shell_backend_get_property (GObject *object,
-                                guint property_id,
-                                GValue *value,
-                                GParamSpec *pspec)
-{
-	switch (property_id) {
-		case PROP_SOURCE_LIST:
-			g_value_set_object (
-				value,
-				e_cal_shell_backend_get_source_list (
-				E_CAL_SHELL_BACKEND (object)));
-			return;
-	}
-
-	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-cal_shell_backend_dispose (GObject *object)
-{
-	ECalShellBackendPrivate *priv;
-
-	priv = E_CAL_SHELL_BACKEND (object)->priv;
-
-	if (priv->source_list != NULL) {
-		g_object_unref (priv->source_list);
-		priv->source_list = NULL;
-	}
-
-	/* Chain up to parent's dispose() method. */
-	G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
 cal_shell_backend_constructed (GObject *object)
 {
 	EShell *shell;
@@ -762,8 +553,6 @@ cal_shell_backend_constructed (GObject *object)
 	shell_backend = E_SHELL_BACKEND (object);
 	shell = e_shell_backend_get_shell (shell_backend);
 
-	cal_shell_backend_ensure_sources (shell_backend);
-
 	g_signal_connect_swapped (
 		shell, "handle-uri",
 		G_CALLBACK (cal_shell_backend_handle_uri_cb),
@@ -803,8 +592,6 @@ cal_shell_backend_class_init (ECalShellBackendClass *class)
 	g_type_class_add_private (class, sizeof (ECalShellBackendPrivate));
 
 	object_class = G_OBJECT_CLASS (class);
-	object_class->get_property = cal_shell_backend_get_property;
-	object_class->dispose = cal_shell_backend_dispose;
 	object_class->constructed = cal_shell_backend_constructed;
 
 	shell_backend_class = E_SHELL_BACKEND_CLASS (class);
@@ -817,15 +604,8 @@ cal_shell_backend_class_init (ECalShellBackendClass *class)
 	shell_backend_class->start = NULL;
 	shell_backend_class->migrate = e_cal_shell_backend_migrate;
 
-	g_object_class_install_property (
-		object_class,
-		PROP_SOURCE_LIST,
-		g_param_spec_object (
-			"source-list",
-			"Source List",
-			"The registry of calendars",
-			E_TYPE_SOURCE_LIST,
-			G_PARAM_READABLE));
+	/* Register relevant ESource extensions. */
+	E_TYPE_SOURCE_CALENDAR;
 }
 
 static void
@@ -889,50 +669,6 @@ e_cal_shell_backend_register_type (GTypeModule *type_module)
 		"ECalShellBackend", &type_info, 0);
 }
 
-ESourceList *
-e_cal_shell_backend_get_source_list (ECalShellBackend *cal_shell_backend)
-{
-	g_return_val_if_fail (
-		E_IS_CAL_SHELL_BACKEND (cal_shell_backend), NULL);
-
-	return cal_shell_backend->priv->source_list;
-}
-
-GSList *
-e_cal_shell_backend_get_selected_calendars (ECalShellBackend *cal_shell_backend)
-{
-	GConfClient *client;
-	GSList *selected_calendars;
-	const gchar *key;
-
-	g_return_val_if_fail (
-		E_IS_CAL_SHELL_BACKEND (cal_shell_backend), NULL);
-
-	client = gconf_client_get_default ();
-	key = "/apps/evolution/calendar/display/selected_calendars";
-	selected_calendars = gconf_client_get_list (
-		client, key, GCONF_VALUE_STRING, NULL);
-	g_object_unref (client);
-
-	return selected_calendars;
-}
-
-void
-e_cal_shell_backend_set_selected_calendars (ECalShellBackend *cal_shell_backend,
-                                            GSList *selected_calendars)
-{
-	GConfClient *client;
-	const gchar *key;
-
-	g_return_if_fail (E_IS_CAL_SHELL_BACKEND (cal_shell_backend));
-
-	client = gconf_client_get_default ();
-	key = "/apps/evolution/calendar/display/selected_calendars";
-	gconf_client_set_list (
-		client, key, GCONF_VALUE_STRING, selected_calendars, NULL);
-	g_object_unref (client);
-}
-
 void
 e_cal_shell_backend_open_date_range (ECalShellBackend *cal_shell_backend,
                                      const GDate *start_date,
diff --git a/modules/calendar/e-cal-shell-backend.h b/modules/calendar/e-cal-shell-backend.h
index 32fca7f..400d769 100644
--- a/modules/calendar/e-cal-shell-backend.h
+++ b/modules/calendar/e-cal-shell-backend.h
@@ -23,7 +23,6 @@
 #define E_CAL_SHELL_BACKEND_H
 
 #include <shell/e-shell-backend.h>
-#include <libedataserver/e-source-list.h>
 
 /* Standard GObject macros */
 #define E_TYPE_CAL_SHELL_BACKEND \
@@ -62,13 +61,6 @@ struct _ECalShellBackendClass {
 GType		e_cal_shell_backend_get_type	(void);
 void		e_cal_shell_backend_register_type
 					(GTypeModule *type_module);
-ESourceList *	e_cal_shell_backend_get_source_list
-					(ECalShellBackend *cal_shell_backend);
-GSList *	e_cal_shell_backend_get_selected_calendars
-					(ECalShellBackend *cal_shell_backend);
-void		e_cal_shell_backend_set_selected_calendars
-					(ECalShellBackend *cal_shell_backend,
-					 GSList *selected_calendars);
 void		e_cal_shell_backend_open_date_range
 					(ECalShellBackend *cal_shell_backend,
 					 const GDate *start_date,
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index 81fc76b..c4ffe91 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -331,6 +331,7 @@ cal_shell_content_constructed (GObject *object)
 	EShellContent *foreign_content;
 	EShellView *foreign_view;
 	GnomeCalendar *calendar;
+	ESourceRegistry *registry;
 	GalViewInstance *view_instance;
 	GConfBridge *bridge;
 	GtkWidget *container;
@@ -400,7 +401,8 @@ cal_shell_content_constructed (GObject *object)
 	/* Add views in the order defined by GnomeCalendarViewType, such
 	 * that the notebook page number corresponds to the view type. */
 
-	priv->calendar = gnome_calendar_new ();
+	registry = e_shell_get_registry (shell);
+	priv->calendar = gnome_calendar_new (registry);
 	calendar = GNOME_CALENDAR (priv->calendar);
 
 	for (ii = 0; ii < GNOME_CAL_LAST_VIEW; ii++) {
diff --git a/modules/calendar/e-cal-shell-migrate.c b/modules/calendar/e-cal-shell-migrate.c
index dd76049..3b92c99 100644
--- a/modules/calendar/e-cal-shell-migrate.c
+++ b/modules/calendar/e-cal-shell-migrate.c
@@ -25,189 +25,6 @@
 
 #include "e-cal-shell-migrate.h"
 
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include <libebackend/e-dbhash.h>
-#include <libedataserver/e-source.h>
-#include <libedataserver/e-source-group.h>
-#include <libedataserver/e-source-list.h>
-#include <libedataserver/e-xml-hash-utils.h>
-
-#include "e-util/e-util-private.h"
-#include "calendar/gui/calendar-config-keys.h"
-#include "calendar/gui/e-cal-event.h"
-#include "shell/e-shell.h"
-
-#include "e-cal-shell-backend.h"
-
-#define LOCAL_BASE_URI "local:"
-#define WEBCAL_BASE_URI "webcal://"
-#define CONTACTS_BASE_URI "contacts://"
-#define BAD_CONTACTS_BASE_URI "contact://"
-#define PERSONAL_RELATIVE_URI "system"
-
-static ESourceGroup *
-create_calendar_contact_source (ESourceList *source_list)
-{
-	ESourceGroup *group;
-	ESource *source;
-
-	/* Create the contacts group */
-	group = e_source_group_new (_("Contacts"), CONTACTS_BASE_URI);
-	e_source_list_add_group (source_list, group, -1);
-
-	source = e_source_new (_("Birthdays & Anniversaries"), "/");
-	e_source_group_add_source (group, source, -1);
-	g_object_unref (source);
-
-	e_source_set_color_spec (source, "#FED4D3");
-	e_source_group_set_readonly (group, TRUE);
-
-	return group;
-}
-
-static void
-create_calendar_sources (EShellBackend *shell_backend,
-                         ESourceList *source_list,
-                         ESourceGroup **on_this_computer,
-                         ESource **personal_source,
-                         ESourceGroup **on_the_web,
-                         ESourceGroup **contacts)
-{
-	EShell *shell;
-	EShellSettings *shell_settings;
-	GSList *groups;
-	ESourceGroup *group;
-
-	*on_this_computer = NULL;
-	*on_the_web = NULL;
-	*contacts = NULL;
-	*personal_source = NULL;
-
-	shell = e_shell_backend_get_shell (shell_backend);
-	shell_settings = e_shell_get_shell_settings (shell);
-
-	groups = e_source_list_peek_groups (source_list);
-	if (groups) {
-		/* groups are already there, we need to search for things... */
-		GSList *g;
-		const gchar *data_dir;
-		gchar *base_dir, *base_uri;
-
-		data_dir = e_shell_backend_get_data_dir (shell_backend);
-		base_dir = g_build_filename (data_dir, "local", NULL);
-		base_uri = g_filename_to_uri (base_dir, NULL, NULL);
-
-		for (g = groups; g; g = g->next) {
-
-			group = E_SOURCE_GROUP (g->data);
-
-			if (!strcmp (BAD_CONTACTS_BASE_URI, e_source_group_peek_base_uri (group)))
-				e_source_group_set_base_uri (group, CONTACTS_BASE_URI);
-
-			if (!strcmp (base_uri, e_source_group_peek_base_uri (group)))
-				e_source_group_set_base_uri (group, LOCAL_BASE_URI);
-
-			if (!*on_this_computer && !strcmp (LOCAL_BASE_URI,
-				e_source_group_peek_base_uri (group)))
-				*on_this_computer = g_object_ref (group);
-
-			else if (!*on_the_web && !strcmp (WEBCAL_BASE_URI,
-				e_source_group_peek_base_uri (group)))
-				*on_the_web = g_object_ref (group);
-
-			else if (!*contacts && !strcmp (CONTACTS_BASE_URI,
-				e_source_group_peek_base_uri (group)))
-				*contacts = g_object_ref (group);
-		}
-
-		g_free (base_dir);
-		g_free (base_uri);
-	}
-
-	if (*on_this_computer) {
-		/* make sure "Personal" shows up as a source under
-		 * this group */
-		GSList *sources = e_source_group_peek_sources (*on_this_computer);
-		GSList *s;
-		for (s = sources; s; s = s->next) {
-			ESource *source = E_SOURCE (s->data);
-			const gchar *relative_uri;
-
-			relative_uri = e_source_peek_relative_uri (source);
-			if (relative_uri == NULL)
-				continue;
-			if (!strcmp (PERSONAL_RELATIVE_URI, relative_uri)) {
-				*personal_source = g_object_ref (source);
-				break;
-			}
-		}
-	} else {
-		/* create the local source group */
-		group = e_source_group_new (_("On This Computer"), LOCAL_BASE_URI);
-		e_source_list_add_group (source_list, group, -1);
-
-		*on_this_computer = group;
-	}
-
-	if (!*personal_source) {
-		GSList *selected;
-		gchar *primary_calendar;
-
-		/* Create the default Person calendar */
-		ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI);
-		e_source_group_add_source (*on_this_computer, source, -1);
-
-		primary_calendar = e_shell_settings_get_string (
-			shell_settings, "cal-primary-calendar");
-
-		selected = e_cal_shell_backend_get_selected_calendars (
-			E_CAL_SHELL_BACKEND (shell_backend));
-
-		if (primary_calendar == NULL && selected == NULL) {
-			GSList link;
-
-			e_shell_settings_set_string (
-				shell_settings, "cal-primary-calendar",
-				e_source_peek_uid (source));
-
-			link.data = (gpointer) e_source_peek_uid (source);
-			link.next = NULL;
-
-			e_cal_shell_backend_set_selected_calendars (
-				E_CAL_SHELL_BACKEND (shell_backend), &link);
-		}
-
-		g_slist_foreach (selected, (GFunc) g_free, NULL);
-		g_slist_free (selected);
-
-		g_free (primary_calendar);
-		e_source_set_color_spec (source, "#BECEDD");
-		*personal_source = source;
-	}
-
-	if (!*on_the_web) {
-		/* Create the Webcal source group */
-		group = e_source_group_new (_("On The Web"), WEBCAL_BASE_URI);
-		e_source_list_add_group (source_list, group, -1);
-
-		*on_the_web = group;
-	}
-
-	if (!*contacts) {
-		group = create_calendar_contact_source (source_list);
-
-		*contacts = group;
-	}
-}
-
 gboolean
 e_cal_shell_backend_migrate (EShellBackend *shell_backend,
                              gint major,
@@ -215,46 +32,6 @@ e_cal_shell_backend_migrate (EShellBackend *shell_backend,
                              gint micro,
                              GError **error)
 {
-	ESourceGroup *on_this_computer = NULL, *on_the_web = NULL, *contacts = NULL;
-	ESource *personal_source = NULL;
-	ESourceList *source_list;
-	ECalEvent *ece;
-	ECalEventTargetBackend *target;
-
-	g_object_get (shell_backend, "source-list", &source_list, NULL);
-
-	/* we call this unconditionally now - create_groups either
-	 * creates the groups/sources or it finds the necessary
-	 * groups/sources. */
-	create_calendar_sources (
-		shell_backend, source_list, &on_this_computer,
-		&personal_source, &on_the_web, &contacts);
-
-	e_source_list_sync (source_list, NULL);
-
-	/** @Event: component.migration
-	 * @Title: Migration step in component initialization
-	 * @Target: ECalEventTargetComponent
-	 *
-	 * component.migration is emitted during the calendar component
-	 * initialization process. This allows new calendar backend types
-	 * to be distributed as an e-d-s backend and a plugin without
-	 * reaching their grubby little fingers into migration.c
-	 */
-	/* Fire off migration event */
-	ece = e_cal_event_peek ();
-	target = e_cal_event_target_new_module (ece, shell_backend, source_list, 0);
-	e_event_emit ((EEvent *) ece, "module.migration", (EEventTarget *) target);
-
-	if (on_this_computer)
-		g_object_unref (on_this_computer);
-	if (on_the_web)
-		g_object_unref (on_the_web);
-	if (contacts)
-		g_object_unref (contacts);
-	if (personal_source)
-		g_object_unref (personal_source);
-
 	return TRUE;
 }
 
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 77c5639..5d44a7a 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -27,6 +27,8 @@
 
 #include <string.h>
 #include <glib/gi18n.h>
+#include <libecal/e-source-calendar.h>
+#include <libedataserver/e-source-password.h>
 #include <libedataserverui/e-client-utils.h>
 
 #include "e-util/e-alert-dialog.h"
@@ -35,7 +37,6 @@
 
 #include "calendar/gui/e-calendar-selector.h"
 #include "calendar/gui/misc.h"
-#include "calendar/gui/dialogs/calendar-setup.h"
 
 #include "e-cal-shell-view.h"
 #include "e-cal-shell-backend.h"
@@ -45,6 +46,7 @@ struct _ECalShellSidebarPrivate {
 	GtkWidget *paned;
 	GtkWidget *selector;
 	GtkWidget *date_navigator;
+	GtkWidget *new_calendar_button;
 
 	/* UID -> Client */
 	GHashTable *client_table;
@@ -125,7 +127,7 @@ cal_shell_sidebar_backend_died_cb (ECalShellSidebar *cal_shell_sidebar,
 	shell_content = e_shell_view_get_shell_content (shell_view);
 
 	source = e_client_get_source (E_CLIENT (client));
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 
 	g_object_ref (source);
 
@@ -147,21 +149,30 @@ cal_shell_sidebar_backend_error_cb (ECalShellSidebar *cal_shell_sidebar,
 	EShellView *shell_view;
 	EShellContent *shell_content;
 	EShellSidebar *shell_sidebar;
-	ESourceGroup *source_group;
+	ESource *parent;
 	ESource *source;
+	GNode *node;
+	const gchar *parent_display_name;
+	const gchar *source_display_name;
 
 	shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
 	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
 	shell_content = e_shell_view_get_shell_content (shell_view);
 
 	source = e_client_get_source (E_CLIENT (client));
-	source_group = e_source_peek_group (source);
+
+	node = e_source_get_node (source);
+	g_return_if_fail (node != NULL);
+	g_return_if_fail (node->parent != NULL);
+
+	parent = E_SOURCE (node->parent->data);
+
+	parent_display_name = e_source_get_display_name (parent);
+	source_display_name = e_source_get_display_name (source);
 
 	e_alert_submit (
-		E_ALERT_SINK (shell_content),
-		"calendar:backend-error",
-		e_source_group_peek_name (source_group),
-		e_source_peek_name (source), message, NULL);
+		E_ALERT_SINK (shell_content), "calendar:backend-error",
+		parent_display_name, source_display_name, message, NULL);
 }
 
 static void
@@ -231,20 +242,6 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object,
 		return;
 	}
 
-	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED) ||
-	    g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_REQUIRED))
-		e_client_utils_forget_password (E_CLIENT (client));
-
-	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED)) {
-		e_client_open (
-			E_CLIENT (client), FALSE,
-			cal_shell_sidebar->priv->loading_clients,
-			cal_shell_sidebar_client_opened_cb, user_data);
-
-		g_clear_error (&error);
-		return;
-	}
-
 	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) {
 		struct RetryOpenData *rod;
 
@@ -275,7 +272,7 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object,
 		case E_CLIENT_ERROR_BUSY:
 			g_warning (
 				"%s: Cannot open '%s', it's busy (%s)",
-				G_STRFUNC, e_source_peek_name (source),
+				G_STRFUNC, e_source_get_display_name (source),
 				error->message);
 			g_clear_error (&error);
 			return;
@@ -395,8 +392,6 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
                                ESource *source)
 {
 	ECalShellSidebarPrivate *priv;
-	EShellView *shell_view;
-	EShellWindow *shell_window;
 	EShellSidebar *shell_sidebar;
 	ECalClient *client;
 	const gchar *uid;
@@ -406,8 +401,6 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
 	/* FIXME Sidebar should not be accessing the EShellContent.
 	 *       This probably needs to be moved to ECalShellView. */
 	shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
-	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_window = e_shell_view_get_shell_window (shell_view);
 
 	/* Cancel any unfinished previous request. */
 	if (priv->loading_default_client != NULL) {
@@ -416,7 +409,7 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
 		priv->loading_default_client = NULL;
 	}
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (priv->client_table, uid);
 
 	/* If we already have an open connection for
@@ -434,8 +427,6 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
 	e_client_utils_open_new (
 		source, E_CLIENT_SOURCE_TYPE_EVENTS,
 		FALSE, priv->loading_default_client,
-		e_client_utils_authenticate_handler,
-		GTK_WINDOW (shell_window),
 		cal_shell_sidebar_default_loaded_cb,
 		g_object_ref (shell_sidebar));
 }
@@ -467,38 +458,6 @@ cal_shell_sidebar_row_changed_cb (ECalShellSidebar *cal_shell_sidebar,
 }
 
 static void
-cal_shell_sidebar_selection_changed_cb (ECalShellSidebar *cal_shell_sidebar,
-                                        ESourceSelector *selector)
-{
-	EShellView *shell_view;
-	EShellBackend *shell_backend;
-	EShellSidebar *shell_sidebar;
-	GSList *list, *iter;
-
-	/* This signal is emitted less frequently than "row-changed",
-	 * especially when the model is being rebuilt.  So we'll take
-	 * it easy on poor GConf. */
-
-	shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
-	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_backend = e_shell_view_get_shell_backend (shell_view);
-
-	list = e_source_selector_get_selection (selector);
-
-	for (iter = list; iter != NULL; iter = iter->next) {
-		ESource *source = iter->data;
-
-		iter->data = (gpointer) e_source_peek_uid (source);
-		g_object_unref (source);
-	}
-
-	e_cal_shell_backend_set_selected_calendars (
-		E_CAL_SHELL_BACKEND (shell_backend), list);
-
-	g_slist_free (list);
-}
-
-static void
 cal_shell_sidebar_primary_selection_changed_cb (ECalShellSidebar *cal_shell_sidebar,
                                                 ESourceSelector *selector)
 {
@@ -520,12 +479,10 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 	EShell *shell;
 	EShellBackend *shell_backend;
 	EShellSettings *shell_settings;
+	ESourceRegistry *registry;
 	ESourceSelector *selector;
-	ESourceList *source_list;
-	ESource *source;
 	GConfBridge *bridge;
 	GtkTreeModel *model;
-	GSList *list, *iter;
 	GObject *object;
 	const gchar *key;
 
@@ -540,8 +497,7 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 	selector = E_SOURCE_SELECTOR (priv->selector);
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));
 
-	source_list = e_cal_shell_backend_get_source_list (
-		E_CAL_SHELL_BACKEND (shell_backend));
+	registry = e_shell_get_registry (shell);
 
 	g_signal_connect_swapped (
 		model, "row-changed",
@@ -560,31 +516,9 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 		G_BINDING_SYNC_CREATE,
 		(GBindingTransformFunc) e_binding_transform_uid_to_source,
 		(GBindingTransformFunc) e_binding_transform_source_to_uid,
-		g_object_ref (source_list),
+		g_object_ref (registry),
 		(GDestroyNotify) g_object_unref);
 
-	list = e_cal_shell_backend_get_selected_calendars (
-		E_CAL_SHELL_BACKEND (shell_backend));
-
-	for (iter = list; iter != NULL; iter = iter->next) {
-		const gchar *uid = iter->data;
-
-		source = e_source_list_peek_source_by_uid (source_list, uid);
-
-		if (source != NULL)
-			e_source_selector_select_source (selector, source);
-	}
-
-	g_slist_foreach (list, (GFunc) g_free, NULL);
-	g_slist_free (list);
-
-	/* Listen for subsequent changes to the selector. */
-
-	g_signal_connect_swapped (
-		selector, "selection-changed",
-		G_CALLBACK (cal_shell_sidebar_selection_changed_cb),
-		shell_sidebar);
-
 	/* Bind GObject properties to GConf keys. */
 
 	bridge = gconf_bridge_get ();
@@ -648,6 +582,11 @@ cal_shell_sidebar_dispose (GObject *object)
 		priv->date_navigator = NULL;
 	}
 
+	if (priv->new_calendar_button != NULL) {
+		g_object_unref (priv->new_calendar_button);
+		priv->new_calendar_button = NULL;
+	}
+
 	if (priv->default_client != NULL) {
 		g_object_unref (priv->default_client);
 		priv->default_client = NULL;
@@ -685,19 +624,6 @@ cal_shell_sidebar_finalize (GObject *object)
 }
 
 static void
-new_calendar_clicked (GtkButton *button,
-                      EShellSidebar *shell_sidebar)
-{
-	EShellView *shell_view;
-	EShellWindow *shell_window;
-
-	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_window = e_shell_view_get_shell_window (shell_view);
-
-	calendar_setup_new_calendar (GTK_WINDOW (shell_window));
-}
-
-static void
 cal_shell_sidebar_constructed (GObject *object)
 {
 	ECalShellSidebarPrivate *priv;
@@ -707,7 +633,7 @@ cal_shell_sidebar_constructed (GObject *object)
 	EShellBackend *shell_backend;
 	EShellSidebar *shell_sidebar;
 	EShellSettings *shell_settings;
-	ESourceList *source_list;
+	ESourceRegistry *registry;
 	ECalendarItem *calitem;
 	GtkWidget *container;
 	GtkWidget *widget;
@@ -726,9 +652,6 @@ cal_shell_sidebar_constructed (GObject *object)
 	shell = e_shell_backend_get_shell (shell_backend);
 	shell_settings = e_shell_get_shell_settings (shell);
 
-	source_list = e_cal_shell_backend_get_source_list (
-		E_CAL_SHELL_BACKEND (shell_backend));
-
 	container = GTK_WIDGET (shell_sidebar);
 
 	widget = e_paned_new (GTK_ORIENTATION_VERTICAL);
@@ -738,34 +661,36 @@ cal_shell_sidebar_constructed (GObject *object)
 
 	container = widget;
 
+	widget = gtk_vbox_new (FALSE, 6);
+	gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	/* "New Calendar" button is only shown in express mode.
+	 * ECalShellView will bind the button to an appropriate
+	 * GtkAction so we don't have to reimplement it here. */
+	if (e_shell_get_express_mode (shell)) {
+		widget = gtk_button_new ();
+		gtk_box_pack_end (
+			GTK_BOX (container), widget, FALSE, FALSE, 0);
+		priv->new_calendar_button = 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);
-	if (!e_shell_get_express_mode (shell)) {
-		gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
-	} else {
-		GtkWidget *button;
-
-		container = gtk_vbox_new (FALSE, 6);
-		gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
-
-		button = gtk_button_new_with_mnemonic (_("_New Calendar..."));
-		gtk_box_pack_start (GTK_BOX (container), button, FALSE, FALSE, 0);
-		g_signal_connect (
-			button, "clicked",
-			G_CALLBACK (new_calendar_clicked), shell_sidebar);
-
-		gtk_paned_pack1 (GTK_PANED (priv->paned), container, TRUE, TRUE);
-		gtk_widget_show_all (container);
-	}
+	gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
 	gtk_widget_show (widget);
 
 	container = widget;
 
-	widget = e_calendar_selector_new (source_list);
+	registry = e_shell_get_registry (shell);
+	widget = e_calendar_selector_new (registry);
 	e_source_selector_set_select_new (E_SOURCE_SELECTOR (widget), TRUE);
 	gtk_container_add (GTK_CONTAINER (container), widget);
 	a11y = gtk_widget_get_accessible (widget);
@@ -817,20 +742,23 @@ cal_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
 	source = e_source_selector_get_primary_selection (selector);
 
 	if (source != NULL) {
+		ESourceSelectable *extension;
 		ECalClient *client;
-		const gchar *uri;
-		const gchar *delete;
+		gboolean writable_hint;
+		const gchar *uid;
+
+		uid = e_source_get_uid (source);
+		is_system = (g_strcmp0 (uid, "system") == 0);
 
-		uri = e_source_peek_relative_uri (source);
-		is_system = (uri == NULL || strcmp (uri, "system") == 0);
+		extension = e_source_get_extension (
+			source, E_SOURCE_EXTENSION_CALENDAR);
+		writable_hint =
+			e_source_selectable_get_writable_hint (extension);
 
-		can_delete = !is_system;
-		delete = e_source_get_property (source, "delete");
-		can_delete &= (delete == NULL || strcmp (delete, "no") != 0);
+		can_delete = !is_system && writable_hint;
 
 		client = g_hash_table_lookup (
-			cal_shell_sidebar->priv->client_table,
-			e_source_peek_uid (source));
+			cal_shell_sidebar->priv->client_table, uid);
 		refresh_supported =
 			client && e_client_check_refresh_supported (E_CLIENT (client));
 	}
@@ -864,8 +792,7 @@ cal_shell_sidebar_client_removed (ECalShellSidebar *cal_shell_sidebar,
 		NULL, NULL, cal_shell_sidebar);
 
 	source = e_client_get_source (E_CLIENT (client));
-	uid = e_source_peek_uid (source);
-	g_return_if_fail (uid != NULL);
+	uid = e_source_get_uid (source);
 
 	g_hash_table_remove (client_table, uid);
 	e_source_selector_unselect_source (selector, source);
@@ -1042,6 +969,15 @@ e_cal_shell_sidebar_get_default_client (ECalShellSidebar *cal_shell_sidebar)
 	return cal_shell_sidebar->priv->default_client;
 }
 
+GtkWidget *
+e_cal_shell_sidebar_get_new_calendar_button (ECalShellSidebar *cal_shell_sidebar)
+{
+	g_return_val_if_fail (
+		E_IS_CAL_SHELL_SIDEBAR (cal_shell_sidebar), NULL);
+
+	return cal_shell_sidebar->priv->new_calendar_button;
+}
+
 ESourceSelector *
 e_cal_shell_sidebar_get_selector (ECalShellSidebar *cal_shell_sidebar)
 {
@@ -1066,8 +1002,8 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
 	ECalClient *default_client;
 	ECalClient *client;
 	icaltimezone *timezone;
+	const gchar *display_name;
 	const gchar *uid;
-	const gchar *uri;
 	gchar *message;
 
 	g_return_if_fail (E_IS_CAL_SHELL_SIDEBAR (cal_shell_sidebar));
@@ -1078,7 +1014,7 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
 	default_client = cal_shell_sidebar->priv->default_client;
 	selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (client_table, uid);
 
 	if (client != NULL)
@@ -1089,19 +1025,14 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
 		const gchar *default_uid;
 
 		default_source = e_client_get_source (E_CLIENT (default_client));
-		default_uid = e_source_peek_uid (default_source);
+		default_uid = e_source_get_uid (default_source);
 
 		if (g_strcmp0 (uid, default_uid) == 0)
 			client = g_object_ref (default_client);
 	}
 
-	if (client == NULL) {
+	if (client == NULL)
 		client = e_cal_client_new (source, source_type, NULL);
-		if (client)
-			g_signal_connect (
-				client, "authenticate",
-				G_CALLBACK (e_client_utils_authenticate_handler), NULL);
-	}
 
 	g_return_if_fail (client != NULL);
 
@@ -1118,9 +1049,8 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
 	g_hash_table_insert (client_table, g_strdup (uid), client);
 	e_source_selector_select_source (selector, source);
 
-	uri = e_client_get_uri (E_CLIENT (client));
-	/* Translators: The string field is a URI. */
-	message = g_strdup_printf (_("Opening calendar at %s"), uri);
+	display_name = e_source_get_display_name (source);
+	message = g_strdup_printf (_("Opening calendar '%s'"), display_name);
 	cal_shell_sidebar_emit_status_message (cal_shell_sidebar, message);
 	g_free (message);
 
@@ -1155,7 +1085,7 @@ e_cal_shell_sidebar_remove_source (ECalShellSidebar *cal_shell_sidebar,
 
 	client_table = cal_shell_sidebar->priv->client_table;
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (client_table, uid);
 
 	if (client == NULL)
diff --git a/modules/calendar/e-cal-shell-sidebar.h b/modules/calendar/e-cal-shell-sidebar.h
index 3e4d00a..0ba3326 100644
--- a/modules/calendar/e-cal-shell-sidebar.h
+++ b/modules/calendar/e-cal-shell-sidebar.h
@@ -88,6 +88,8 @@ ECalendar *	e_cal_shell_sidebar_get_date_navigator
 					(ECalShellSidebar *cal_shell_sidebar);
 ECalClient *	e_cal_shell_sidebar_get_default_client
 					(ECalShellSidebar *cal_shell_sidebar);
+GtkWidget *	e_cal_shell_sidebar_get_new_calendar_button
+					(ECalShellSidebar *cal_shell_sidebar);
 ESourceSelector *
 		e_cal_shell_sidebar_get_selector
 					(ECalShellSidebar *cal_shell_sidebar);
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index aa5738e..0185a72 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -36,13 +36,18 @@ action_calendar_copy_cb (GtkAction *action,
                          ECalShellView *cal_shell_view)
 {
 	ECalShellSidebar *cal_shell_sidebar;
-	EShellWindow *shell_window;
+	EShell *shell;
 	EShellView *shell_view;
+	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	ESourceSelector *selector;
 	ESource *source;
 
 	shell_view = E_SHELL_VIEW (cal_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
 
 	cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
 	selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
@@ -50,7 +55,7 @@ action_calendar_copy_cb (GtkAction *action,
 	g_return_if_fail (E_IS_SOURCE (source));
 
 	copy_source_dialog (
-		GTK_WINDOW (shell_window),
+		GTK_WINDOW (shell_window), registry,
 		source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS);
 }
 
@@ -58,33 +63,15 @@ static void
 action_calendar_delete_cb (GtkAction *action,
                            ECalShellView *cal_shell_view)
 {
-	ECalShellContent *cal_shell_content;
 	ECalShellSidebar *cal_shell_sidebar;
-	EShellBackend *shell_backend;
 	EShellWindow *shell_window;
 	EShellView *shell_view;
-	ECalendarView *calendar_view;
-	GnomeCalendarViewType view_type;
-	GnomeCalendar *calendar;
-	ECalModel *model;
-	ECalClient *client;
 	ESourceSelector *selector;
-	ESourceGroup *source_group;
-	ESourceList *source_list;
 	ESource *source;
 	gint response;
-	gchar *uri;
-	GError *error = NULL;
 
 	shell_view = E_SHELL_VIEW (cal_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
-	shell_backend = e_shell_view_get_shell_backend (shell_view);
-
-	cal_shell_content = cal_shell_view->priv->cal_shell_content;
-	calendar = e_cal_shell_content_get_calendar (cal_shell_content);
-	view_type = gnome_calendar_get_view (calendar);
-	calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
-	model = e_calendar_view_get_model (calendar_view);
 
 	cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
 	selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
@@ -95,49 +82,12 @@ action_calendar_delete_cb (GtkAction *action,
 	response = e_alert_run_dialog_for_args (
 		GTK_WINDOW (shell_window),
 		"calendar:prompt-delete-calendar",
-		e_source_peek_name (source), NULL);
-	if (response != GTK_RESPONSE_YES)
-		return;
+		e_source_get_display_name (source), NULL);
 
-	uri = e_source_get_uri (source);
-	client = e_cal_model_get_client_for_uri (model, uri);
-	if (client == NULL)
-		client = e_cal_client_new_from_uri (
-			uri, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
-	g_free (uri);
-
-	g_return_if_fail (client != NULL);
-
-	e_client_remove_sync (E_CLIENT (client), NULL, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Failed to remove client: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
+	if (response != GTK_RESPONSE_YES)
 		return;
-	}
-
-	if (e_source_selector_source_is_selected (selector, source)) {
-		e_cal_shell_sidebar_remove_source (
-			cal_shell_sidebar, source);
-		e_source_selector_unselect_source (selector, source);
-	}
-
-	source_group = e_source_peek_group (source);
-	e_source_group_remove_source (source_group, source);
-
-	source_list = e_cal_shell_backend_get_source_list (
-		E_CAL_SHELL_BACKEND (shell_backend));
 
-	e_source_list_sync (source_list, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Failed to sync source list: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-	}
+	e_shell_view_remove_source (shell_view, source);
 }
 
 static void
@@ -201,12 +151,34 @@ static void
 action_calendar_new_cb (GtkAction *action,
                         ECalShellView *cal_shell_view)
 {
+	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
 
 	shell_view = E_SHELL_VIEW (cal_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
-	calendar_setup_new_calendar (GTK_WINDOW (shell_window));
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_EVENTS;
+	config = e_cal_source_config_new (registry, NULL, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("New Calendar"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static void
@@ -271,11 +243,16 @@ static void
 action_calendar_properties_cb (GtkAction *action,
                                ECalShellView *cal_shell_view)
 {
-	ECalShellSidebar *cal_shell_sidebar;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ECalShellSidebar *cal_shell_sidebar;
+	ECalClientSourceType source_type;
 	ESource *source;
 	ESourceSelector *selector;
+	ESourceRegistry *registry;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
 
 	shell_view = E_SHELL_VIEW (cal_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
@@ -283,12 +260,23 @@ action_calendar_properties_cb (GtkAction *action,
 	cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
 	selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
 	source = e_source_selector_get_primary_selection (selector);
-	g_return_if_fail (E_IS_SOURCE (source));
+	g_return_if_fail (source != NULL);
+
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_EVENTS;
+	registry = e_source_selector_get_registry (selector);
+	config = e_cal_source_config_new (registry, source, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
 
-	/* XXX Does this -really- need a source group parameter? */
-	calendar_setup_edit_calendar (
-		GTK_WINDOW (shell_window), source,
-		e_source_peek_group (source));
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Calendar Properties"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static void
@@ -375,7 +363,6 @@ action_calendar_refresh_cb (GtkAction *action,
 	ECalClient *client;
 	ECalModel *model;
 	ESource *source;
-	gchar *uri;
 	GError *error = NULL;
 
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
@@ -387,10 +374,7 @@ action_calendar_refresh_cb (GtkAction *action,
 	source = e_source_selector_get_primary_selection (selector);
 	g_return_if_fail (E_IS_SOURCE (source));
 
-	uri = e_source_get_uri (source);
-	client = e_cal_model_get_client_for_uri (model, uri);
-	g_free (uri);
-
+	client = e_cal_model_get_client_for_source (model, source);
 	if (client == NULL)
 		return;
 
@@ -401,7 +385,7 @@ action_calendar_refresh_cb (GtkAction *action,
 	if (error != NULL) {
 		g_warning (
 			"%s: Failed to refresh '%s', %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_error_free (error);
 	}
@@ -510,7 +494,9 @@ action_event_copy_cb (GtkAction *action,
 	GnomeCalendarViewType view_type;
 	GnomeCalendar *calendar;
 	ECalendarView *calendar_view;
-	ESource *source_source = NULL, *destination_source = NULL;
+	ESource *source_source = NULL;
+	ESource *destination_source = NULL;
+	ESourceRegistry *registry;
 	ECalClient *destination_client = NULL;
 	GList *selected, *iter;
 	GError *error = NULL;
@@ -520,6 +506,8 @@ action_event_copy_cb (GtkAction *action,
 
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
 	calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+	registry = gnome_calendar_get_registry (calendar);
+
 	view_type = gnome_calendar_get_view (calendar);
 	calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
 
@@ -536,7 +524,7 @@ action_event_copy_cb (GtkAction *action,
 
 	/* Get a destination source from the user. */
 	destination_source = select_source_dialog (
-		GTK_WINDOW (shell_window),
+		GTK_WINDOW (shell_window), registry,
 		E_CAL_CLIENT_SOURCE_TYPE_EVENTS, source_source);
 	if (destination_source == NULL)
 		return;
@@ -546,9 +534,6 @@ action_event_copy_cb (GtkAction *action,
 		destination_source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
 	if (destination_client == NULL)
 		goto exit;
-	g_signal_connect (
-		destination_client, "authenticate",
-		G_CALLBACK (e_client_utils_authenticate_handler), NULL);
 
 	e_client_open_sync (E_CLIENT (destination_client), FALSE, NULL, &error);
 
@@ -726,6 +711,7 @@ action_event_forward_cb (GtkAction *action,
 	GnomeCalendarViewType view_type;
 	ECalendarView *calendar_view;
 	GnomeCalendar *calendar;
+	ESourceRegistry *registry;
 	ECalendarViewEvent *event;
 	ECalComponent *component;
 	ECalClient *client;
@@ -734,6 +720,8 @@ action_event_forward_cb (GtkAction *action,
 
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
 	calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+	registry = gnome_calendar_get_registry (calendar);
+
 	view_type = gnome_calendar_get_view (calendar);
 	calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
 
@@ -753,7 +741,7 @@ action_event_forward_cb (GtkAction *action,
 	e_cal_component_set_icalcomponent (
 		component, icalcomponent_new_clone (icalcomp));
 	itip_send_comp (
-		E_CAL_COMPONENT_METHOD_PUBLISH,
+		registry, E_CAL_COMPONENT_METHOD_PUBLISH,
 		component, client, NULL, NULL, NULL, TRUE, FALSE);
 
 	g_object_unref (component);
@@ -794,7 +782,9 @@ action_event_move_cb (GtkAction *action,
 	GnomeCalendarViewType view_type;
 	GnomeCalendar *calendar;
 	ECalendarView *calendar_view;
-	ESource *source_source = NULL, *destination_source = NULL;
+	ESource *source_source = NULL;
+	ESource *destination_source = NULL;
+	ESourceRegistry *registry;
 	ECalClient *destination_client = NULL;
 	GList *selected, *iter;
 	GError *error = NULL;
@@ -804,6 +794,8 @@ action_event_move_cb (GtkAction *action,
 
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
 	calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+	registry = gnome_calendar_get_registry (calendar);
+
 	view_type = gnome_calendar_get_view (calendar);
 	calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
 
@@ -820,7 +812,7 @@ action_event_move_cb (GtkAction *action,
 
 	/* Get a destination source from the user. */
 	destination_source = select_source_dialog (
-		GTK_WINDOW (shell_window),
+		GTK_WINDOW (shell_window), registry,
 		E_CAL_CLIENT_SOURCE_TYPE_EVENTS, source_source);
 	if (destination_source == NULL)
 		return;
@@ -830,9 +822,6 @@ action_event_move_cb (GtkAction *action,
 		destination_source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
 	if (destination_client == NULL)
 		goto exit;
-	g_signal_connect (
-		destination_client, "authenticate",
-		G_CALLBACK (e_client_utils_authenticate_handler), NULL);
 
 	e_client_open_sync (E_CLIENT (destination_client), FALSE, NULL, &error);
 
@@ -1052,12 +1041,15 @@ action_event_reply_cb (GtkAction *action,
 	ECalendarViewEvent *event;
 	ECalComponent *component;
 	ECalClient *client;
+	ESourceRegistry *registry;
 	icalcomponent *icalcomp;
 	GList *selected;
 	gboolean reply_all = FALSE;
 
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
 	calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+	registry = gnome_calendar_get_registry (calendar);
+
 	view_type = gnome_calendar_get_view (calendar);
 	calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
 
@@ -1077,7 +1069,7 @@ action_event_reply_cb (GtkAction *action,
 	e_cal_component_set_icalcomponent (
 		component, icalcomponent_new_clone (icalcomp));
 	reply_to_calendar_comp (
-		E_CAL_COMPONENT_METHOD_REPLY,
+		registry, E_CAL_COMPONENT_METHOD_REPLY,
 		component, client, reply_all, NULL, NULL);
 
 	g_object_unref (component);
@@ -1096,12 +1088,15 @@ action_event_reply_all_cb (GtkAction *action,
 	ECalendarViewEvent *event;
 	ECalComponent *component;
 	ECalClient *client;
+	ESourceRegistry *registry;
 	icalcomponent *icalcomp;
 	GList *selected;
 	gboolean reply_all = TRUE;
 
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
 	calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+	registry = gnome_calendar_get_registry (calendar);
+
 	view_type = gnome_calendar_get_view (calendar);
 	calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
 
@@ -1121,7 +1116,7 @@ action_event_reply_all_cb (GtkAction *action,
 	e_cal_component_set_icalcomponent (
 		component, icalcomponent_new_clone (icalcomp));
 	reply_to_calendar_comp (
-		E_CAL_COMPONENT_METHOD_REPLY,
+		registry, E_CAL_COMPONENT_METHOD_REPLY,
 		component, client, reply_all, NULL, NULL);
 
 	g_object_unref (component);
diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/modules/calendar/e-cal-shell-view-memopad.c
index 4978ca2..f8a0e2d 100644
--- a/modules/calendar/e-cal-shell-view-memopad.c
+++ b/modules/calendar/e-cal-shell-view-memopad.c
@@ -32,12 +32,22 @@ action_calendar_memopad_forward_cb (GtkAction *action,
                                     ECalShellView *cal_shell_view)
 {
 	ECalShellContent *cal_shell_content;
+	EShell *shell;
+	EShellView *shell_view;
+	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	EMemoTable *memo_table;
 	ECalModelComponent *comp_data;
 	ECalComponent *comp;
 	icalcomponent *clone;
 	GSList *list;
 
+	shell_view = E_SHELL_VIEW (cal_shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
 	memo_table = e_cal_shell_content_get_memo_table (cal_shell_content);
 
@@ -50,9 +60,11 @@ action_calendar_memopad_forward_cb (GtkAction *action,
 	comp = e_cal_component_new ();
 	clone = icalcomponent_new_clone (comp_data->icalcomp);
 	e_cal_component_set_icalcomponent (comp, clone);
+
 	itip_send_comp (
-		E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+		registry, E_CAL_COMPONENT_METHOD_PUBLISH, comp,
 		comp_data->client, NULL, NULL, NULL, TRUE, FALSE);
+
 	g_object_unref (comp);
 }
 
@@ -391,6 +403,7 @@ e_cal_shell_view_memopad_open_memo (ECalShellView *cal_shell_view,
 	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	CompEditor *editor;
 	CompEditorFlags flags = 0;
 	ECalComponent *comp;
@@ -404,6 +417,8 @@ e_cal_shell_view_memopad_open_memo (ECalShellView *cal_shell_view,
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	shell = e_shell_window_get_shell (shell_window);
 
+	registry = e_shell_get_registry (shell);
+
 	uid = icalcomponent_get_uid (comp_data->icalcomp);
 	editor = comp_editor_find_instance (uid);
 
@@ -417,7 +432,7 @@ e_cal_shell_view_memopad_open_memo (ECalShellView *cal_shell_view,
 	if (e_cal_component_has_organizer (comp))
 		flags |= COMP_EDITOR_IS_SHARED;
 
-	if (itip_organizer_is_user (comp, comp_data->client))
+	if (itip_organizer_is_user (registry, comp, comp_data->client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	editor = memo_editor_new (comp_data->client, shell, flags);
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index c2f39c5..de9334b 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -513,6 +513,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
 	EMemoTable *memo_table;
 	ETaskTable *task_table;
 	ESourceSelector *selector;
+	GtkWidget *widget;
 	ECalModel *model;
 	gint ii;
 
@@ -540,7 +541,6 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
 	selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
 	date_navigator = e_cal_shell_sidebar_get_date_navigator (cal_shell_sidebar);
 
-	/* Give GnomeCalendar a handle to the date navigator, memo and task table. */
 	gnome_calendar_set_date_navigator (calendar, date_navigator);
 	gnome_calendar_set_memo_table (
 		calendar, memo_table ? GTK_WIDGET (memo_table) : NULL);
@@ -664,6 +664,13 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
 	e_cal_shell_view_update_search_filter (cal_shell_view);
 	e_cal_shell_view_update_timezone (cal_shell_view);
 
+	/* Express mode only: Bind the "New Calendar"
+	 * sidebar button to the appropriate action. */
+	widget = e_cal_shell_sidebar_get_new_calendar_button (cal_shell_sidebar);
+	if (widget != NULL)
+		gtk_activatable_set_related_action (
+			GTK_ACTIVATABLE (widget), ACTION (CALENDAR_NEW));
+
 	/* Keep the ECalModel in sync with the sidebar. */
 	g_object_bind_property (
 		shell_sidebar, "default-client",
@@ -687,8 +694,8 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view)
 	ECalShellViewPrivate *priv = cal_shell_view->priv;
 	gint i;
 
-	/* Calling calendar's save state from here,
-	 * because it is too late in its dispose. */
+	/* Calling ECalShellContent's save state from here,
+	 * because it is too late in its own dispose(). */
 	if (priv->cal_shell_content != NULL)
 		e_cal_shell_content_save_state (priv->cal_shell_content);
 
@@ -739,6 +746,7 @@ e_cal_shell_view_open_event (ECalShellView *cal_shell_view,
 	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	CompEditor *editor;
 	CompEditorFlags flags = 0;
 	ECalComponent *comp;
@@ -753,6 +761,8 @@ e_cal_shell_view_open_event (ECalShellView *cal_shell_view,
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	shell = e_shell_window_get_shell (shell_window);
 
+	registry = e_shell_get_registry (shell);
+
 	uid = icalcomponent_get_uid (comp_data->icalcomp);
 	editor = comp_editor_find_instance (uid);
 
@@ -768,10 +778,10 @@ e_cal_shell_view_open_event (ECalShellView *cal_shell_view,
 	if (prop != NULL)
 		flags |= COMP_EDITOR_MEETING;
 
-	if (itip_organizer_is_user (comp, comp_data->client))
+	if (itip_organizer_is_user (registry, comp, comp_data->client))
 		flags |= COMP_EDITOR_USER_ORG;
 
-	if (itip_sentby_is_user (comp, comp_data->client))
+	if (itip_sentby_is_user (registry, comp, comp_data->client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	if (!e_cal_component_has_attendees (comp))
diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h
index 6653632..44fe584 100644
--- a/modules/calendar/e-cal-shell-view-private.h
+++ b/modules/calendar/e-cal-shell-view-private.h
@@ -31,9 +31,9 @@
 #include <libedataserver/e-categories.h>
 #include <libedataserver/e-data-server-util.h>
 #include <libedataserver/e-sexp.h>
+#include <libedataserver/e-source-registry.h>
 #include <libedataserverui/e-client-utils.h>
 
-#include "e-util/e-account-utils.h"
 #include "e-util/e-selection.h"
 #include "e-util/e-dialog-utils.h"
 #include "e-util/e-file-utils.h"
@@ -41,17 +41,18 @@
 #include "shell/e-shell-utils.h"
 #include "misc/e-popup-action.h"
 #include "misc/e-selectable.h"
+#include "misc/e-source-config-dialog.h"
 
 #include "calendar/gui/calendar-config.h"
 #include "calendar/gui/comp-util.h"
 #include "calendar/gui/e-cal-list-view.h"
 #include "calendar/gui/e-cal-model-tasks.h"
+#include "calendar/gui/e-cal-source-config.h"
 #include "calendar/gui/e-calendar-view.h"
 #include "calendar/gui/e-day-view.h"
 #include "calendar/gui/e-week-view.h"
 #include "calendar/gui/gnome-cal.h"
 #include "calendar/gui/print.h"
-#include "calendar/gui/dialogs/calendar-setup.h"
 #include "calendar/gui/dialogs/copy-source-dialog.h"
 #include "calendar/gui/dialogs/event-editor.h"
 #include "calendar/gui/dialogs/goto-dialog.h"
diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/modules/calendar/e-cal-shell-view-taskpad.c
index 92263c7..ec26877 100644
--- a/modules/calendar/e-cal-shell-view-taskpad.c
+++ b/modules/calendar/e-cal-shell-view-taskpad.c
@@ -55,12 +55,22 @@ action_calendar_taskpad_forward_cb (GtkAction *action,
                                     ECalShellView *cal_shell_view)
 {
 	ECalShellContent *cal_shell_content;
+	EShell *shell;
+	EShellView *shell_view;
+	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	ECalModelComponent *comp_data;
 	ETaskTable *task_table;
 	ECalComponent *comp;
 	icalcomponent *clone;
 	GSList *list;
 
+	shell_view = E_SHELL_VIEW (cal_shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+
 	cal_shell_content = cal_shell_view->priv->cal_shell_content;
 	task_table = e_cal_shell_content_get_task_table (cal_shell_content);
 
@@ -73,9 +83,11 @@ action_calendar_taskpad_forward_cb (GtkAction *action,
 	comp = e_cal_component_new ();
 	clone = icalcomponent_new_clone (comp_data->icalcomp);
 	e_cal_component_set_icalcomponent (comp, clone);
+
 	itip_send_comp (
-		E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+		registry, E_CAL_COMPONENT_METHOD_PUBLISH, comp,
 		comp_data->client, NULL, NULL, NULL, TRUE, FALSE);
+
 	g_object_unref (comp);
 }
 
@@ -509,6 +521,7 @@ e_cal_shell_view_taskpad_open_task (ECalShellView *cal_shell_view,
 	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	CompEditor *editor;
 	CompEditorFlags flags = 0;
 	ECalComponent *comp;
@@ -523,6 +536,8 @@ e_cal_shell_view_taskpad_open_task (ECalShellView *cal_shell_view,
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	shell = e_shell_window_get_shell (shell_window);
 
+	registry = e_shell_get_registry (shell);
+
 	uid = icalcomponent_get_uid (comp_data->icalcomp);
 	editor = comp_editor_find_instance (uid);
 
@@ -538,7 +553,7 @@ e_cal_shell_view_taskpad_open_task (ECalShellView *cal_shell_view,
 	if (prop != NULL)
 		flags |= COMP_EDITOR_IS_ASSIGNED;
 
-	if (itip_organizer_is_user (comp, comp_data->client))
+	if (itip_organizer_is_user (registry, comp, comp_data->client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	if (!e_cal_component_has_attendees (comp))
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index f644402..df17f25 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -311,6 +311,8 @@ cal_shell_view_update_actions (EShellView *shell_view)
 	EShellSidebar *shell_sidebar;
 	EShellWindow *shell_window;
 	EShell *shell;
+	ESource *mail_account;
+	ESourceRegistry *registry;
 	GnomeCalendarViewType view_type;
 	GnomeCalendar *calendar;
 	ECalendarView *view;
@@ -355,6 +357,9 @@ cal_shell_view_update_actions (EShellView *shell_view)
 		gtk_widget_hide (widget);
 	}
 
+	registry = e_shell_get_registry (shell);
+	mail_account = e_source_registry_get_default_mail_account (registry);
+
 	cal_shell_content = priv->cal_shell_content;
 	calendar = e_cal_shell_content_get_calendar (cal_shell_content);
 	view_type = gnome_calendar_get_view (calendar);
@@ -400,7 +405,7 @@ cal_shell_view_update_actions (EShellView *shell_view)
 
 		user_org =
 			e_cal_util_component_has_organizer (icalcomp) &&
-			itip_organizer_is_user (comp, client);
+			itip_organizer_is_user (registry, comp, client);
 
 		is_delegatable =
 			e_client_check_capability (
@@ -500,7 +505,7 @@ cal_shell_view_update_actions (EShellView *shell_view)
 	gtk_action_set_sensitive (action, sensitive);
 
 	action = ACTION (EVENT_MEETING_NEW);
-	visible = e_get_default_account () != NULL;
+	visible = (mail_account != NULL);
 	gtk_action_set_visible (action, visible);
 }
 
diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c
index 85eddd9..13bcb70 100644
--- a/modules/calendar/e-calendar-preferences.c
+++ b/modules/calendar/e-calendar-preferences.c
@@ -34,6 +34,7 @@
 #include "calendar/gui/e-cal-config.h"
 #include "calendar/gui/e-timezone-entry.h"
 #include "calendar/gui/calendar-config.h"
+#include "widgets/misc/e-alarm-selector.h"
 #include "widgets/misc/e-dateedit.h"
 #include "e-util/e-util.h"
 #include "e-util/e-datetime-format.h"
@@ -125,6 +126,11 @@ calendar_preferences_dispose (GObject *object)
 		prefs->builder = NULL;
 	}
 
+	if (prefs->registry != NULL) {
+		g_object_unref (prefs->registry);
+		prefs->registry = NULL;
+	}
+
 	if (prefs->shell_settings != NULL) {
 		g_object_unref (prefs->shell_settings);
 		prefs->shell_settings = NULL;
@@ -339,50 +345,6 @@ notify_with_tray_toggled (GtkToggleButton *toggle,
 }
 
 static void
-alarms_selection_changed (ESourceSelector *selector,
-                          ECalendarPreferences *prefs)
-{
-	ESourceList *source_list = prefs->alarms_list;
-	GSList *selection;
-	GSList *l;
-	GSList *groups;
-	ESource *source;
-	const gchar *alarm;
-
-	/* first we clear all the alarm flags from all sources */
-	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) {
-			source = E_SOURCE (sources->data);
-
-			alarm = e_source_get_property (source, "alarm");
-			if (alarm && !g_ascii_strcasecmp (alarm, "never"))
-				continue;
-
-			e_source_set_property (source, "alarm", "false");
-		}
-	}
-
-	/* then we loop over the selector's selection, setting the
-	 * property on those sources */
-	selection = e_source_selector_get_selection (selector);
-	for (l = selection; l; l = l->next) {
-		source = E_SOURCE (l->data);
-
-		alarm = (gchar *)e_source_get_property (source, "alarm");
-		if (alarm && !g_ascii_strcasecmp (alarm, "never"))
-			continue;
-
-		e_source_set_property (E_SOURCE (l->data), "alarm", "true");
-	}
-	e_source_selector_free_selection (selection);
-
-	/* FIXME show an error if this fails? */
-	e_source_list_sync (source_list, NULL);
-}
-
-static void
 update_system_tz_widgets (EShellSettings *shell_settings,
                           GParamSpec *pspec,
                           ECalendarPreferences *prefs)
@@ -418,51 +380,22 @@ setup_changes (ECalendarPreferences *prefs)
 		G_CALLBACK (start_of_day_changed), prefs);
 
 	g_signal_connect (
-		prefs->end_of_day, "changed",
-		G_CALLBACK (end_of_day_changed), prefs);
-
-	g_signal_connect (
 		prefs->notify_with_tray, "toggled",
 		G_CALLBACK (notify_with_tray_toggled), prefs);
-
-	g_signal_connect (
-		prefs->alarm_list_widget, "selection_changed",
-		G_CALLBACK (alarms_selection_changed), prefs);
-}
-
-static void
-initialize_selection (ESourceSelector *selector,
-                      ESourceList *source_list)
-{
-	GSList *groups;
-
-	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 gchar *completion = e_source_get_property (source, "alarm");
-			if (!completion  || !g_ascii_strcasecmp (completion, "true")) {
-				if (!completion)
-					e_source_set_property (E_SOURCE (source), "alarm", "true");
-				e_source_selector_select_source (selector, source);
-			}
-		}
-	}
 }
 
 static void
 show_alarms_config (ECalendarPreferences *prefs)
 {
 	GConfClient *gconf;
+	GtkWidget *widget;
 
-	if (e_cal_client_get_sources (&prefs->alarms_list, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL)) {
-		prefs->alarm_list_widget = e_source_selector_new (prefs->alarms_list);
-		atk_object_set_name (gtk_widget_get_accessible (prefs->alarm_list_widget), _("Selected Calendars for Reminders"));
-		gtk_container_add (GTK_CONTAINER (prefs->scrolled_window), prefs->alarm_list_widget);
-		gtk_widget_show (prefs->alarm_list_widget);
-		initialize_selection (E_SOURCE_SELECTOR (prefs->alarm_list_widget), prefs->alarms_list);
-	}
+	widget = e_alarm_selector_new (prefs->registry);
+	atk_object_set_name (
+		gtk_widget_get_accessible (widget),
+		_("Selected Calendars for Alarms"));
+	gtk_container_add (GTK_CONTAINER (prefs->scrolled_window), widget);
+	gtk_widget_show (widget);
 
 	gconf = gconf_client_get_default ();
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->notify_with_tray), gconf_client_get_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", NULL));
@@ -913,16 +846,20 @@ GtkWidget *
 e_calendar_preferences_new (EPreferencesWindow *window)
 {
 	EShell *shell;
+	ESourceRegistry *registry;
 	EShellSettings *shell_settings;
 	ECalendarPreferences *preferences;
 
 	shell = e_preferences_window_get_shell (window);
+
+	registry = e_shell_get_registry (shell);
 	shell_settings = e_shell_get_shell_settings (shell);
 
 	g_return_val_if_fail (E_IS_SHELL (shell), NULL);
 
 	preferences = g_object_new (E_TYPE_CALENDAR_PREFERENCES, NULL);
 
+	preferences->registry = g_object_ref (registry);
 	preferences->shell_settings = g_object_ref (shell_settings);
 
 	/* FIXME Kill this function. */
diff --git a/modules/calendar/e-calendar-preferences.h b/modules/calendar/e-calendar-preferences.h
index ae96fc1..5cb05e5 100644
--- a/modules/calendar/e-calendar-preferences.h
+++ b/modules/calendar/e-calendar-preferences.h
@@ -26,6 +26,7 @@
 
 #include <gtk/gtk.h>
 #include <shell/e-shell.h>
+#include <libedataserver/e-source-registry.h>
 #include <libedataserverui/e-source-selector.h>
 #include <widgets/misc/e-preferences-window.h>
 
@@ -58,6 +59,7 @@ struct _ECalendarPreferences {
 
 	GtkBuilder *builder;
 
+	ESourceRegistry *registry;
 	EShellSettings *shell_settings;
 
 	/* General tab */
@@ -71,8 +73,6 @@ struct _ECalendarPreferences {
 	/* Alarms tab */
 	GtkWidget *notify_with_tray;
 	GtkWidget *scrolled_window;
-	ESourceList *alarms_list;
-	GtkWidget *alarm_list_widget;
 };
 
 struct _ECalendarPreferencesClass {
diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c
index ed4e81d..380c6ad 100644
--- a/modules/calendar/e-memo-shell-backend.c
+++ b/modules/calendar/e-memo-shell-backend.c
@@ -28,19 +28,19 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <libecal/e-cal-client.h>
+#include <libecal/e-source-calendar.h>
 #include <libedataserver/e-url.h>
 #include <libedataserver/e-source.h>
-#include <libedataserver/e-source-list.h>
-#include <libedataserver/e-source-group.h>
 #include <libedataserverui/e-client-utils.h>
 
 #include "shell/e-shell.h"
 #include "shell/e-shell-backend.h"
 #include "shell/e-shell-window.h"
+#include "widgets/misc/e-source-config-dialog.h"
 
 #include "calendar/gui/comp-util.h"
-#include "calendar/gui/dialogs/calendar-setup.h"
 #include "calendar/gui/dialogs/memo-editor.h"
+#include "calendar/gui/e-cal-source-config.h"
 
 #include "e-memo-shell-migrate.h"
 #include "e-memo-shell-view.h"
@@ -49,122 +49,13 @@
 #define PERSONAL_RELATIVE_URI	"system"
 
 struct _EMemoShellBackendPrivate {
-	ESourceList *source_list;
-};
-
-enum {
-	PROP_0,
-	PROP_SOURCE_LIST
+	gint placeholder;
 };
 
 static gpointer parent_class;
 static GType memo_shell_backend_type;
 
 static void
-memo_shell_backend_ensure_sources (EShellBackend *shell_backend)
-{
-	/* XXX This is basically the same algorithm across all modules.
-	 *     Maybe we could somehow integrate this into EShellBackend? */
-
-	EMemoShellBackend *memo_shell_backend;
-	ESourceGroup *on_this_computer;
-	ESourceList *source_list;
-	ESource *personal;
-	EShell *shell;
-	EShellSettings *shell_settings;
-	GSList *sources, *iter;
-	const gchar *name;
-	gboolean save_list = FALSE;
-	GError *error = NULL;
-
-	personal = NULL;
-
-	memo_shell_backend = E_MEMO_SHELL_BACKEND (shell_backend);
-
-	shell = e_shell_backend_get_shell (shell_backend);
-	shell_settings = e_shell_get_shell_settings (shell);
-
-	e_cal_client_get_sources (
-		&memo_shell_backend->priv->source_list,
-		E_CAL_CLIENT_SOURCE_TYPE_MEMOS, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Could not get memo sources: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-		return;
-	}
-
-	source_list = memo_shell_backend->priv->source_list;
-
-	on_this_computer = e_source_list_ensure_group (
-		source_list, _("On This Computer"), "local:", TRUE);
-	e_source_list_ensure_group (
-		source_list, _("On The Web"), "webcal://", FALSE);
-
-	g_return_if_fail (on_this_computer);
-
-	sources = e_source_group_peek_sources (on_this_computer);
-
-	/* Make sure this group includes a "Personal" source. */
-	for (iter = sources; iter != NULL; iter = iter->next) {
-		ESource *source = iter->data;
-		const gchar *relative_uri;
-
-		relative_uri = e_source_peek_relative_uri (source);
-		if (g_strcmp0 (relative_uri, "system") == 0) {
-			personal = source;
-			break;
-		}
-	}
-
-	name = _("Personal");
-
-	if (personal == NULL) {
-		ESource *source;
-		GSList *selected;
-		gchar *primary;
-
-		source = e_source_new (name, "system");
-		e_source_set_color_spec (source, "#BECEDD");
-		e_source_group_add_source (on_this_computer, source, -1);
-		g_object_unref (source);
-		save_list = TRUE;
-
-		primary = e_shell_settings_get_string (
-			shell_settings, "cal-primary-memo-list");
-
-		selected = e_memo_shell_backend_get_selected_memo_lists (
-			memo_shell_backend);
-
-		if (primary == NULL && selected == NULL) {
-			const gchar *uid;
-
-			uid = e_source_peek_uid (source);
-			selected = g_slist_prepend (NULL, g_strdup (uid));
-
-			e_shell_settings_set_string (
-				shell_settings, "cal-primary-memo-list", uid);
-			e_memo_shell_backend_set_selected_memo_lists (
-				memo_shell_backend, selected);
-		}
-
-		g_slist_foreach (selected, (GFunc) g_free, NULL);
-		g_slist_free (selected);
-		g_free (primary);
-	} else {
-		/* Force the source name to the current locale. */
-		e_source_set_name (personal, name);
-	}
-
-	g_object_unref (on_this_computer);
-
-	if (save_list)
-		e_source_list_sync (source_list, NULL);
-}
-
-static void
 memo_shell_backend_new_memo (ESource *source,
                              GAsyncResult *result,
                              EShell *shell,
@@ -183,7 +74,7 @@ memo_shell_backend_new_memo (ESource *source,
 		g_warn_if_fail (client == NULL);
 		g_warning (
 			"%s: Failed to open '%s': %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_error_free (error);
 		return;
@@ -240,55 +131,62 @@ action_memo_new_cb (GtkAction *action,
                     EShellWindow *shell_window)
 {
 	EShell *shell;
-	EShellBackend *shell_backend;
-	EShellSettings *shell_settings;
-	ESource *source = NULL;
-	ESourceList *source_list;
+	ESource *source;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
 	const gchar *action_name;
-	gchar *uid;
 
 	/* This callback is used for both memos and shared memos. */
 
 	shell = e_shell_window_get_shell (shell_window);
-	shell_settings = e_shell_get_shell_settings (shell);
-	shell_backend = e_shell_get_backend_by_name (shell, "memos");
-
-	g_object_get (shell_backend, "source-list", &source_list, NULL);
-	g_return_if_fail (E_IS_SOURCE_LIST (source_list));
 
-	uid = e_shell_settings_get_string (
-		shell_settings, "cal-primary-memo-list");
-
-	if (uid != NULL) {
-		source = e_source_list_peek_source_by_uid (source_list, uid);
-		g_free (uid);
-	}
-
-	if (source == NULL)
-		source = e_source_list_peek_default_source (source_list);
-
-	g_return_if_fail (E_IS_SOURCE (source));
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_MEMOS;
+	source = e_source_registry_get_default_memo_list (registry);
 
 	/* Use a callback function appropriate for the action.
 	 * FIXME Need to obtain a better default time zone. */
 	action_name = gtk_action_get_name (action);
 	if (g_strcmp0 (action_name, "memo-shared-new") == 0)
-		e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_MEMOS, FALSE, NULL,
-			e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
-			memo_shell_backend_memo_shared_new_cb, g_object_ref (shell));
+		e_client_utils_open_new (
+			source, source_type, FALSE, NULL,
+			memo_shell_backend_memo_shared_new_cb,
+			g_object_ref (shell));
 	else
-		e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_MEMOS, FALSE, NULL,
-			e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
-			memo_shell_backend_memo_new_cb, g_object_ref (shell));
-
-	g_object_unref (source_list);
+		e_client_utils_open_new (
+			source, source_type, FALSE, NULL,
+			memo_shell_backend_memo_new_cb,
+			g_object_ref (shell));
 }
 
 static void
 action_memo_list_new_cb (GtkAction *action,
                          EShellWindow *shell_window)
 {
-	calendar_setup_new_memo_list (GTK_WINDOW (shell_window));
+	EShell *shell;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
+
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_MEMOS;
+	config = e_cal_source_config_new (registry, NULL, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("New Memo List"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static GtkActionEntry item_entries[] = {
@@ -328,7 +226,7 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	ECalClient *client;
 	ECalComponent *comp;
 	ESource *source;
-	ESourceList *source_list;
+	ESourceRegistry *registry;
 	ECalClientSourceType source_type;
 	EUri *euri;
 	icalcomponent *icalcomp;
@@ -392,31 +290,17 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	 * we successfully open it is another matter... */
 	handled = TRUE;
 
-	e_cal_client_get_sources (&source_list, source_type, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Could not get memo sources: %s",
-			G_STRFUNC, error->message);
-		g_clear_error (&error);
-		goto exit;
-	}
-
-	source = e_source_list_peek_source_by_uid (source_list, source_uid);
+	registry = e_shell_get_registry (shell);
+	source = e_source_registry_lookup_by_uid (registry, source_uid);
 	if (source == NULL) {
 		g_printerr ("No source for UID '%s'\n", source_uid);
-		g_object_unref (source_list);
 		goto exit;
 	}
 
 	client = e_cal_client_new (source, source_type, &error);
 
-	if (client != NULL) {
-		g_signal_connect (
-			client, "authenticate",
-			G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+	if (client != NULL)
 		e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error);
-	}
 
 	if (error != NULL) {
 		g_warning (
@@ -424,7 +308,6 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 			G_STRFUNC, error->message);
 		if (client != NULL)
 			g_object_unref (client);
-		g_object_unref (source_list);
 		g_error_free (error);
 		goto exit;
 	}
@@ -444,7 +327,6 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 		g_warning (
 			"%s: Failed to get object: %s",
 			G_STRFUNC, error->message);
-		g_object_unref (source_list);
 		g_object_unref (client);
 		g_error_free (error);
 		goto exit;
@@ -460,7 +342,7 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	if (e_cal_component_has_organizer (comp))
 		flags |= COMP_EDITOR_IS_SHARED;
 
-	if (itip_organizer_is_user (comp, client))
+	if (itip_organizer_is_user (registry, comp, client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	editor = memo_editor_new (client, shell, flags);
@@ -471,7 +353,6 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 present:
 	gtk_window_present (GTK_WINDOW (editor));
 
-	g_object_unref (source_list);
 	g_object_unref (client);
 
 exit:
@@ -505,40 +386,6 @@ memo_shell_backend_window_added_cb (EShellBackend *shell_backend,
 }
 
 static void
-memo_shell_backend_get_property (GObject *object,
-                                 guint property_id,
-                                 GValue *value,
-                                 GParamSpec *pspec)
-{
-	switch (property_id) {
-		case PROP_SOURCE_LIST:
-			g_value_set_object (
-				value,
-				e_memo_shell_backend_get_source_list (
-				E_MEMO_SHELL_BACKEND (object)));
-			return;
-	}
-
-	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-memo_shell_backend_dispose (GObject *object)
-{
-	EMemoShellBackendPrivate *priv;
-
-	priv = E_MEMO_SHELL_BACKEND (object)->priv;
-
-	if (priv->source_list != NULL) {
-		g_object_unref (priv->source_list);
-		priv->source_list = NULL;
-	}
-
-	/* Chain up to parent's dispose() method. */
-	G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
 memo_shell_backend_constructed (GObject *object)
 {
 	EShell *shell;
@@ -547,8 +394,6 @@ memo_shell_backend_constructed (GObject *object)
 	shell_backend = E_SHELL_BACKEND (object);
 	shell = e_shell_backend_get_shell (shell_backend);
 
-	memo_shell_backend_ensure_sources (shell_backend);
-
 	g_signal_connect_swapped (
 		shell, "handle-uri",
 		G_CALLBACK (memo_shell_backend_handle_uri_cb),
@@ -573,8 +418,6 @@ memo_shell_backend_class_init (EMemoShellBackendClass *class)
 	g_type_class_add_private (class, sizeof (EMemoShellBackendPrivate));
 
 	object_class = G_OBJECT_CLASS (class);
-	object_class->get_property = memo_shell_backend_get_property;
-	object_class->dispose = memo_shell_backend_dispose;
 	object_class->constructed = memo_shell_backend_constructed;
 
 	shell_backend_class = E_SHELL_BACKEND_CLASS (class);
@@ -587,15 +430,8 @@ memo_shell_backend_class_init (EMemoShellBackendClass *class)
 	shell_backend_class->start = NULL;
 	shell_backend_class->migrate = e_memo_shell_backend_migrate;
 
-	g_object_class_install_property (
-		object_class,
-		PROP_SOURCE_LIST,
-		g_param_spec_object (
-			"source-list",
-			"Source List",
-			"The registry of memo lists",
-			E_TYPE_SOURCE_LIST,
-			G_PARAM_READABLE));
+	/* Register relevant ESource extensions. */
+	E_TYPE_SOURCE_MEMO_LIST;
 }
 
 static void
@@ -632,47 +468,3 @@ e_memo_shell_backend_register_type (GTypeModule *type_module)
 		type_module, E_TYPE_SHELL_BACKEND,
 		"EMemoShellBackend", &type_info, 0);
 }
-
-ESourceList *
-e_memo_shell_backend_get_source_list (EMemoShellBackend *memo_shell_backend)
-{
-	g_return_val_if_fail (
-		E_IS_MEMO_SHELL_BACKEND (memo_shell_backend), NULL);
-
-	return memo_shell_backend->priv->source_list;
-}
-
-GSList *
-e_memo_shell_backend_get_selected_memo_lists (EMemoShellBackend *memo_shell_backend)
-{
-	GConfClient *client;
-	GSList *selected_memo_lists;
-	const gchar *key;
-
-	g_return_val_if_fail (
-		E_IS_MEMO_SHELL_BACKEND (memo_shell_backend), NULL);
-
-	client = gconf_client_get_default ();
-	key = "/apps/evolution/calendar/memos/selected_memos";
-	selected_memo_lists = gconf_client_get_list (
-		client, key, GCONF_VALUE_STRING, NULL);
-	g_object_unref (client);
-
-	return selected_memo_lists;
-}
-
-void
-e_memo_shell_backend_set_selected_memo_lists (EMemoShellBackend *memo_shell_backend,
-                                              GSList *selected_memo_lists)
-{
-	GConfClient *client;
-	const gchar *key;
-
-	g_return_if_fail (E_IS_MEMO_SHELL_BACKEND (memo_shell_backend));
-
-	client = gconf_client_get_default ();
-	key = "/apps/evolution/calendar/memos/selected_memos";
-	gconf_client_set_list (
-		client, key, GCONF_VALUE_STRING, selected_memo_lists, NULL);
-	g_object_unref (client);
-}
diff --git a/modules/calendar/e-memo-shell-backend.h b/modules/calendar/e-memo-shell-backend.h
index 8a005c4..44b0384 100644
--- a/modules/calendar/e-memo-shell-backend.h
+++ b/modules/calendar/e-memo-shell-backend.h
@@ -23,7 +23,6 @@
 #define E_MEMO_SHELL_BACKEND_H
 
 #include <shell/e-shell-backend.h>
-#include <libedataserver/e-source-list.h>
 
 /* Standard GObject macros */
 #define E_TYPE_MEMO_SHELL_BACKEND \
@@ -62,13 +61,6 @@ struct _EMemoShellBackendClass {
 GType		e_memo_shell_backend_get_type	(void);
 void		e_memo_shell_backend_register_type
 					(GTypeModule *type_module);
-ESourceList *	e_memo_shell_backend_get_source_list
-					(EMemoShellBackend *memo_shell_backend);
-GSList *	e_memo_shell_backend_get_selected_memo_lists
-					(EMemoShellBackend *memo_shell_backend);
-void		e_memo_shell_backend_set_selected_memo_lists
-					(EMemoShellBackend *memo_shell_backend,
-					 GSList *selected_memo_lists);
 
 G_END_DECLS
 
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c
index f0f4fe9..98dcfe9 100644
--- a/modules/calendar/e-memo-shell-content.c
+++ b/modules/calendar/e-memo-shell-content.c
@@ -116,7 +116,7 @@ memo_shell_content_table_foreach_cb (gint model_row,
 		const gchar *source_uid;
 
 		source = e_client_get_source (E_CLIENT (comp_data->client));
-		source_uid = e_source_peek_uid (source);
+		source_uid = e_source_get_uid (source);
 
 		foreach_data->list = g_slist_prepend (
 			foreach_data->list,
@@ -415,10 +415,12 @@ static void
 memo_shell_content_constructed (GObject *object)
 {
 	EMemoShellContentPrivate *priv;
+	EShell *shell;
 	EShellView *shell_view;
 	EShellContent *shell_content;
 	EShellTaskbar *shell_taskbar;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	GalViewInstance *view_instance;
 	GtkTargetList *target_list;
 	GtkTargetEntry *targets;
@@ -435,8 +437,10 @@ memo_shell_content_constructed (GObject *object)
 	shell_view = e_shell_content_get_shell_view (shell_content);
 	shell_taskbar = e_shell_view_get_shell_taskbar (shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
 
-	priv->memo_model = e_cal_model_memos_new ();
+	registry = e_shell_get_registry (shell);
+	priv->memo_model = e_cal_model_memos_new (registry);
 
 	/* Build content widgets. */
 
diff --git a/modules/calendar/e-memo-shell-migrate.c b/modules/calendar/e-memo-shell-migrate.c
index 6402cf1..08fe767 100644
--- a/modules/calendar/e-memo-shell-migrate.c
+++ b/modules/calendar/e-memo-shell-migrate.c
@@ -25,137 +25,6 @@
 
 #include "e-memo-shell-migrate.h"
 
-#include <string.h>
-#include <glib/gi18n.h>
-#include <camel/camel.h>
-#include <libedataserver/e-source.h>
-#include <libedataserver/e-source-group.h>
-#include <libedataserver/e-source-list.h>
-
-#include "e-util/e-account-utils.h"
-#include "calendar/gui/calendar-config-keys.h"
-#include "shell/e-shell.h"
-
-#include "e-memo-shell-backend.h"
-
-#define LOCAL_BASE_URI "local:"
-#define WEBCAL_BASE_URI "webcal://"
-#define PERSONAL_RELATIVE_URI "system"
-#define GROUPWISE_BASE_URI "groupwise://"
-
-static void
-create_memo_sources (EShellBackend *shell_backend,
-                     ESourceList *source_list,
-                     ESourceGroup **on_this_computer,
-                     ESourceGroup **on_the_web,
-                     ESource **personal_source)
-{
-	EShell *shell;
-	EShellSettings *shell_settings;
-	GSList *groups;
-	ESourceGroup *group;
-
-	*on_this_computer = NULL;
-	*on_the_web = NULL;
-	*personal_source = NULL;
-
-	shell = e_shell_backend_get_shell (shell_backend);
-	shell_settings = e_shell_get_shell_settings (shell);
-
-	groups = e_source_list_peek_groups (source_list);
-	if (groups) {
-		/* groups are already there, we need to search for things... */
-		GSList *g;
-		gchar *base_dir, *base_uri;
-
-		base_dir = g_build_filename (e_shell_backend_get_data_dir (shell_backend), "local", NULL);
-		base_uri = g_filename_to_uri (base_dir, NULL, NULL);
-
-		for (g = groups; g; g = g->next) {
-			group = E_SOURCE_GROUP (g->data);
-
-			if (strcmp (base_uri, e_source_group_peek_base_uri (group)) == 0)
-				e_source_group_set_base_uri (group, LOCAL_BASE_URI);
-
-			if (!*on_this_computer && !strcmp (LOCAL_BASE_URI, e_source_group_peek_base_uri (group)))
-				*on_this_computer = g_object_ref (group);
-			else if (!*on_the_web && !strcmp (WEBCAL_BASE_URI, e_source_group_peek_base_uri (group)))
-				*on_the_web = g_object_ref (group);
-		}
-
-		g_free (base_dir);
-		g_free (base_uri);
-	}
-
-	if (*on_this_computer) {
-		/* make sure "Personal" shows up as a source under
-		 * this group */
-		GSList *sources = e_source_group_peek_sources (*on_this_computer);
-		GSList *s;
-		for (s = sources; s; s = s->next) {
-			ESource *source = E_SOURCE (s->data);
-			const gchar *relative_uri;
-
-			relative_uri = e_source_peek_relative_uri (source);
-			if (relative_uri == NULL)
-				continue;
-			if (!strcmp (PERSONAL_RELATIVE_URI, relative_uri)) {
-				*personal_source = g_object_ref (source);
-				break;
-			}
-		}
-	} else {
-		/* create the local source group */
-		group = e_source_group_new (_("On This Computer"), LOCAL_BASE_URI);
-		e_source_list_add_group (source_list, group, -1);
-
-		*on_this_computer = group;
-	}
-
-	if (!*personal_source) {
-		GSList *selected;
-		gchar *primary_memo_list;
-
-		/* Create the default Person memo list */
-		ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI);
-		e_source_group_add_source (*on_this_computer, source, -1);
-
-		primary_memo_list = e_shell_settings_get_string (
-			shell_settings, "cal-primary-memo-list");
-
-		selected = e_memo_shell_backend_get_selected_memo_lists (
-			E_MEMO_SHELL_BACKEND (shell_backend));
-
-		if (primary_memo_list == NULL && selected == NULL) {
-			GSList link;
-
-			e_shell_settings_set_string (
-				shell_settings, "cal-primary-memo-list",
-				e_source_peek_uid (source));
-
-			link.data = (gpointer) e_source_peek_uid (source);
-			link.next = NULL;
-
-			e_memo_shell_backend_set_selected_memo_lists (
-				E_MEMO_SHELL_BACKEND (shell_backend), &link);
-		}
-
-		g_slist_foreach (selected, (GFunc) g_free, NULL);
-		g_slist_free (selected);
-
-		e_source_set_color_spec (source, "#BECEDD");
-		*personal_source = source;
-	}
-
-	if (!*on_the_web) {
-		/* Create the Webcal source group */
-		group = e_source_group_new (_("On The Web"), WEBCAL_BASE_URI);
-		e_source_list_add_group (source_list, group, -1);
-
-		*on_the_web = group;
-	}
-}
-
 gboolean
 e_memo_shell_backend_migrate (EShellBackend *shell_backend,
                               gint major,
@@ -163,30 +32,7 @@ e_memo_shell_backend_migrate (EShellBackend *shell_backend,
                               gint revision,
                               GError **error)
 {
-	ESourceGroup *on_this_computer = NULL;
-	ESourceGroup *on_the_web = NULL;
-	ESource *personal_source = NULL;
-	ESourceList *source_list = NULL;
-	gboolean retval = FALSE;
-
-	g_object_get (shell_backend, "source-list", &source_list, NULL);
-
-	/* we call this unconditionally now - create_groups either
-	 * creates the groups/sources or it finds the necessary
-	 * groups/sources. */
-	create_memo_sources (
-		shell_backend, source_list, &on_this_computer,
-		&on_the_web, &personal_source);
-
-	e_source_list_sync (source_list, NULL);
-	retval = TRUE;
-
-	if (on_this_computer)
-		g_object_unref (on_this_computer);
-	if (on_the_web)
-		g_object_unref (on_the_web);
-	if (personal_source)
-		g_object_unref (personal_source);
+	g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), FALSE);
 
-	return retval;
+	return TRUE;
 }
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index df9ea9a..21f8b0a 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -28,6 +28,8 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <libecal/e-cal-client.h>
+#include <libecal/e-source-calendar.h>
+#include <libedataserver/e-source-password.h>
 #include <libedataserverui/e-client-utils.h>
 
 #include "e-util/e-alert-dialog.h"
@@ -120,7 +122,7 @@ memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar,
 	shell_content = e_shell_view_get_shell_content (shell_view);
 
 	source = e_client_get_source (E_CLIENT (client));
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 
 	g_object_ref (source);
 
@@ -142,21 +144,30 @@ memo_shell_sidebar_backend_error_cb (EMemoShellSidebar *memo_shell_sidebar,
 	EShellView *shell_view;
 	EShellContent *shell_content;
 	EShellSidebar *shell_sidebar;
-	ESourceGroup *source_group;
+	ESource *parent;
 	ESource *source;
+	GNode *node;
+	const gchar *parent_display_name;
+	const gchar *source_display_name;
 
 	shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
 	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
 	shell_content = e_shell_view_get_shell_content (shell_view);
 
 	source = e_client_get_source (E_CLIENT (client));
-	source_group = e_source_peek_group (source);
+
+	node = e_source_get_node (source);
+	g_return_if_fail (node != NULL);
+	g_return_if_fail (node->parent != NULL);
+
+	parent = E_SOURCE (node->parent->data);
+
+	parent_display_name = e_source_get_display_name (parent);
+	source_display_name = e_source_get_display_name (source);
 
 	e_alert_submit (
-		E_ALERT_SINK (shell_content),
-		"calendar:backend-error",
-		e_source_group_peek_name (source_group),
-		e_source_peek_name (source), message, NULL);
+		E_ALERT_SINK (shell_content), "calendar:backend-error",
+		parent_display_name, source_display_name, message, NULL);
 }
 
 static void
@@ -226,19 +237,6 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
 		return;
 	}
 
-	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED) ||
-	    g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_REQUIRED))
-		e_client_utils_forget_password (E_CLIENT (client));
-
-	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED)) {
-		e_client_open (
-			E_CLIENT (client), FALSE,
-			memo_shell_sidebar->priv->loading_clients,
-			memo_shell_sidebar_client_opened_cb, user_data);
-		g_clear_error (&error);
-		return;
-	}
-
 	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) {
 		struct RetryOpenData *rod;
 
@@ -269,7 +267,7 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
 		case E_CLIENT_ERROR_BUSY:
 			g_warning (
 				"%s: Cannot open '%s', it's busy (%s)",
-				G_STRFUNC, e_source_peek_name (source),
+				G_STRFUNC, e_source_get_display_name (source),
 				error->message);
 			g_clear_error (&error);
 			return;
@@ -389,8 +387,6 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
                                 ESource *source)
 {
 	EMemoShellSidebarPrivate *priv;
-	EShellView *shell_view;
-	EShellWindow *shell_window;
 	EShellSidebar *shell_sidebar;
 	ECalClient *client;
 	const gchar *uid;
@@ -400,8 +396,6 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
 	/* FIXME Sidebar should not be accessing the EShellContent.
 	 *       This probably needs to be moved to EMemoShellView. */
 	shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
-	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_window = e_shell_view_get_shell_window (shell_view);
 
 	/* Cancel any unfinished previous request. */
 	if (priv->loading_default_client != NULL) {
@@ -410,7 +404,7 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
 		priv->loading_default_client = NULL;
 	}
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (priv->client_table, uid);
 
 	/* If we already have an open connection for
@@ -428,8 +422,6 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
 	e_client_utils_open_new (
 		source, E_CLIENT_SOURCE_TYPE_MEMOS,
 		FALSE, priv->loading_default_client,
-		e_client_utils_authenticate_handler,
-		GTK_WINDOW (shell_window),
 		memo_shell_sidebar_default_loaded_cb,
 		g_object_ref (shell_sidebar));
 }
@@ -461,38 +453,6 @@ memo_shell_sidebar_row_changed_cb (EMemoShellSidebar *memo_shell_sidebar,
 }
 
 static void
-memo_shell_sidebar_selection_changed_cb (EMemoShellSidebar *memo_shell_sidebar,
-                                         ESourceSelector *selector)
-{
-	EShellView *shell_view;
-	EShellBackend *shell_backend;
-	EShellSidebar *shell_sidebar;
-	GSList *list, *iter;
-
-	/* This signal is emitted less frequently than "row-changed",
-	 * especially when the model is being rebuilt.  So we'll take
-	 * it easy on poor GConf. */
-
-	shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
-	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_backend = e_shell_view_get_shell_backend (shell_view);
-
-	list = e_source_selector_get_selection (selector);
-
-	for (iter = list; iter != NULL; iter = iter->next) {
-		ESource *source = iter->data;
-
-		iter->data = (gpointer) e_source_peek_uid (source);
-		g_object_unref (source);
-	}
-
-	e_memo_shell_backend_set_selected_memo_lists (
-		E_MEMO_SHELL_BACKEND (shell_backend), list);
-
-	g_slist_free (list);
-}
-
-static void
 memo_shell_sidebar_primary_selection_changed_cb (EMemoShellSidebar *memo_shell_sidebar,
                                                  ESourceSelector *selector)
 {
@@ -514,11 +474,9 @@ memo_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 	EShell *shell;
 	EShellBackend *shell_backend;
 	EShellSettings *shell_settings;
+	ESourceRegistry *registry;
 	ESourceSelector *selector;
-	ESourceList *source_list;
-	ESource *source;
 	GtkTreeModel *model;
-	GSList *list, *iter;
 
 	priv = E_MEMO_SHELL_SIDEBAR (shell_sidebar)->priv;
 
@@ -531,8 +489,7 @@ memo_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 	selector = E_SOURCE_SELECTOR (priv->selector);
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));
 
-	source_list = e_memo_shell_backend_get_source_list (
-		E_MEMO_SHELL_BACKEND (shell_backend));
+	registry = e_shell_get_registry (shell);
 
 	g_signal_connect_swapped (
 		model, "row-changed",
@@ -551,30 +508,8 @@ memo_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 		G_BINDING_SYNC_CREATE,
 		(GBindingTransformFunc) e_binding_transform_uid_to_source,
 		(GBindingTransformFunc) e_binding_transform_source_to_uid,
-		g_object_ref (source_list),
+		g_object_ref (registry),
 		(GDestroyNotify) g_object_unref);
-
-	list = e_memo_shell_backend_get_selected_memo_lists (
-		E_MEMO_SHELL_BACKEND (shell_backend));
-
-	for (iter = list; iter != NULL; iter = iter->next) {
-		const gchar *uid = iter->data;
-
-		source = e_source_list_peek_source_by_uid (source_list, uid);
-
-		if (source != NULL)
-			e_source_selector_select_source (selector, source);
-	}
-
-	g_slist_foreach (list, (GFunc) g_free, NULL);
-	g_slist_free (list);
-
-	/* Listen for subsequent changes to the selector. */
-
-	g_signal_connect_swapped (
-		selector, "selection-changed",
-		G_CALLBACK (memo_shell_sidebar_selection_changed_cb),
-		shell_sidebar);
 }
 
 static void
@@ -654,11 +589,11 @@ static void
 memo_shell_sidebar_constructed (GObject *object)
 {
 	EMemoShellSidebarPrivate *priv;
+	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
-	EShellBackend *shell_backend;
 	EShellSidebar *shell_sidebar;
-	ESourceList *source_list;
+	ESourceRegistry *registry;
 	GtkContainer *container;
 	GtkWidget *widget;
 	AtkObject *a11y;
@@ -670,11 +605,8 @@ memo_shell_sidebar_constructed (GObject *object)
 
 	shell_sidebar = E_SHELL_SIDEBAR (object);
 	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_backend = e_shell_view_get_shell_backend (shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
-
-	source_list = e_memo_shell_backend_get_source_list (
-		E_MEMO_SHELL_BACKEND (shell_backend));
+	shell = e_shell_window_get_shell (shell_window);
 
 	container = GTK_CONTAINER (shell_sidebar);
 
@@ -689,7 +621,8 @@ memo_shell_sidebar_constructed (GObject *object)
 
 	container = GTK_CONTAINER (widget);
 
-	widget = e_memo_list_selector_new (source_list);
+	registry = e_shell_get_registry (shell);
+	widget = e_memo_list_selector_new (registry);
 	e_source_selector_set_select_new (E_SOURCE_SELECTOR (widget), TRUE);
 	gtk_container_add (container, widget);
 	a11y = gtk_widget_get_accessible (widget);
@@ -721,20 +654,24 @@ memo_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
 	source = e_source_selector_get_primary_selection (selector);
 
 	if (source != NULL) {
+		ESourceSelectable *extension;
 		ECalClient *client;
-		const gchar *uri;
-		const gchar *delete;
+		gboolean writable_hint;
+		const gchar *uid;
 
-		uri = e_source_peek_relative_uri (source);
-		is_system = (uri == NULL || strcmp (uri, "system") == 0);
+		uid = e_source_get_uid (source);
+		is_system = (g_strcmp0 (uid, "system") == 0);
 
-		can_delete = !is_system;
-		delete = e_source_get_property (source, "delete");
-		can_delete &= (delete == NULL || strcmp (delete, "no") != 0);
+		extension = e_source_get_extension (
+			source, E_SOURCE_EXTENSION_MEMO_LIST);
+		writable_hint =
+			e_source_selectable_get_writable_hint (extension);
+
+		can_delete = !is_system && writable_hint;
 
 		client = g_hash_table_lookup (
 			memo_shell_sidebar->priv->client_table,
-			e_source_peek_uid (source));
+			e_source_get_uid (source));
 		refresh_supported =
 			client && e_client_check_refresh_supported (E_CLIENT (client));
 	}
@@ -768,8 +705,7 @@ memo_shell_sidebar_client_removed (EMemoShellSidebar *memo_shell_sidebar,
 		NULL, NULL, memo_shell_sidebar);
 
 	source = e_client_get_source (E_CLIENT (client));
-	uid = e_source_peek_uid (source);
-	g_return_if_fail (uid != NULL);
+	uid = e_source_get_uid (source);
 
 	g_hash_table_remove (client_table, uid);
 	e_source_selector_unselect_source (selector, source);
@@ -952,8 +888,8 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
 	ECalClient *default_client;
 	ECalClient *client;
 	icaltimezone *timezone;
+	const gchar *display_name;
 	const gchar *uid;
-	const gchar *uri;
 	gchar *message;
 
 	g_return_if_fail (E_IS_MEMO_SHELL_SIDEBAR (memo_shell_sidebar));
@@ -964,7 +900,7 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
 	default_client = memo_shell_sidebar->priv->default_client;
 	selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar);
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (client_table, uid);
 
 	if (client != NULL)
@@ -975,19 +911,14 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
 		const gchar *default_uid;
 
 		default_source = e_client_get_source (E_CLIENT (default_client));
-		default_uid = e_source_peek_uid (default_source);
+		default_uid = e_source_get_uid (default_source);
 
 		if (g_strcmp0 (uid, default_uid) == 0)
 			client = g_object_ref (default_client);
 	}
 
-	if (client == NULL) {
+	if (client == NULL)
 		client = e_cal_client_new (source, source_type, NULL);
-		if (client)
-			g_signal_connect (
-				client, "authenticate",
-				G_CALLBACK (e_client_utils_authenticate_handler), NULL);
-	}
 
 	g_return_if_fail (client != NULL);
 
@@ -1004,9 +935,8 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
 	g_hash_table_insert (client_table, g_strdup (uid), client);
 	e_source_selector_select_source (selector, source);
 
-	uri = e_client_get_uri (E_CLIENT (client));
-	/* Translators: The string field is a URI. */
-	message = g_strdup_printf (_("Opening memos at %s"), uri);
+	display_name = e_source_get_display_name (source);
+	message = g_strdup_printf (_("Opening memo list '%s'"), display_name);
 	memo_shell_sidebar_emit_status_message (memo_shell_sidebar, message);
 	g_free (message);
 
@@ -1041,7 +971,7 @@ e_memo_shell_sidebar_remove_source (EMemoShellSidebar *memo_shell_sidebar,
 
 	client_table = memo_shell_sidebar->priv->client_table;
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (client_table, uid);
 
 	if (client == NULL)
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c
index d71b893..63dfe90 100644
--- a/modules/calendar/e-memo-shell-view-actions.c
+++ b/modules/calendar/e-memo-shell-view-actions.c
@@ -77,12 +77,22 @@ action_memo_forward_cb (GtkAction *action,
                         EMemoShellView *memo_shell_view)
 {
 	EMemoShellContent *memo_shell_content;
+	EShell *shell;
+	EShellView *shell_view;
+	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	EMemoTable *memo_table;
 	ECalModelComponent *comp_data;
 	ECalComponent *comp;
 	icalcomponent *clone;
 	GSList *list;
 
+	shell_view = E_SHELL_VIEW (memo_shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+
 	memo_shell_content = memo_shell_view->priv->memo_shell_content;
 	memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
 
@@ -95,9 +105,11 @@ action_memo_forward_cb (GtkAction *action,
 	comp = e_cal_component_new ();
 	clone = icalcomponent_new_clone (comp_data->icalcomp);
 	e_cal_component_set_icalcomponent (comp, clone);
+
 	itip_send_comp (
-		E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+		registry, E_CAL_COMPONENT_METHOD_PUBLISH, comp,
 		comp_data->client, NULL, NULL, NULL, TRUE, FALSE);
+
 	g_object_unref (comp);
 }
 
@@ -106,13 +118,18 @@ action_memo_list_copy_cb (GtkAction *action,
                           EMemoShellView *memo_shell_view)
 {
 	EMemoShellSidebar *memo_shell_sidebar;
-	EShellWindow *shell_window;
+	EShell *shell;
 	EShellView *shell_view;
+	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	ESourceSelector *selector;
 	ESource *source;
 
 	shell_view = E_SHELL_VIEW (memo_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
 
 	memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar;
 	selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar);
@@ -120,7 +137,7 @@ action_memo_list_copy_cb (GtkAction *action,
 	g_return_if_fail (E_IS_SOURCE (source));
 
 	copy_source_dialog (
-		GTK_WINDOW (shell_window),
+		GTK_WINDOW (shell_window), registry,
 		source, E_CAL_CLIENT_SOURCE_TYPE_MEMOS);
 }
 
@@ -128,32 +145,16 @@ static void
 action_memo_list_delete_cb (GtkAction *action,
                             EMemoShellView *memo_shell_view)
 {
-	EMemoShellBackend *memo_shell_backend;
-	EMemoShellContent *memo_shell_content;
 	EMemoShellSidebar *memo_shell_sidebar;
 	EShellWindow *shell_window;
 	EShellView *shell_view;
-	EMemoTable *memo_table;
-	ECalClient *client;
-	ECalModel *model;
 	ESourceSelector *selector;
-	ESourceGroup *source_group;
-	ESourceList *source_list;
 	ESource *source;
 	gint response;
-	gchar *uri;
-	GError *error = NULL;
 
 	shell_view = E_SHELL_VIEW (memo_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
 
-	memo_shell_backend = memo_shell_view->priv->memo_shell_backend;
-	source_list = e_memo_shell_backend_get_source_list (memo_shell_backend);
-
-	memo_shell_content = memo_shell_view->priv->memo_shell_content;
-	memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
-	model = e_memo_table_get_model (memo_table);
-
 	memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar;
 	selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar);
 	source = e_source_selector_get_primary_selection (selector);
@@ -163,58 +164,46 @@ action_memo_list_delete_cb (GtkAction *action,
 	response = e_alert_run_dialog_for_args (
 		GTK_WINDOW (shell_window),
 		"calendar:prompt-delete-memo-list",
-		e_source_peek_name (source), NULL);
-	if (response != GTK_RESPONSE_YES)
-		return;
-
-	uri = e_source_get_uri (source);
-	client = e_cal_model_get_client_for_uri (model, uri);
-	if (client == NULL)
-		client = e_cal_client_new_from_uri (
-			uri, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL);
-	g_free (uri);
-
-	g_return_if_fail (client != NULL);
+		e_source_get_display_name (source), NULL);
 
-	e_client_remove_sync (E_CLIENT (client), NULL, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Failed to remove client: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
+	if (response != GTK_RESPONSE_YES)
 		return;
-	}
-
-	if (e_source_selector_source_is_selected (selector, source)) {
-		e_memo_shell_sidebar_remove_source (
-			memo_shell_sidebar, source);
-		e_source_selector_unselect_source (selector, source);
-	}
 
-	source_group = e_source_peek_group (source);
-	e_source_group_remove_source (source_group, source);
-
-	e_source_list_sync (source_list, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Failed to sync source list: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-	}
+	e_shell_view_submit_source (shell_view, source);
 }
 
 static void
 action_memo_list_new_cb (GtkAction *action,
                          EMemoShellView *memo_shell_view)
 {
+	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
 
 	shell_view = E_SHELL_VIEW (memo_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
-	calendar_setup_new_memo_list (GTK_WINDOW (shell_window));
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_MEMOS;
+	config = e_cal_source_config_new (registry, NULL, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("New Memo List"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static void
@@ -251,11 +240,16 @@ static void
 action_memo_list_properties_cb (GtkAction *action,
                                 EMemoShellView *memo_shell_view)
 {
-	EMemoShellSidebar *memo_shell_sidebar;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	EMemoShellSidebar *memo_shell_sidebar;
+	ECalClientSourceType source_type;
 	ESource *source;
 	ESourceSelector *selector;
+	ESourceRegistry *registry;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
 
 	shell_view = E_SHELL_VIEW (memo_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
@@ -263,9 +257,23 @@ action_memo_list_properties_cb (GtkAction *action,
 	memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar;
 	selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar);
 	source = e_source_selector_get_primary_selection (selector);
-	g_return_if_fail (E_IS_SOURCE (source));
+	g_return_if_fail (source != NULL);
+
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_MEMOS;
+	registry = e_source_selector_get_registry (selector);
+	config = e_cal_source_config_new (registry, source, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
 
-	calendar_setup_edit_memo_list (GTK_WINDOW (shell_window), source);
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Memo List Properties"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static void
@@ -278,7 +286,6 @@ action_memo_list_refresh_cb (GtkAction *action,
 	ECalClient *client;
 	ECalModel *model;
 	ESource *source;
-	gchar *uri;
 	GError *error = NULL;
 
 	memo_shell_content = memo_shell_view->priv->memo_shell_content;
@@ -290,10 +297,7 @@ action_memo_list_refresh_cb (GtkAction *action,
 	source = e_source_selector_get_primary_selection (selector);
 	g_return_if_fail (E_IS_SOURCE (source));
 
-	uri = e_source_get_uri (source);
-	client = e_cal_model_get_client_for_uri (model, uri);
-	g_free (uri);
-
+	client = e_cal_model_get_client_for_source (model, source);
 	if (client == NULL)
 		return;
 
@@ -304,7 +308,7 @@ action_memo_list_refresh_cb (GtkAction *action,
 	if (error != NULL) {
 		g_warning (
 			"%s: Failed to refresh '%s', %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_error_free (error);
 	}
diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c
index c1278cb..939aeb9 100644
--- a/modules/calendar/e-memo-shell-view-private.c
+++ b/modules/calendar/e-memo-shell-view-private.c
@@ -321,6 +321,7 @@ e_memo_shell_view_open_memo (EMemoShellView *memo_shell_view,
 	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	CompEditor *editor;
 	CompEditorFlags flags = 0;
 	ECalComponent *comp;
@@ -334,6 +335,8 @@ e_memo_shell_view_open_memo (EMemoShellView *memo_shell_view,
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	shell = e_shell_window_get_shell (shell_window);
 
+	registry = e_shell_get_registry (shell);
+
 	uid = icalcomponent_get_uid (comp_data->icalcomp);
 	editor = comp_editor_find_instance (uid);
 
@@ -347,7 +350,7 @@ e_memo_shell_view_open_memo (EMemoShellView *memo_shell_view,
 	if (e_cal_component_has_organizer (comp))
 		flags |= COMP_EDITOR_IS_SHARED;
 
-	if (itip_organizer_is_user (comp, comp_data->client))
+	if (itip_organizer_is_user (registry, comp, comp_data->client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	editor = memo_editor_new (comp_data->client, shell, flags);
diff --git a/modules/calendar/e-memo-shell-view-private.h b/modules/calendar/e-memo-shell-view-private.h
index 0a6a390..08ac2b8 100644
--- a/modules/calendar/e-memo-shell-view-private.h
+++ b/modules/calendar/e-memo-shell-view-private.h
@@ -36,12 +36,13 @@
 #include "shell/e-shell-utils.h"
 #include "misc/e-popup-action.h"
 #include "misc/e-selectable.h"
+#include "misc/e-source-config-dialog.h"
 
 #include "calendar/gui/comp-util.h"
 #include "calendar/gui/e-cal-component-preview.h"
+#include "calendar/gui/e-cal-source-config.h"
 #include "calendar/gui/e-calendar-selector.h"
 #include "calendar/gui/print.h"
-#include "calendar/gui/dialogs/calendar-setup.h"
 #include "calendar/gui/dialogs/copy-source-dialog.h"
 #include "calendar/gui/dialogs/memo-editor.h"
 
diff --git a/modules/calendar/e-memo-shell-view.h b/modules/calendar/e-memo-shell-view.h
index 686ae73..7538368 100644
--- a/modules/calendar/e-memo-shell-view.h
+++ b/modules/calendar/e-memo-shell-view.h
@@ -23,7 +23,6 @@
 #define E_MEMO_SHELL_VIEW_H
 
 #include <shell/e-shell-view.h>
-#include <libedataserver/e-source-list.h>
 
 /* Standard GObject macros */
 #define E_TYPE_MEMO_SHELL_VIEW \
diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c
index 2fc8ce1..4b23a02 100644
--- a/modules/calendar/e-task-shell-backend.c
+++ b/modules/calendar/e-task-shell-backend.c
@@ -28,19 +28,19 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <libecal/e-cal-client.h>
+#include <libecal/e-source-calendar.h>
 #include <libedataserver/e-url.h>
 #include <libedataserver/e-source.h>
-#include <libedataserver/e-source-list.h>
-#include <libedataserver/e-source-group.h>
 #include <libedataserverui/e-client-utils.h>
 
 #include "shell/e-shell.h"
 #include "shell/e-shell-backend.h"
 #include "shell/e-shell-window.h"
+#include "widgets/misc/e-source-config-dialog.h"
 
 #include "calendar/gui/comp-util.h"
-#include "calendar/gui/dialogs/calendar-setup.h"
 #include "calendar/gui/dialogs/task-editor.h"
+#include "calendar/gui/e-cal-source-config.h"
 
 #include "e-task-shell-content.h"
 #include "e-task-shell-migrate.h"
@@ -48,123 +48,13 @@
 #include "e-task-shell-view.h"
 
 struct _ETaskShellBackendPrivate {
-	ESourceList *source_list;
-};
-
-enum {
-	PROP_0,
-	PROP_SOURCE_LIST
+	gint placeholder;
 };
 
 static gpointer parent_class;
 static GType task_shell_backend_type;
 
 static void
-task_shell_backend_ensure_sources (EShellBackend *shell_backend)
-{
-	/* XXX This is basically the same algorithm across all modules.
-	 *     Maybe we could somehow integrate this into EShellBackend? */
-
-	ETaskShellBackend *task_shell_backend;
-	ESourceGroup *on_this_computer;
-	ESourceList *source_list;
-	ESource *personal;
-	EShell *shell;
-	EShellSettings *shell_settings;
-	GSList *sources, *iter;
-	const gchar *name;
-	gboolean save_list = FALSE;
-	GError *error = NULL;
-
-	on_this_computer = NULL;
-	personal = NULL;
-
-	task_shell_backend = E_TASK_SHELL_BACKEND (shell_backend);
-
-	shell = e_shell_backend_get_shell (shell_backend);
-	shell_settings = e_shell_get_shell_settings (shell);
-
-	e_cal_client_get_sources (
-		&task_shell_backend->priv->source_list,
-		E_CAL_CLIENT_SOURCE_TYPE_TASKS, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Could not get task sources: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-		return;
-	}
-
-	source_list = task_shell_backend->priv->source_list;
-
-	on_this_computer = e_source_list_ensure_group (
-		source_list, _("On This Computer"), "local:", TRUE);
-	e_source_list_ensure_group (
-		source_list, _("On The Web"), "webcal://", FALSE);
-
-	g_return_if_fail (on_this_computer);
-
-	sources = e_source_group_peek_sources (on_this_computer);
-
-	/* Make sure this group includes a "Personal" source. */
-	for (iter = sources; iter != NULL; iter = iter->next) {
-		ESource *source = iter->data;
-		const gchar *relative_uri;
-
-		relative_uri = e_source_peek_relative_uri (source);
-		if (g_strcmp0 (relative_uri, "system") == 0) {
-			personal = source;
-			break;
-		}
-	}
-
-	name = _("Personal");
-
-	if (personal == NULL) {
-		ESource *source;
-		GSList *selected;
-		gchar *primary;
-
-		source = e_source_new (name, "system");
-		e_source_set_color_spec (source, "#BECEDD");
-		e_source_group_add_source (on_this_computer, source, -1);
-		g_object_unref (source);
-		save_list = TRUE;
-
-		primary = e_shell_settings_get_string (
-			shell_settings, "cal-primary-task-list");
-
-		selected = e_task_shell_backend_get_selected_task_lists (
-			task_shell_backend);
-
-		if (primary == NULL && selected == NULL) {
-			const gchar *uid;
-
-			uid = e_source_peek_uid (source);
-			selected = g_slist_prepend (NULL, g_strdup (uid));
-
-			e_shell_settings_set_string (
-				shell_settings, "cal-primary-task-list", uid);
-			e_task_shell_backend_set_selected_task_lists (
-				task_shell_backend, selected);
-		}
-
-		g_slist_foreach (selected, (GFunc) g_free, NULL);
-		g_slist_free (selected);
-		g_free (primary);
-	} else {
-		/* Force the source name to the current locale. */
-		e_source_set_name (personal, name);
-	}
-
-	g_object_unref (on_this_computer);
-
-	if (save_list)
-		e_source_list_sync (source_list, NULL);
-}
-
-static void
 task_shell_backend_new_task (ESource *source,
                              GAsyncResult *result,
                              EShell *shell,
@@ -183,7 +73,7 @@ task_shell_backend_new_task (ESource *source,
 		g_warn_if_fail (client == NULL);
 		g_warning (
 			"%s: Failed to open '%s': %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_error_free (error);
 		return;
@@ -239,55 +129,62 @@ action_task_new_cb (GtkAction *action,
                     EShellWindow *shell_window)
 {
 	EShell *shell;
-	EShellBackend *shell_backend;
-	EShellSettings *shell_settings;
-	ESource *source = NULL;
-	ESourceList *source_list;
+	ESource *source;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
 	const gchar *action_name;
-	gchar *uid;
 
 	/* This callback is used for both tasks and assigned tasks. */
 
 	shell = e_shell_window_get_shell (shell_window);
-	shell_settings = e_shell_get_shell_settings (shell);
-	shell_backend = e_shell_get_backend_by_name (shell, "tasks");
-
-	g_object_get (shell_backend, "source-list", &source_list, NULL);
-	g_return_if_fail (E_IS_SOURCE_LIST (source_list));
 
-	uid = e_shell_settings_get_string (
-		shell_settings, "cal-primary-task-list");
-
-	if (uid != NULL) {
-		source = e_source_list_peek_source_by_uid (source_list, uid);
-		g_free (uid);
-	}
-
-	if (source == NULL)
-		source = e_source_list_peek_default_source (source_list);
-
-	g_return_if_fail (E_IS_SOURCE (source));
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_TASKS;
+	source = e_source_registry_get_default_task_list (registry);
 
 	/* Use a callback function appropriate for the action.
 	 * FIXME Need to obtain a better default time zone. */
 	action_name = gtk_action_get_name (action);
 	if (strcmp (action_name, "task-assigned-new") == 0)
-		e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_TASKS, FALSE, NULL,
-			e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
-			task_shell_backend_task_assigned_new_cb, g_object_ref (shell));
+		e_client_utils_open_new (
+			source, source_type, FALSE, NULL,
+			task_shell_backend_task_assigned_new_cb,
+			g_object_ref (shell));
 	else
-		e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_TASKS, FALSE, NULL,
-			e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
-			task_shell_backend_task_new_cb, g_object_ref (shell));
-
-	g_object_unref (source_list);
+		e_client_utils_open_new (
+			source, source_type, FALSE, NULL,
+			task_shell_backend_task_new_cb,
+			g_object_ref (shell));
 }
 
 static void
 action_task_list_new_cb (GtkAction *action,
                          EShellWindow *shell_window)
 {
-	calendar_setup_new_task_list (GTK_WINDOW (shell_window));
+	EShell *shell;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
+
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_TASKS;
+	config = e_cal_source_config_new (registry, NULL, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("New Task List"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static GtkActionEntry item_entries[] = {
@@ -327,7 +224,7 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	ECalClient *client;
 	ECalComponent *comp;
 	ESource *source;
-	ESourceList *source_list;
+	ESourceRegistry *registry;
 	ECalClientSourceType source_type;
 	EUri *euri;
 	icalcomponent *icalcomp;
@@ -392,39 +289,24 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	 * we successfully open it is another matter... */
 	handled = TRUE;
 
-	e_cal_client_get_sources (&source_list, source_type, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Could not get task sources: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-		goto exit;
-	}
-
-	source = e_source_list_peek_source_by_uid (source_list, source_uid);
+	registry = e_shell_get_registry (shell);
+	source = e_source_registry_lookup_by_uid (registry, source_uid);
 	if (source == NULL) {
 		g_printerr ("No source for UID '%s'\n", source_uid);
-		g_object_unref (source_list);
 		goto exit;
 	}
 
 	client = e_cal_client_new (source, source_type, &error);
 
-	if (client != NULL) {
-		g_signal_connect (
-			client, "authenticate",
-			G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+	if (client != NULL)
 		e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error);
-	}
 
 	if (error != NULL) {
 		g_warning (
 			"%s: Failed to create/open client: %s",
 			G_STRFUNC, error->message);
-		if (client)
+		if (client != NULL)
 			g_object_unref (client);
-		g_object_unref (source_list);
 		g_error_free (error);
 		goto exit;
 	}
@@ -444,7 +326,6 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 		g_warning (
 			"%s: Failed to get object: %s",
 			G_STRFUNC, error->message);
-		g_object_unref (source_list);
 		g_object_unref (client);
 		g_error_free (error);
 		goto exit;
@@ -462,7 +343,7 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 	if (icalprop != NULL)
 		flags |= COMP_EDITOR_IS_ASSIGNED;
 
-	if (itip_organizer_is_user (comp, client))
+	if (itip_organizer_is_user (registry, comp, client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	if (!e_cal_component_has_attendees (comp))
@@ -476,7 +357,6 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
 present:
 	gtk_window_present (GTK_WINDOW (editor));
 
-	g_object_unref (source_list);
 	g_object_unref (client);
 
 exit:
@@ -510,40 +390,6 @@ task_shell_backend_window_added_cb (EShellBackend *shell_backend,
 }
 
 static void
-task_shell_backend_get_property (GObject *object,
-                                 guint property_id,
-                                 GValue *value,
-                                 GParamSpec *pspec)
-{
-	switch (property_id) {
-		case PROP_SOURCE_LIST:
-			g_value_set_object (
-				value,
-				e_task_shell_backend_get_source_list (
-				E_TASK_SHELL_BACKEND (object)));
-			return;
-	}
-
-	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-task_shell_backend_dispose (GObject *object)
-{
-	ETaskShellBackendPrivate *priv;
-
-	priv = E_TASK_SHELL_BACKEND (object)->priv;
-
-	if (priv->source_list != NULL) {
-		g_object_unref (priv->source_list);
-		priv->source_list = NULL;
-	}
-
-	/* Chain up to parent's dispose() method. */
-	G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
 task_shell_backend_constructed (GObject *object)
 {
 	EShell *shell;
@@ -552,8 +398,6 @@ task_shell_backend_constructed (GObject *object)
 	shell_backend = E_SHELL_BACKEND (object);
 	shell = e_shell_backend_get_shell (shell_backend);
 
-	task_shell_backend_ensure_sources (shell_backend);
-
 	g_signal_connect_swapped (
 		shell, "handle-uri",
 		G_CALLBACK (task_shell_backend_handle_uri_cb),
@@ -578,8 +422,6 @@ task_shell_backend_class_init (ETaskShellBackendClass *class)
 	g_type_class_add_private (class, sizeof (ETaskShellBackendPrivate));
 
 	object_class = G_OBJECT_CLASS (class);
-	object_class->get_property = task_shell_backend_get_property;
-	object_class->dispose = task_shell_backend_dispose;
 	object_class->constructed = task_shell_backend_constructed;
 
 	shell_backend_class = E_SHELL_BACKEND_CLASS (class);
@@ -591,16 +433,6 @@ task_shell_backend_class_init (ETaskShellBackendClass *class)
 	shell_backend_class->preferences_page = "calendar-and-tasks";
 	shell_backend_class->start = NULL;
 	shell_backend_class->migrate = e_task_shell_backend_migrate;
-
-	g_object_class_install_property (
-		object_class,
-		PROP_SOURCE_LIST,
-		g_param_spec_object (
-			"source-list",
-			"Source List",
-			"The registry of task lists",
-			E_TYPE_SOURCE_LIST,
-			G_PARAM_READABLE));
 }
 
 static void
@@ -636,48 +468,7 @@ e_task_shell_backend_register_type (GTypeModule *type_module)
 	task_shell_backend_type = g_type_module_register_type (
 		type_module, E_TYPE_SHELL_BACKEND,
 		"ETaskShellBackend", &type_info, 0);
-}
-
-ESourceList *
-e_task_shell_backend_get_source_list (ETaskShellBackend *task_shell_backend)
-{
-	g_return_val_if_fail (
-		E_IS_TASK_SHELL_BACKEND (task_shell_backend), NULL);
-
-	return task_shell_backend->priv->source_list;
-}
-
-GSList *
-e_task_shell_backend_get_selected_task_lists (ETaskShellBackend *task_shell_backend)
-{
-	GConfClient *client;
-	GSList *selected_task_lists;
-	const gchar *key;
-
-	g_return_val_if_fail (
-		E_IS_TASK_SHELL_BACKEND (task_shell_backend), NULL);
 
-	client = gconf_client_get_default ();
-	key = "/apps/evolution/calendar/tasks/selected_tasks";
-	selected_task_lists = gconf_client_get_list (
-		client, key, GCONF_VALUE_STRING, NULL);
-	g_object_unref (client);
-
-	return selected_task_lists;
-}
-
-void
-e_task_shell_backend_set_selected_task_lists (ETaskShellBackend *task_shell_backend,
-                                              GSList *selected_task_lists)
-{
-	GConfClient *client;
-	const gchar *key;
-
-	g_return_if_fail (E_IS_TASK_SHELL_BACKEND (task_shell_backend));
-
-	client = gconf_client_get_default ();
-	key = "/apps/evolution/calendar/tasks/selected_tasks";
-	gconf_client_set_list (
-		client, key, GCONF_VALUE_STRING, selected_task_lists, NULL);
-	g_object_unref (client);
+	/* Register relevant ESource extensions. */
+	E_TYPE_SOURCE_TASK_LIST;
 }
diff --git a/modules/calendar/e-task-shell-backend.h b/modules/calendar/e-task-shell-backend.h
index ba56e91..a9f1085 100644
--- a/modules/calendar/e-task-shell-backend.h
+++ b/modules/calendar/e-task-shell-backend.h
@@ -23,7 +23,6 @@
 #define E_TASK_SHELL_BACKEND_H
 
 #include <shell/e-shell-backend.h>
-#include <libedataserver/e-source-list.h>
 
 /* Standard GObject macros */
 #define E_TYPE_TASK_SHELL_BACKEND \
@@ -62,13 +61,6 @@ struct _ETaskShellBackendClass {
 GType		e_task_shell_backend_get_type	(void);
 void		e_task_shell_backend_register_type
 					(GTypeModule *type_module);
-ESourceList *	e_task_shell_backend_get_source_list
-					(ETaskShellBackend *task_shell_backend);
-GSList *	e_task_shell_backend_get_selected_task_lists
-					(ETaskShellBackend *task_shell_backend);
-void		e_task_shell_backend_set_selected_task_lists
-					(ETaskShellBackend *task_shell_backend,
-					 GSList *selected_task_lists);
 
 G_END_DECLS
 
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c
index 743bb93..6214641 100644
--- a/modules/calendar/e-task-shell-content.c
+++ b/modules/calendar/e-task-shell-content.c
@@ -116,7 +116,7 @@ task_shell_content_table_foreach_cb (gint model_row,
 		const gchar *source_uid;
 
 		source = e_client_get_source (E_CLIENT (comp_data->client));
-		source_uid = e_source_peek_uid (source);
+		source_uid = e_source_get_uid (source);
 
 		foreach_data->list = g_slist_prepend (
 			foreach_data->list,
@@ -413,10 +413,12 @@ static void
 task_shell_content_constructed (GObject *object)
 {
 	ETaskShellContentPrivate *priv;
+	EShell *shell;
+	EShellView *shell_view;
+	EShellWindow *shell_window;
 	EShellContent *shell_content;
 	EShellTaskbar *shell_taskbar;
-	EShellWindow *shell_window;
-	EShellView *shell_view;
+	ESourceRegistry *registry;
 	GalViewInstance *view_instance;
 	GtkTargetList *target_list;
 	GtkTargetEntry *targets;
@@ -433,8 +435,10 @@ task_shell_content_constructed (GObject *object)
 	shell_view = e_shell_content_get_shell_view (shell_content);
 	shell_taskbar = e_shell_view_get_shell_taskbar (shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
 
-	priv->task_model = e_cal_model_tasks_new ();
+	registry = e_shell_get_registry (shell);
+	priv->task_model = e_cal_model_tasks_new (registry);
 
 	/* Build content widgets. */
 
diff --git a/modules/calendar/e-task-shell-migrate.c b/modules/calendar/e-task-shell-migrate.c
index 60499d6..40b731a 100644
--- a/modules/calendar/e-task-shell-migrate.c
+++ b/modules/calendar/e-task-shell-migrate.c
@@ -25,149 +25,6 @@
 
 #include "e-task-shell-migrate.h"
 
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include <libebackend/e-dbhash.h>
-#include <libedataserver/e-source.h>
-#include <libedataserver/e-source-group.h>
-#include <libedataserver/e-source-list.h>
-#include <libedataserver/e-xml-hash-utils.h>
-#include <libedataserver/e-xml-utils.h>
-
-#include "e-util/e-util-private.h"
-#include "calendar/gui/calendar-config-keys.h"
-#include "shell/e-shell.h"
-
-#include "e-task-shell-backend.h"
-
-#define LOCAL_BASE_URI "local:"
-#define WEBCAL_BASE_URI "webcal://"
-#define PERSONAL_RELATIVE_URI "system"
-
-static void
-create_task_sources (EShellBackend *shell_backend,
-                     ESourceList *source_list,
-                     ESourceGroup **on_this_computer,
-                     ESourceGroup **on_the_web,
-                     ESource **personal_source)
-{
-	EShell *shell;
-	EShellSettings *shell_settings;
-	GSList *groups;
-	ESourceGroup *group;
-
-	*on_this_computer = NULL;
-	*on_the_web = NULL;
-	*personal_source = NULL;
-
-	shell = e_shell_backend_get_shell (shell_backend);
-	shell_settings = e_shell_get_shell_settings (shell);
-
-	groups = e_source_list_peek_groups (source_list);
-	if (groups) {
-		/* groups are already there, we need to search for things... */
-		GSList *g;
-		const gchar *data_dir;
-		gchar *base_dir, *base_uri;
-
-		data_dir = e_shell_backend_get_data_dir (shell_backend);
-		base_dir = g_build_filename (data_dir, "local", NULL);
-		base_uri = g_filename_to_uri (base_dir, NULL, NULL);
-
-		for (g = groups; g; g = g->next) {
-			group = E_SOURCE_GROUP (g->data);
-
-			if (strcmp (base_uri, e_source_group_peek_base_uri (group)) == 0)
-				e_source_group_set_base_uri (group, LOCAL_BASE_URI);
-
-			if (!*on_this_computer && !strcmp (LOCAL_BASE_URI,
-				e_source_group_peek_base_uri (group)))
-				*on_this_computer = g_object_ref (group);
-			else if (!*on_the_web && !strcmp (WEBCAL_BASE_URI,
-				e_source_group_peek_base_uri (group)))
-				*on_the_web = g_object_ref (group);
-		}
-
-		g_free (base_dir);
-		g_free (base_uri);
-	}
-
-	if (*on_this_computer) {
-		/* make sure "Personal" shows up as a source under
-		 * this group */
-		GSList *sources = e_source_group_peek_sources (*on_this_computer);
-		GSList *s;
-		for (s = sources; s; s = s->next) {
-			ESource *source = E_SOURCE (s->data);
-			const gchar *relative_uri;
-
-			relative_uri = e_source_peek_relative_uri (source);
-			if (relative_uri == NULL)
-				continue;
-			if (!strcmp (PERSONAL_RELATIVE_URI, relative_uri)) {
-				*personal_source = g_object_ref (source);
-				break;
-			}
-		}
-	} else {
-		/* create the local source group */
-		group = e_source_group_new (_("On This Computer"), LOCAL_BASE_URI);
-		e_source_list_add_group (source_list, group, -1);
-
-		*on_this_computer = group;
-	}
-
-	if (!*personal_source) {
-		GSList *selected;
-		gchar *primary_task_list;
-
-		/* Create the default Person task list */
-		ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI);
-		e_source_group_add_source (*on_this_computer, source, -1);
-
-		primary_task_list = e_shell_settings_get_string (
-			shell_settings, "cal-primary-task-list");
-
-		selected = e_task_shell_backend_get_selected_task_lists (
-			E_TASK_SHELL_BACKEND (shell_backend));
-
-		if (primary_task_list == NULL && selected == NULL) {
-			GSList link;
-
-			e_shell_settings_set_string (
-				shell_settings, "cal-primary-task-list",
-				e_source_peek_uid (source));
-
-			link.data = (gpointer) e_source_peek_uid (source);
-			link.next = NULL;
-
-			e_task_shell_backend_set_selected_task_lists (
-				E_TASK_SHELL_BACKEND (shell_backend), &link);
-		}
-
-		g_slist_foreach (selected, (GFunc) g_free, NULL);
-		g_slist_free (selected);
-
-		e_source_set_color_spec (source, "#BECEDD");
-		*personal_source = source;
-	}
-
-	if (!*on_the_web) {
-		/* Create the Webcal source group */
-		group = e_source_group_new (_("On The Web"), WEBCAL_BASE_URI);
-		e_source_list_add_group (source_list, group, -1);
-
-		*on_the_web = group;
-	}
-}
-
 gboolean
 e_task_shell_backend_migrate (EShellBackend *shell_backend,
                               gint major,
@@ -175,28 +32,7 @@ e_task_shell_backend_migrate (EShellBackend *shell_backend,
                               gint micro,
                               GError **error)
 {
-	ESourceGroup *on_this_computer = NULL;
-	ESourceGroup *on_the_web = NULL;
-	ESource *personal_source = NULL;
-	ESourceList *source_list;
-
-	g_object_get (shell_backend, "source-list", &source_list, NULL);
-
-	/* we call this unconditionally now - create_groups either
-	 * creates the groups/sources or it finds the necessary
-	 * groups/sources. */
-	create_task_sources (
-		shell_backend, source_list, &on_this_computer,
-		&on_the_web, &personal_source);
-
-	e_source_list_sync (source_list, NULL);
-
-	if (on_this_computer)
-		g_object_unref (on_this_computer);
-	if (on_the_web)
-		g_object_unref (on_the_web);
-	if (personal_source)
-		g_object_unref (personal_source);
+	g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), FALSE);
 
 	return TRUE;
 }
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index 7987071..5ab08b7 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -28,6 +28,8 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <libecal/e-cal-client.h>
+#include <libecal/e-source-calendar.h>
+#include <libedataserver/e-source-password.h>
 #include <libedataserverui/e-client-utils.h>
 
 #include "e-util/e-alert-dialog.h"
@@ -120,7 +122,7 @@ task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar,
 	shell_content = e_shell_view_get_shell_content (shell_view);
 
 	source = e_client_get_source (E_CLIENT (client));
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 
 	g_object_ref (source);
 
@@ -142,21 +144,30 @@ task_shell_sidebar_backend_error_cb (ETaskShellSidebar *task_shell_sidebar,
 	EShellView *shell_view;
 	EShellContent *shell_content;
 	EShellSidebar *shell_sidebar;
-	ESourceGroup *source_group;
+	ESource *parent;
 	ESource *source;
+	GNode *node;
+	const gchar *parent_display_name;
+	const gchar *source_display_name;
 
 	shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
 	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
 	shell_content = e_shell_view_get_shell_content (shell_view);
 
 	source = e_client_get_source (E_CLIENT (client));
-	source_group = e_source_peek_group (source);
+
+	node = e_source_get_node (source);
+	g_return_if_fail (node != NULL);
+	g_return_if_fail (node->parent != NULL);
+
+	parent = E_SOURCE (node->parent->data);
+
+	parent_display_name = e_source_get_display_name (parent);
+	source_display_name = e_source_get_display_name (source);
 
 	e_alert_submit (
-		E_ALERT_SINK (shell_content),
-		"calendar:backend-error",
-		e_source_group_peek_name (source_group),
-		e_source_peek_name (source), message, NULL);
+		E_ALERT_SINK (shell_content), "calendar:backend-error",
+		parent_display_name, source_display_name, message, NULL);
 }
 
 static void
@@ -226,19 +237,6 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
 		return;
 	}
 
-	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED) ||
-	    g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_REQUIRED))
-		e_client_utils_forget_password (E_CLIENT (client));
-
-	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED)) {
-		e_client_open (
-			E_CLIENT (client), FALSE,
-			task_shell_sidebar->priv->loading_clients,
-			task_shell_sidebar_client_opened_cb, user_data);
-		g_clear_error (&error);
-		return;
-	}
-
 	if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) {
 		struct RetryOpenData *rod;
 
@@ -269,7 +267,7 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
 		case E_CLIENT_ERROR_BUSY:
 			g_warning (
 				"%s: Cannot open '%s', it's busy (%s)",
-				G_STRFUNC, e_source_peek_name (source),
+				G_STRFUNC, e_source_get_display_name (source),
 				error->message);
 			g_clear_error (&error);
 			return;
@@ -389,8 +387,6 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
                                 ESource *source)
 {
 	ETaskShellSidebarPrivate *priv;
-	EShellView *shell_view;
-	EShellWindow *shell_window;
 	EShellSidebar *shell_sidebar;
 	ECalClient *client;
 	const gchar *uid;
@@ -400,8 +396,6 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
 	/* FIXME Sidebar should not be accessing the EShellContent.
 	 *       This probably needs to be moved to ETaskShellView. */
 	shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
-	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_window = e_shell_view_get_shell_window (shell_view);
 
 	/* Cancel any unfinished previous request. */
 	if (priv->loading_default_client != NULL) {
@@ -410,7 +404,7 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
 		priv->loading_default_client = NULL;
 	}
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (priv->client_table, uid);
 
 	/* If we already have an open connection for
@@ -428,8 +422,6 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
 	e_client_utils_open_new (
 		source, E_CLIENT_SOURCE_TYPE_TASKS,
 		FALSE, priv->loading_default_client,
-		e_client_utils_authenticate_handler,
-		GTK_WINDOW (shell_window),
 		task_shell_sidebar_default_loaded_cb,
 		g_object_ref (shell_sidebar));
 }
@@ -461,38 +453,6 @@ task_shell_sidebar_row_changed_cb (ETaskShellSidebar *task_shell_sidebar,
 }
 
 static void
-task_shell_sidebar_selection_changed_cb (ETaskShellSidebar *task_shell_sidebar,
-                                         ESourceSelector *selector)
-{
-	EShellView *shell_view;
-	EShellBackend *shell_backend;
-	EShellSidebar *shell_sidebar;
-	GSList *list, *iter;
-
-	/* This signal is emitted less frequently than "row-changed",
-	 * especially when the model is being rebuilt.  So we'll take
-	 * it easy on poor GConf. */
-
-	shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
-	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_backend = e_shell_view_get_shell_backend (shell_view);
-
-	list = e_source_selector_get_selection (selector);
-
-	for (iter = list; iter != NULL; iter = iter->next) {
-		ESource *source = iter->data;
-
-		iter->data = (gpointer) e_source_peek_uid (source);
-		g_object_unref (source);
-	}
-
-	e_task_shell_backend_set_selected_task_lists (
-		E_TASK_SHELL_BACKEND (shell_backend), list);
-
-	g_slist_free (list);
-}
-
-static void
 task_shell_sidebar_primary_selection_changed_cb (ETaskShellSidebar *task_shell_sidebar,
                                                  ESourceSelector *selector)
 {
@@ -514,11 +474,9 @@ task_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 	EShell *shell;
 	EShellBackend *shell_backend;
 	EShellSettings *shell_settings;
+	ESourceRegistry *registry;
 	ESourceSelector *selector;
-	ESourceList *source_list;
-	ESource *source;
 	GtkTreeModel *model;
-	GSList *list, *iter;
 
 	priv = E_TASK_SHELL_SIDEBAR (shell_sidebar)->priv;
 
@@ -531,8 +489,7 @@ task_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 	selector = E_SOURCE_SELECTOR (priv->selector);
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));
 
-	source_list = e_task_shell_backend_get_source_list (
-		E_TASK_SHELL_BACKEND (shell_backend));
+	registry = e_shell_get_registry (shell);
 
 	g_signal_connect_swapped (
 		model, "row-changed",
@@ -551,30 +508,8 @@ task_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
 		G_BINDING_SYNC_CREATE,
 		(GBindingTransformFunc) e_binding_transform_uid_to_source,
 		(GBindingTransformFunc) e_binding_transform_source_to_uid,
-		g_object_ref (source_list),
+		g_object_ref (registry),
 		(GDestroyNotify) g_object_unref);
-
-	list = e_task_shell_backend_get_selected_task_lists (
-		E_TASK_SHELL_BACKEND (shell_backend));
-
-	for (iter = list; iter != NULL; iter = iter->next) {
-		const gchar *uid = iter->data;
-
-		source = e_source_list_peek_source_by_uid (source_list, uid);
-
-		if (source != NULL)
-			e_source_selector_select_source (selector, source);
-	}
-
-	g_slist_foreach (list, (GFunc) g_free, NULL);
-	g_slist_free (list);
-
-	/* Listen for subsequent changes to the selector. */
-
-	g_signal_connect_swapped (
-		selector, "selection-changed",
-		G_CALLBACK (task_shell_sidebar_selection_changed_cb),
-		shell_sidebar);
 }
 
 static void
@@ -654,11 +589,11 @@ static void
 task_shell_sidebar_constructed (GObject *object)
 {
 	ETaskShellSidebarPrivate *priv;
+	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
-	EShellBackend *shell_backend;
 	EShellSidebar *shell_sidebar;
-	ESourceList *source_list;
+	ESourceRegistry *registry;
 	GtkContainer *container;
 	GtkWidget *widget;
 	AtkObject *a11y;
@@ -670,11 +605,8 @@ task_shell_sidebar_constructed (GObject *object)
 
 	shell_sidebar = E_SHELL_SIDEBAR (object);
 	shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
-	shell_backend = e_shell_view_get_shell_backend (shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
-
-	source_list = e_task_shell_backend_get_source_list (
-		E_TASK_SHELL_BACKEND (shell_backend));
+	shell = e_shell_window_get_shell (shell_window);
 
 	container = GTK_CONTAINER (shell_sidebar);
 
@@ -689,7 +621,8 @@ task_shell_sidebar_constructed (GObject *object)
 
 	container = GTK_CONTAINER (widget);
 
-	widget = e_task_list_selector_new (source_list);
+	registry = e_shell_get_registry (shell);
+	widget = e_task_list_selector_new (registry);
 	e_source_selector_set_select_new (E_SOURCE_SELECTOR (widget), TRUE);
 	gtk_container_add (container, widget);
 	a11y = gtk_widget_get_accessible (widget);
@@ -721,21 +654,24 @@ task_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
 	source = e_source_selector_get_primary_selection (selector);
 
 	if (source != NULL) {
+		ESourceSelectable *extension;
 		ECalClient *client;
-		const gchar *uri;
-		const gchar *delete_prop;
+		gboolean writable_hint;
+		const gchar *uid;
 
-		uri = e_source_peek_relative_uri (source);
-		is_system = (uri == NULL || strcmp (uri, "system") == 0);
+		uid = e_source_get_uid (source);
+		is_system = (g_strcmp0 (uid, "system") == 0);
 
-		can_delete = !is_system;
-		delete_prop = e_source_get_property (source, "delete");
-		can_delete = can_delete &&
-			(delete_prop == NULL || strcmp (delete_prop, "no") != 0);
+		extension = e_source_get_extension (
+			source, E_SOURCE_EXTENSION_TASK_LIST);
+		writable_hint =
+			e_source_selectable_get_writable_hint (extension);
+
+		can_delete = !is_system && writable_hint;
 
 		client = g_hash_table_lookup (
 			task_shell_sidebar->priv->client_table,
-			e_source_peek_uid (source));
+			e_source_get_uid (source));
 		refresh_supported = client &&
 			e_client_check_refresh_supported (E_CLIENT (client));
 	}
@@ -769,8 +705,7 @@ task_shell_sidebar_client_removed (ETaskShellSidebar *task_shell_sidebar,
 		NULL, NULL, task_shell_sidebar);
 
 	source = e_client_get_source (E_CLIENT (client));
-	uid = e_source_peek_uid (source);
-	g_return_if_fail (uid != NULL);
+	uid = e_source_get_uid (source);
 
 	g_hash_table_remove (client_table, uid);
 	e_source_selector_unselect_source (selector, source);
@@ -953,8 +888,8 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
 	ECalClient *default_client;
 	ECalClient *client;
 	icaltimezone *timezone;
+	const gchar *display_name;
 	const gchar *uid;
-	const gchar *uri;
 	gchar *message;
 
 	g_return_if_fail (E_IS_TASK_SHELL_SIDEBAR (task_shell_sidebar));
@@ -965,7 +900,7 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
 	default_client = task_shell_sidebar->priv->default_client;
 	selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (client_table, uid);
 
 	if (client != NULL)
@@ -976,19 +911,14 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
 		const gchar *default_uid;
 
 		default_source = e_client_get_source (E_CLIENT (default_client));
-		default_uid = e_source_peek_uid (default_source);
+		default_uid = e_source_get_uid (default_source);
 
 		if (g_strcmp0 (uid, default_uid) == 0)
 			client = g_object_ref (default_client);
 	}
 
-	if (client == NULL) {
+	if (client == NULL)
 		client = e_cal_client_new (source, source_type, NULL);
-		if (client)
-			g_signal_connect (
-				client, "authenticate",
-				G_CALLBACK (e_client_utils_authenticate_handler), NULL);
-	}
 
 	g_return_if_fail (client != NULL);
 
@@ -1005,9 +935,8 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
 	g_hash_table_insert (client_table, g_strdup (uid), client);
 	e_source_selector_select_source (selector, source);
 
-	uri = e_client_get_uri (E_CLIENT (client));
-	/* Translators: The string field is a URI. */
-	message = g_strdup_printf (_("Opening tasks at %s"), uri);
+	display_name = e_source_get_display_name (source);
+	message = g_strdup_printf (_("Opening task list '%s'"), display_name);
 	task_shell_sidebar_emit_status_message (task_shell_sidebar, message);
 	g_free (message);
 
@@ -1042,7 +971,7 @@ e_task_shell_sidebar_remove_source (ETaskShellSidebar *task_shell_sidebar,
 
 	client_table = task_shell_sidebar->priv->client_table;
 
-	uid = e_source_peek_uid (source);
+	uid = e_source_get_uid (source);
 	client = g_hash_table_lookup (client_table, uid);
 
 	if (client == NULL)
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index 2fe2849..6685c23 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -100,12 +100,22 @@ action_task_forward_cb (GtkAction *action,
                         ETaskShellView *task_shell_view)
 {
 	ETaskShellContent *task_shell_content;
+	EShell *shell;
+	EShellView *shell_view;
+	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	ECalModelComponent *comp_data;
 	ETaskTable *task_table;
 	ECalComponent *comp;
 	icalcomponent *clone;
 	GSList *list;
 
+	shell_view = E_SHELL_VIEW (task_shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+
 	task_shell_content = task_shell_view->priv->task_shell_content;
 	task_table = e_task_shell_content_get_task_table (task_shell_content);
 
@@ -118,9 +128,11 @@ action_task_forward_cb (GtkAction *action,
 	comp = e_cal_component_new ();
 	clone = icalcomponent_new_clone (comp_data->icalcomp);
 	e_cal_component_set_icalcomponent (comp, clone);
+
 	itip_send_comp (
-		E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+		registry, E_CAL_COMPONENT_METHOD_PUBLISH, comp,
 		comp_data->client, NULL, NULL, NULL, TRUE, FALSE);
+
 	g_object_unref (comp);
 }
 
@@ -129,13 +141,18 @@ action_task_list_copy_cb (GtkAction *action,
                           ETaskShellView *task_shell_view)
 {
 	ETaskShellSidebar *task_shell_sidebar;
-	EShellWindow *shell_window;
+	EShell *shell;
 	EShellView *shell_view;
+	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	ESourceSelector *selector;
 	ESource *source;
 
 	shell_view = E_SHELL_VIEW (task_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
 
 	task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
 	selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
@@ -143,7 +160,7 @@ action_task_list_copy_cb (GtkAction *action,
 	g_return_if_fail (E_IS_SOURCE (source));
 
 	copy_source_dialog (
-		GTK_WINDOW (shell_window),
+		GTK_WINDOW (shell_window), registry,
 		source, E_CAL_CLIENT_SOURCE_TYPE_TASKS);
 }
 
@@ -151,32 +168,16 @@ static void
 action_task_list_delete_cb (GtkAction *action,
                             ETaskShellView *task_shell_view)
 {
-	ETaskShellBackend *task_shell_backend;
-	ETaskShellContent *task_shell_content;
 	ETaskShellSidebar *task_shell_sidebar;
 	EShellWindow *shell_window;
 	EShellView *shell_view;
-	ETaskTable *task_table;
-	ECalClient *client;
-	ECalModel *model;
 	ESourceSelector *selector;
-	ESourceGroup *source_group;
-	ESourceList *source_list;
 	ESource *source;
 	gint response;
-	gchar *uri;
-	GError *error = NULL;
 
 	shell_view = E_SHELL_VIEW (task_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
 
-	task_shell_backend = task_shell_view->priv->task_shell_backend;
-	source_list = e_task_shell_backend_get_source_list (task_shell_backend);
-
-	task_shell_content = task_shell_view->priv->task_shell_content;
-	task_table = e_task_shell_content_get_task_table (task_shell_content);
-	model = e_task_table_get_model (task_table);
-
 	task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
 	selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
 	source = e_source_selector_get_primary_selection (selector);
@@ -186,58 +187,46 @@ action_task_list_delete_cb (GtkAction *action,
 	response = e_alert_run_dialog_for_args (
 		GTK_WINDOW (shell_window),
 		"calendar:prompt-delete-task-list",
-		e_source_peek_name (source), NULL);
-	if (response != GTK_RESPONSE_YES)
-		return;
-
-	uri = e_source_get_uri (source);
-	client = e_cal_model_get_client_for_uri (model, uri);
-	if (client == NULL)
-		client = e_cal_client_new_from_uri (
-			uri, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL);
-	g_free (uri);
+		e_source_get_display_name (source), NULL);
 
-	g_return_if_fail (client != NULL);
-
-	e_client_remove_sync (E_CLIENT (client), NULL, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Failed to remove client: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
+	if (response != GTK_RESPONSE_YES)
 		return;
-	}
 
-	if (e_source_selector_source_is_selected (selector, source)) {
-		e_task_shell_sidebar_remove_source (
-			task_shell_sidebar, source);
-		e_source_selector_unselect_source (selector, source);
-	}
-
-	source_group = e_source_peek_group (source);
-	e_source_group_remove_source (source_group, source);
-
-	e_source_list_sync (source_list, &error);
-
-	if (error != NULL) {
-		g_warning (
-			"%s: Failed to sync srouce list: %s",
-			G_STRFUNC, error->message);
-		g_error_free (error);
-	}
+	e_shell_view_remove_source (shell_view, source);
 }
 
 static void
 action_task_list_new_cb (GtkAction *action,
                          ETaskShellView *task_shell_view)
 {
+	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
+	ECalClientSourceType source_type;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
 
 	shell_view = E_SHELL_VIEW (task_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
-	calendar_setup_new_task_list (GTK_WINDOW (shell_window));
+	shell = e_shell_window_get_shell (shell_window);
+
+	registry = e_shell_get_registry (shell);
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_TASKS;
+	config = e_cal_source_config_new (registry, NULL, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), _("New Task List"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static void
@@ -274,11 +263,16 @@ static void
 action_task_list_properties_cb (GtkAction *action,
                                 ETaskShellView *task_shell_view)
 {
-	ETaskShellSidebar *task_shell_sidebar;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ETaskShellSidebar *task_shell_sidebar;
+	ECalClientSourceType source_type;
 	ESource *source;
 	ESourceSelector *selector;
+	ESourceRegistry *registry;
+	GtkWidget *config;
+	GtkWidget *dialog;
+	const gchar *icon_name;
 
 	shell_view = E_SHELL_VIEW (task_shell_view);
 	shell_window = e_shell_view_get_shell_window (shell_view);
@@ -286,9 +280,23 @@ action_task_list_properties_cb (GtkAction *action,
 	task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
 	selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
 	source = e_source_selector_get_primary_selection (selector);
-	g_return_if_fail (E_IS_SOURCE (source));
+	g_return_if_fail (source != NULL);
+
+	source_type = E_CAL_CLIENT_SOURCE_TYPE_TASKS;
+	registry = e_source_selector_get_registry (selector);
+	config = e_cal_source_config_new (registry, source, source_type);
+
+	dialog = e_source_config_dialog_new (
+		E_SOURCE_CONFIG (config), GTK_WINDOW (shell_window));
+
+	icon_name = gtk_action_get_icon_name (action);
+	gtk_window_set_icon_name (GTK_WINDOW (dialog), icon_name);
 
-	calendar_setup_edit_task_list (GTK_WINDOW (shell_window), source);
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Task List Properties"));
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 }
 
 static void
@@ -301,7 +309,6 @@ action_task_list_refresh_cb (GtkAction *action,
 	ECalClient *client;
 	ECalModel *model;
 	ESource *source;
-	gchar *uri;
 	GError *error = NULL;
 
 	task_shell_content = task_shell_view->priv->task_shell_content;
@@ -313,10 +320,7 @@ action_task_list_refresh_cb (GtkAction *action,
 	source = e_source_selector_get_primary_selection (selector);
 	g_return_if_fail (E_IS_SOURCE (source));
 
-	uri = e_source_get_uri (source);
-	client = e_cal_model_get_client_for_uri (model, uri);
-	g_free (uri);
-
+	client = e_cal_model_get_client_for_source (model, source);
 	if (client == NULL)
 		return;
 
@@ -327,7 +331,7 @@ action_task_list_refresh_cb (GtkAction *action,
 	if (error != NULL) {
 		g_warning (
 			"%s: Failed to refresh '%s', %s",
-			G_STRFUNC, e_source_peek_name (source),
+			G_STRFUNC, e_source_get_display_name (source),
 			error->message);
 		g_error_free (error);
 	}
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index 3467c12..0717756 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -407,6 +407,7 @@ e_task_shell_view_open_task (ETaskShellView *task_shell_view,
 	EShell *shell;
 	EShellView *shell_view;
 	EShellWindow *shell_window;
+	ESourceRegistry *registry;
 	CompEditor *editor;
 	CompEditorFlags flags = 0;
 	ECalComponent *comp;
@@ -421,6 +422,8 @@ e_task_shell_view_open_task (ETaskShellView *task_shell_view,
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	shell = e_shell_window_get_shell (shell_window);
 
+	registry = e_shell_get_registry (shell);
+
 	uid = icalcomponent_get_uid (comp_data->icalcomp);
 	editor = comp_editor_find_instance (uid);
 
@@ -436,7 +439,7 @@ e_task_shell_view_open_task (ETaskShellView *task_shell_view,
 	if (prop != NULL)
 		flags |= COMP_EDITOR_IS_ASSIGNED;
 
-	if (itip_organizer_is_user (comp, comp_data->client))
+	if (itip_organizer_is_user (registry, comp, comp_data->client))
 		flags |= COMP_EDITOR_USER_ORG;
 
 	if (!e_cal_component_has_attendees (comp))
diff --git a/modules/calendar/e-task-shell-view-private.h b/modules/calendar/e-task-shell-view-private.h
index ec2173f..3af5a1c 100644
--- a/modules/calendar/e-task-shell-view-private.h
+++ b/modules/calendar/e-task-shell-view-private.h
@@ -38,14 +38,15 @@
 #include "shell/e-shell-utils.h"
 #include "misc/e-popup-action.h"
 #include "misc/e-selectable.h"
+#include "misc/e-source-config-dialog.h"
 
 #include "calendar/gui/calendar-config.h"
 #include "calendar/gui/comp-util.h"
 #include "calendar/gui/e-cal-component-preview.h"
 #include "calendar/gui/e-cal-model-tasks.h"
+#include "calendar/gui/e-cal-source-config.h"
 #include "calendar/gui/e-calendar-selector.h"
 #include "calendar/gui/print.h"
-#include "calendar/gui/dialogs/calendar-setup.h"
 #include "calendar/gui/dialogs/copy-source-dialog.h"
 #include "calendar/gui/dialogs/task-editor.h"
 
diff --git a/modules/calendar/e-task-shell-view.h b/modules/calendar/e-task-shell-view.h
index 853d90c..d756c10 100644
--- a/modules/calendar/e-task-shell-view.h
+++ b/modules/calendar/e-task-shell-view.h
@@ -23,7 +23,6 @@
 #define E_TASK_SHELL_VIEW_H
 
 #include <shell/e-shell-view.h>
-#include <libedataserver/e-source-list.h>
 
 /* Standard GObject macros */
 #define E_TYPE_TASK_SHELL_VIEW \
diff --git a/widgets/misc/Makefile.am b/widgets/misc/Makefile.am
index e8b89c5..f702ab3 100644
--- a/widgets/misc/Makefile.am
+++ b/widgets/misc/Makefile.am
@@ -8,6 +8,7 @@ widgetsinclude_HEADERS =			\
 	e-action-combo-box.h			\
 	e-activity-bar.h			\
 	e-activity-proxy.h			\
+	e-alarm-selector.h			\
 	e-alert-bar.h				\
 	e-attachment.h				\
 	e-attachment-button.h			\
@@ -98,6 +99,7 @@ libemiscwidgets_la_SOURCES =			\
 	e-action-combo-box.c			\
 	e-activity-bar.c			\
 	e-activity-proxy.c			\
+	e-alarm-selector.c			\
 	e-alert-bar.c				\
 	e-attachment.c				\
 	e-attachment-button.c			\
diff --git a/widgets/misc/e-alarm-selector.c b/widgets/misc/e-alarm-selector.c
new file mode 100644
index 0000000..0eeeba3
--- /dev/null
+++ b/widgets/misc/e-alarm-selector.c
@@ -0,0 +1,102 @@
+/*
+ * e-alarm-selector.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include "e-alarm-selector.h"
+
+#include <libecal/e-source-calendar.h>
+#include <libedataserver/e-source-alarms.h>
+
+G_DEFINE_TYPE (
+	EAlarmSelector,
+	e_alarm_selector,
+	E_TYPE_SOURCE_SELECTOR)
+
+static gboolean
+alarm_selector_get_source_selected (ESourceSelector *selector,
+                                    ESource *source)
+{
+	ESourceAlarms *extension;
+	const gchar *extension_name;
+
+	extension_name = e_source_selector_get_extension_name (selector);
+
+	/* Make sure this source is a calendar. */
+	if (!e_source_has_extension (source, extension_name))
+		return FALSE;
+
+	extension_name = E_SOURCE_EXTENSION_ALARMS;
+	extension = e_source_get_extension (source, extension_name);
+	g_return_val_if_fail (E_IS_SOURCE_ALARMS (extension), FALSE);
+
+	return e_source_alarms_get_include_me (extension);
+}
+
+static gboolean
+alarm_selector_set_source_selected (ESourceSelector *selector,
+                                    ESource *source,
+                                    gboolean selected)
+{
+	ESourceAlarms *extension;
+	const gchar *extension_name;
+
+	extension_name = e_source_selector_get_extension_name (selector);
+
+	/* Make sure this source is a calendar. */
+	if (!e_source_has_extension (source, extension_name))
+		return FALSE;
+
+	extension_name = E_SOURCE_EXTENSION_ALARMS;
+	extension = e_source_get_extension (source, extension_name);
+	g_return_val_if_fail (E_IS_SOURCE_ALARMS (extension), FALSE);
+
+	/* Avoid unnecessary signal emissions and disk writes. */
+	if (selected == e_source_alarms_get_include_me (extension))
+		return FALSE;
+
+	e_source_alarms_set_include_me (extension, selected);
+
+	return TRUE;
+}
+
+static void
+e_alarm_selector_class_init (EAlarmSelectorClass *class)
+{
+	ESourceSelectorClass *source_selector_class;
+
+	source_selector_class = E_SOURCE_SELECTOR_CLASS (class);
+	source_selector_class->get_source_selected =
+					alarm_selector_get_source_selected;
+	source_selector_class->set_source_selected =
+					alarm_selector_set_source_selected;
+}
+
+static void
+e_alarm_selector_init (EAlarmSelector *selector)
+{
+}
+
+GtkWidget *
+e_alarm_selector_new (ESourceRegistry *registry)
+{
+	g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL);
+
+	return g_object_new (
+		E_TYPE_ALARM_SELECTOR,
+		"extension-name", E_SOURCE_EXTENSION_CALENDAR,
+		"registry", registry, NULL);
+}
diff --git a/widgets/misc/e-alarm-selector.h b/widgets/misc/e-alarm-selector.h
new file mode 100644
index 0000000..2ad9c49
--- /dev/null
+++ b/widgets/misc/e-alarm-selector.h
@@ -0,0 +1,63 @@
+/*
+ * e-alarm-selector.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#ifndef E_ALARM_SELECTOR_H
+#define E_ALARM_SELECTOR_H
+
+#include <libedataserverui/e-source-selector.h>
+
+/* Standard GObject macros */
+#define E_TYPE_ALARM_SELECTOR \
+	(e_alarm_selector_get_type ())
+#define E_ALARM_SELECTOR(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_ALARM_SELECTOR, EAlarmSelector))
+#define E_ALARM_SELECTOR_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_ALARM_SELECTOR, EAlarmSelectorClass))
+#define E_IS_ALARM_SELECTOR(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_ALARM_SELECTOR))
+#define E_IS_ALARM_SELECTOR_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_ALARM_SELECTOR))
+#define E_ALARM_SELECTOR_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_ALARM_SELECTOR, EAlarmSelectorClass))
+
+G_BEGIN_DECLS
+
+typedef struct _EAlarmSelector EAlarmSelector;
+typedef struct _EAlarmSelectorClass EAlarmSelectorClass;
+typedef struct _EAlarmSelectorPrivate EAlarmSelectorPrivate;
+
+struct _EAlarmSelector {
+	ESourceSelector parent;
+	EAlarmSelectorPrivate *priv;
+};
+
+struct _EAlarmSelectorClass {
+	ESourceSelectorClass parent_class;
+};
+
+GType		e_alarm_selector_get_type	(void) G_GNUC_CONST;
+GtkWidget *	e_alarm_selector_new		(ESourceRegistry *registry);
+
+G_END_DECLS
+
+#endif /* E_ALARM_SELECTOR_H */



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