evolution r35942 - in branches/kill-bonobo: shell widgets/misc



Author: mbarnes
Date: Fri Aug  8 23:12:59 2008
New Revision: 35942
URL: http://svn.gnome.org/viewvc/evolution?rev=35942&view=rev

Log:
Work through more compilation errors.
Rewrite EMultiConfigDialog to not use ETable.


Modified:
   branches/kill-bonobo/shell/e-shell-importer.c
   branches/kill-bonobo/shell/e-shell-importer.h
   branches/kill-bonobo/shell/e-shell-module.c
   branches/kill-bonobo/shell/e-shell-module.h
   branches/kill-bonobo/shell/e-shell-registry.c
   branches/kill-bonobo/shell/e-shell-registry.h
   branches/kill-bonobo/shell/e-shell-settings-dialog.c
   branches/kill-bonobo/shell/e-shell-settings-dialog.h
   branches/kill-bonobo/shell/e-shell.c
   branches/kill-bonobo/shell/e-shell.h
   branches/kill-bonobo/shell/es-event.c
   branches/kill-bonobo/shell/es-event.h
   branches/kill-bonobo/shell/main.c
   branches/kill-bonobo/shell/shell.error.xml
   branches/kill-bonobo/widgets/misc/e-multi-config-dialog.c
   branches/kill-bonobo/widgets/misc/e-multi-config-dialog.h
   branches/kill-bonobo/widgets/misc/test-multi-config-dialog.c

Modified: branches/kill-bonobo/shell/e-shell-importer.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-importer.c	(original)
+++ branches/kill-bonobo/shell/e-shell-importer.c	Fri Aug  8 23:12:59 2008
@@ -85,7 +85,6 @@
 } ImportDialogImporterPage;
 
 typedef struct _ImportData {
-	EShell *shell;
 	EShellWindow *window;
 
 	GladeXML *wizard;
@@ -242,29 +241,6 @@
 	filename_changed(data->filepage->filename, data);
 }
 
-#if 0
-static int
-compare_info_name (const void *data1, const void  *data2)
-{
-	const Bonobo_ServerInfo *info1 = (Bonobo_ServerInfo *)data1;
-	const Bonobo_ServerInfo *info2 = (Bonobo_ServerInfo *)data2;
-	const char *name1 = get_name_from_component_info (info1);
-	const char *name2 = get_name_from_component_info (info2);
-
-	/* If we can't find a name for a plug-in, its iid will be used
-	 * for display. Put such plug-ins at the end of the list since
-	 * their displayed name won't be really user-friendly
-	 */
-	if (name1 == NULL) {
-		return -1;
-	}
-	if (name2 == NULL) {
-		return 1;
-	}
-	return g_utf8_collate (name1, name2);
-}
-#endif
-
 static ImportDialogFilePage *
 importer_file_page_new (ImportData *data)
 {
@@ -678,7 +654,6 @@
 
 	dialog_open = TRUE;
 	data->window = shell_window;
-	data->shell = e_shell_window_peek_shell (data->window);
 
 	gladefile = g_build_filename (EVOLUTION_GLADEDIR, "import.glade", NULL);
 	data->wizard = glade_xml_new (gladefile, NULL, NULL);

Modified: branches/kill-bonobo/shell/e-shell-importer.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-importer.h	(original)
+++ branches/kill-bonobo/shell/e-shell-importer.h	Fri Aug  8 23:12:59 2008
@@ -20,9 +20,16 @@
  * Author: Iain Holmes  <iain ximian com>
  */
 
-#ifndef _E_SHELL_IMPORTER_H_
-#define _E_SHELL_IMPORTER_H_
+#ifndef E_SHELL_IMPORTER_H
+#define E_SHELL_IMPORTER_H
 
-void  e_shell_importer_start_import  (EShellWindow *shell_window);
+#include "e-shell-common.h"
+#include "e-shell-window.h"
 
-#endif
+G_BEGIN_DECLS
+
+void		e_shell_importer_start_import	(EShellWindow *shell_window);
+
+G_END_DECLS
+
+#endif /* E_SHELL_IMPORTER_H */

Modified: branches/kill-bonobo/shell/e-shell-module.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-module.c	(original)
+++ branches/kill-bonobo/shell/e-shell-module.c	Fri Aug  8 23:12:59 2008
@@ -267,6 +267,19 @@
 	return TRUE;
 }
 
+gboolean
+e_shell_module_handle_uri (EShellModule *shell_module,
+                           const gchar *uri)
+{
+	g_return_val_if_fail (E_IS_SHELL_MODULE (shell_module), FALSE);
+	g_return_val_if_fail (uri != NULL, FALSE);
+
+	if (shell_module->priv->info.handle_uri != NULL)
+		return shell_module->priv->info.handle_uri (uri);
+
+	return FALSE;
+}
+
 void
 e_shell_module_send_and_receive (EShellModule *shell_module)
 {
@@ -296,7 +309,7 @@
 
 	shell_module->priv->info.sort_order = info->sort_order;
 	shell_module->priv->info.aliases = g_intern_string (info->aliases);
-	shell_module->priv->info.schemas = g_intern_string (info->schemas);
+	shell_module->priv->info.schemes = g_intern_string (info->schemes);
 	shell_module->priv->info.shell_view_type = info->shell_view_type;
 
 	shell_module->priv->info.is_busy = info->is_busy;

Modified: branches/kill-bonobo/shell/e-shell-module.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-module.h	(original)
+++ branches/kill-bonobo/shell/e-shell-module.h	Fri Aug  8 23:12:59 2008
@@ -53,11 +53,12 @@
 struct _EShellModuleInfo {
 	gint sort_order;
 	const gchar *aliases;   /* colon-separated list */
-	const gchar *schemas;   /* colon-separated list */
+	const gchar *schemes;   /* colon-separated list */
 	GType shell_view_type;  /* EShellView subclass  */
 
 	gboolean	(*is_busy)		(void);
 	gboolean	(*shutdown)		(void);
+	gboolean	(*handle_uri)		(const gchar *uri);
 	void		(*send_and_receive)	(void);
 	void		(*window_created)	(EShellWindow *window);
 };
@@ -79,6 +80,8 @@
 GType		e_shell_module_get_view_type	(EShellModule *shell_module);
 gboolean	e_shell_module_is_busy		(EShellModule *shell_module);
 gboolean	e_shell_module_shutdown		(EShellModule *shell_module);
+gboolean	e_shell_module_handle_uri	(EShellModule *shell_module,
+						 const gchar *uri);
 void		e_shell_module_send_and_receive	(EShellModule *shell_module);
 void		e_shell_module_window_created	(EShellModule *shell_module,
 						 EShellWindow *shell_window);

Modified: branches/kill-bonobo/shell/e-shell-registry.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-registry.c	(original)
+++ branches/kill-bonobo/shell/e-shell-registry.c	Fri Aug  8 23:12:59 2008
@@ -22,7 +22,7 @@
 
 static GList *loaded_modules;
 static GHashTable *modules_by_name;
-static GHashTable *modules_by_schema;
+static GHashTable *modules_by_scheme;
 
 static void
 shell_registry_insert_items (GHashTable *hash_table,
@@ -77,9 +77,9 @@
 		shell_registry_insert_items (
 			modules_by_name, string, shell_module);
 
-	if ((string = info->schemas) != NULL)
+	if ((string = info->schemes) != NULL)
 		shell_registry_insert_items (
-			modules_by_schema, string, shell_module);
+			modules_by_scheme, string, shell_module);
 }
 
 void
@@ -93,7 +93,7 @@
 	g_return_if_fail (loaded_modules == NULL);
 
 	modules_by_name = g_hash_table_new (g_str_hash, g_str_equal);
-	modules_by_schema = g_hash_table_new (g_str_hash, g_str_equal);
+	modules_by_scheme = g_hash_table_new (g_str_hash, g_str_equal);
 
 	dirname = EVOLUTION_MODULEDIR;
 
@@ -161,9 +161,9 @@
 }
 
 EShellModule *
-e_shell_registry_get_module_by_schema (const gchar *schema)
+e_shell_registry_get_module_by_scheme (const gchar *scheme)
 {
-	g_return_val_if_fail (schema != NULL, NULL);
+	g_return_val_if_fail (scheme != NULL, NULL);
 
-	return g_hash_table_lookup (modules_by_schema, schema);
+	return g_hash_table_lookup (modules_by_scheme, scheme);
 }

Modified: branches/kill-bonobo/shell/e-shell-registry.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-registry.h	(original)
+++ branches/kill-bonobo/shell/e-shell-registry.h	Fri Aug  8 23:12:59 2008
@@ -30,7 +30,7 @@
 GList *		e_shell_registry_list_modules		(void);
 GType *		e_shell_registry_get_view_types		(guint *n_types);
 EShellModule *	e_shell_registry_get_module_by_name	(const gchar *name);
-EShellModule *	e_shell_registry_get_module_by_schema	(const gchar *schema);
+EShellModule *	e_shell_registry_get_module_by_scheme	(const gchar *scheme);
 
 G_END_DECLS
 

Modified: branches/kill-bonobo/shell/e-shell-settings-dialog.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-settings-dialog.c	(original)
+++ branches/kill-bonobo/shell/e-shell-settings-dialog.c	Fri Aug  8 23:12:59 2008
@@ -30,7 +30,6 @@
 #include "e-shell-settings-dialog.h"
 
 #include "e-corba-config-page.h"
-#include <e-util/e-icon-factory.h>
 
 #include <bonobo/bonobo-widget.h>
 #include <bonobo/bonobo-exception.h>
@@ -40,48 +39,21 @@
 #include <stdlib.h>
 #include <string.h>
 
+#define E_SHELL_SETTINGS_DIALOG_GET_PRIVATE(obj) \
+	(G_TYPE_INSTANCE_GET_PRIVATE \
+	((obj), E_TYPE_SHELL_SETTINGS_DIALOG, EShellSettingsDialogPrivate))
+
 struct _EShellSettingsDialogPrivate {
 	GHashTable *types;
 };
 
-G_DEFINE_TYPE (EShellSettingsDialog, e_shell_settings_dialog, E_TYPE_MULTI_CONFIG_DIALOG)
-
-
-/* FIXME ugly hack to work around that sizing of invisible widgets is broken
-   with Bonobo.  */
-
-static void
-set_dialog_size (EShellSettingsDialog *dialog)
-{
-	PangoLayout *layout;
-	PangoContext *context;
-	PangoFontMetrics *metrics;
-	int width, height;
-
-	layout = gtk_widget_create_pango_layout (GTK_WIDGET (dialog), "M");
-	context = pango_layout_get_context (layout);
-	metrics = pango_context_get_metrics (context,
-					     gtk_widget_get_style (GTK_WIDGET (dialog))->font_desc,
-					     pango_context_get_language (context));
-
-	pango_layout_get_pixel_size (layout, &width, NULL);
-
-	width *= 60;
-	height = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics)
-			       + pango_font_metrics_get_descent (metrics)) * 30;
-
-	gtk_window_set_default_size((GtkWindow *)dialog, width, height);
-	g_object_unref (layout);
-	pango_font_metrics_unref (metrics);
-}
+static gpointer parent_class;
 
-
 /* Page handling.  */
 
 struct _Page {
-	char *title;
-	char *description;
-	GdkPixbuf *icon;
+	char *caption;
+	char *icon_name;
 	Bonobo_ActivationProperty *type;
 	int priority;
 	EConfigPage *page_widget;
@@ -89,22 +61,17 @@
 typedef struct _Page Page;
 
 static Page *
-page_new (const char *title,
-	  const char *description,
-	  GdkPixbuf *icon,
+page_new (const char *caption,
+	  const char *icon_name,
 	  Bonobo_ActivationProperty *type,
 	  int priority,
 	  EConfigPage *page_widget)
 {
 	Page *page;
 
-	if (icon != NULL)
-		g_object_ref (icon);
-
 	page = g_new (Page, 1);
-	page->title       = g_strdup (title);
-	page->description = g_strdup (description);
-	page->icon        = icon;
+	page->caption     = g_strdup (caption);
+	page->icon_name   = g_strdup (icon_name);;
 	page->type        = type;
 	page->priority    = priority;
 	page->page_widget = page_widget;
@@ -115,35 +82,25 @@
 static void
 page_free (Page *page)
 {
-	g_free (page->title);
-	g_free (page->description);
-
-	if (page->icon != NULL)
-		g_object_unref (page->icon);
-
+	g_free (page->caption);
+	g_free (page->icon_name);
 	g_free (page);
 }
 
-static int
-compare_page_func (const void *a,
-		   const void *b)
+static gint
+compare_page_func (const Page *a,
+		   const Page *b)
 {
-	const Page *page_a;
-	const Page *page_b;
-
-	page_a = (const Page *) a;
-	page_b = (const Page *) b;
-
-	if (page_a->priority == page_b->priority)
-		return strcmp (page_a->title, page_b->title);
+	if (a->priority == b->priority)
+		return strcmp (a->caption, b->caption);
 
-	return page_a->priority - page_b->priority;
+	return a->priority - b->priority;
 }
 
 static GList *
 sort_page_list (GList *list)
 {
-	return g_list_sort (list, compare_page_func);
+	return g_list_sort (list, (GCompareFunc) compare_page_func);
 }
 
 static void
@@ -179,34 +136,21 @@
 	for (i = 0; i < control_list->_length; i ++) {
 		CORBA_Object corba_object;
 		Bonobo_ServerInfo *info;
-		const char *title;
-		const char *description;
-		const char *icon_path;
+		const char *caption;
+		const char *icon_name;
 		const char *priority_string;
 		Bonobo_ActivationProperty *type;
 		int priority;
-		GdkPixbuf *icon;
 
 		CORBA_exception_init (&ev);
 
 		info = & control_list->_buffer[i];
 
-		title       	= bonobo_server_info_prop_lookup (info, "evolution2:config_item:title", languages);
-		description 	= bonobo_server_info_prop_lookup (info, "evolution2:config_item:description", languages);
-		icon_path   	= bonobo_server_info_prop_lookup (info, "evolution2:config_item:icon_name", NULL);
+		caption       	= bonobo_server_info_prop_lookup (info, "evolution2:config_item:title", languages);
+		icon_name   	= bonobo_server_info_prop_lookup (info, "evolution2:config_item:icon_name", NULL);
 		type            = bonobo_server_info_prop_find   (info, "evolution2:config_item:type");
 		priority_string = bonobo_server_info_prop_lookup (info, "evolution2:config_item:priority", NULL);
 
-		if (icon_path == NULL) {
-			icon = NULL;
-		} else {
-			if (g_path_is_absolute (icon_path)) {
-				icon = gdk_pixbuf_new_from_file (icon_path, NULL);
-			} else {
-				icon = e_icon_factory_get_icon (icon_path, E_ICON_SIZE_DIALOG);
-			}
-		}
-
 		if (type != NULL && type->v._d != Bonobo_ACTIVATION_P_STRINGV)
 			type = NULL;
 		if (priority_string == NULL)
@@ -219,7 +163,7 @@
 		if (! BONOBO_EX (&ev)) {
 			Page *page;
 
-			page = page_new (title, description, icon, type, priority,
+			page = page_new (caption, icon_name, type, priority,
 					 E_CONFIG_PAGE (e_corba_config_page_new_from_objref (corba_object)));
 
 			page_list = g_list_prepend (page_list, page);
@@ -229,9 +173,6 @@
 			g_free (bonobo_ex_text);
 		}
 
-		if (icon != NULL)
-			g_object_unref (icon);
-
 		CORBA_exception_free (&ev);
 	}
 	g_slist_free(languages);
@@ -243,9 +184,8 @@
 		page = (Page *) p->data;
 
 		e_multi_config_dialog_add_page (E_MULTI_CONFIG_DIALOG (dialog),
-						page->title,
-						page->description,
-						page->icon,
+						page->caption,
+						page->icon_name,
 						page->page_widget);
 
 		if (page->type != NULL) {
@@ -266,74 +206,88 @@
 	CORBA_free (control_list);
 }
 
-
-/* GtkObject methods.  */
-
 static void
-impl_finalize (GObject *object)
+shell_settings_dialog_finalize (GObject *object)
 {
-	EShellSettingsDialog *dialog;
 	EShellSettingsDialogPrivate *priv;
 
-	dialog = E_SHELL_SETTINGS_DIALOG (object);
-	priv = dialog->priv;
+	priv = E_SHELL_SETTINGS_DIALOG_GET_PRIVATE (object);
 
 	g_hash_table_destroy (priv->types);
 
-	g_free (priv);
-
-	(* G_OBJECT_CLASS (e_shell_settings_dialog_parent_class)->finalize) (object);
+	/* Chain up to parent's finalize() method. */
+	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-
 static void
-e_shell_settings_dialog_class_init (EShellSettingsDialogClass *klass)
+shell_settings_dialog_class_init (EShellSettingsDialogClass *class)
 {
 	GObjectClass *object_class;
 
-	object_class = G_OBJECT_CLASS (klass);
-	object_class->finalize = impl_finalize;
+	parent_class = g_type_class_peek_parent (class);
+	g_type_class_add_private (class, sizeof (EShellSettingsDialogPrivate));
+
+	object_class = G_OBJECT_CLASS (class);
+	object_class->finalize = shell_settings_dialog_finalize;
 }
 
 static void
-e_shell_settings_dialog_init (EShellSettingsDialog *dialog)
+shell_settings_dialog_init (EShellSettingsDialog *dialog)
 {
-	EShellSettingsDialogPrivate *priv;
+	dialog->priv = E_SHELL_SETTINGS_DIALOG_GET_PRIVATE (dialog);
 
-	priv = g_new (EShellSettingsDialogPrivate, 1);
-	priv->types = g_hash_table_new_full (
+	dialog->priv->types = g_hash_table_new_full (
 		g_str_hash, g_str_equal,
 		(GDestroyNotify) g_free,
 		(GDestroyNotify) NULL);
 
-	dialog->priv = priv;
-
 	load_pages (dialog);
-	set_dialog_size (dialog);
 
 	gtk_window_set_title (GTK_WINDOW (dialog), _("Evolution Preferences"));
 	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 }
 
-
-GtkWidget *
-e_shell_settings_dialog_new (void)
+GType
+e_shell_settings_dialog_get_type (void)
 {
-	EShellSettingsDialog *new;
+	static GType type = 0;
 
-	new = g_object_new (e_shell_settings_dialog_get_type (), NULL);
+	if (G_UNLIKELY (type == 0)) {
+		const GTypeInfo type_info = {
+			sizeof (EShellSettingsDialogClass),
+			(GBaseInitFunc) NULL,
+			(GBaseFinalizeFunc) NULL,
+			(GClassInitFunc) shell_settings_dialog_class_init,
+			(GClassFinalizeFunc) NULL,
+			NULL,  /* class_data */
+			sizeof (EShellSettingsDialog),
+			0,     /* n_preallocs */
+			(GInstanceInitFunc) shell_settings_dialog_init,
+			NULL   /* value_table */
+		};
+
+		type = g_type_register_static (
+			E_TYPE_MULTI_CONFIG_DIALOG, "EShellSettingsDialog",
+			&type_info, 0);
+	}
 
-	return GTK_WIDGET (new);
+	return type;
+}
+
+GtkWidget *
+e_shell_settings_dialog_new (void)
+{
+	return g_object_new (E_TYPE_SHELL_SETTINGS_DIALOG, NULL);
 }
 
 void
-e_shell_settings_dialog_show_type (EShellSettingsDialog *dialog, const char *type)
+e_shell_settings_dialog_show_type (EShellSettingsDialog *dialog,
+                                   const gchar *type)
 {
 	EShellSettingsDialogPrivate *priv;
 	gpointer key, value;
 	int page;
 
-	g_return_if_fail (dialog != NULL);
 	g_return_if_fail (E_IS_SHELL_SETTINGS_DIALOG (dialog));
 	g_return_if_fail (type != NULL);
 
@@ -350,9 +304,7 @@
 		} else
 			value = NULL;
 	}
-	page = GPOINTER_TO_INT (value);
 
+	page = GPOINTER_TO_INT (value);
 	e_multi_config_dialog_show_page (E_MULTI_CONFIG_DIALOG (dialog), page);
 }
-
-

Modified: branches/kill-bonobo/shell/e-shell-settings-dialog.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-settings-dialog.h	(original)
+++ branches/kill-bonobo/shell/e-shell-settings-dialog.h	Fri Aug  8 23:12:59 2008
@@ -17,34 +17,40 @@
  * License along with this program; if not, write to the
  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
- *
- * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#ifndef _E_SHELL_SETTINGS_DIALOG_H_
-#define _E_SHELL_SETTINGS_DIALOG_H_
+#ifndef E_SHELL_SETTINGS_DIALOG_H
+#define E_SHELL_SETTINGS_DIALOG_H
 
 #include "e-multi-config-dialog.h"
 
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_SHELL_SETTINGS_DIALOG			(e_shell_settings_dialog_get_type ())
-#define E_SHELL_SETTINGS_DIALOG(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SHELL_SETTINGS_DIALOG, EShellSettingsDialog))
-#define E_SHELL_SETTINGS_DIALOG_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SHELL_SETTINGS_DIALOG, EShellSettingsDialogClass))
-#define E_IS_SHELL_SETTINGS_DIALOG(obj)			(G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SHELL_SETTINGS_DIALOG))
-#define E_IS_SHELL_SETTINGS_DIALOG_CLASS(klass)		(G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SHELL_SETTINGS_DIALOG))
+G_BEGIN_DECLS
 
-
-typedef struct _EShellSettingsDialog        EShellSettingsDialog;
+/* Standard GObject macros */
+#define E_TYPE_SHELL_SETTINGS_DIALOG \
+	(e_shell_settings_dialog_get_type ())
+#define E_SHELL_SETTINGS_DIALOG(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_SHELL_SETTINGS_DIALOG, EShellSettingsDialog))
+#define E_SHELL_SETTINGS_DIALOG_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_SHELL_SETTINGS_DIALOG, EShellSettingsDialogClass))
+#define E_IS_SHELL_SETTINGS_DIALOG(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_SHELL_SETTINGS_DIALOG))
+#define E_IS_SHELL_SETTINGS_DIALOG_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_SHELL_SETTINGS_DIALOG))
+#define E_SHELL_SETTINGS_DIALOG_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_SHELL_SETTINGS_DIALOG, EShellSettingsDialogClass))
+
+typedef struct _EShellSettingsDialog EShellSettingsDialog;
+typedef struct _EShellSettingsDialogClass EShellSettingsDialogClass;
 typedef struct _EShellSettingsDialogPrivate EShellSettingsDialogPrivate;
-typedef struct _EShellSettingsDialogClass   EShellSettingsDialogClass;
 
 struct _EShellSettingsDialog {
 	EMultiConfigDialog parent;
-
 	EShellSettingsDialogPrivate *priv;
 };
 
@@ -52,14 +58,12 @@
 	EMultiConfigDialogClass parent_class;
 };
 
-
-GType      e_shell_settings_dialog_get_type  (void);
-GtkWidget *e_shell_settings_dialog_new       (void);
-void       e_shell_settings_dialog_show_type (EShellSettingsDialog *dialog,
-					      const char           *type);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+GType		e_shell_settings_dialog_get_type(void);
+GtkWidget *	e_shell_settings_dialog_new	(void);
+void		e_shell_settings_dialog_show_type
+						(EShellSettingsDialog *dialog,
+						 const gchar *type);
+
+G_END_DECLS
 
-#endif /* _E_SHELL_SETTINGS_DIALOG_H_ */
+#endif /* E_SHELL_SETTINGS_DIALOG_H */

Modified: branches/kill-bonobo/shell/e-shell.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell.c	(original)
+++ branches/kill-bonobo/shell/e-shell.c	Fri Aug  8 23:12:59 2008
@@ -24,10 +24,12 @@
 
 #include "e-shell-module.h"
 #include "e-shell-registry.h"
+#include "e-shell-settings-dialog.h"
 
 #define SHUTDOWN_TIMEOUT	500  /* milliseconds */
 
 static GList *active_windows;
+static GtkWidget *preferences;
 
 static gboolean
 shell_window_delete_event_cb (EShellWindow *shell_window)
@@ -121,3 +123,55 @@
 
 	return E_SHELL_WINDOW (shell_window);
 }
+
+gboolean
+e_shell_handle_uri (const gchar *uri)
+{
+	EShellModule *shell_module;
+	GFile *file;
+	gchar *scheme;
+
+	g_return_val_if_fail (uri != NULL, FALSE);
+
+	file = g_file_new_for_uri (uri);
+	scheme = g_file_get_uri_scheme (file);
+	g_object_unref (file);
+
+	if (scheme == NULL)
+		return FALSE;
+
+	shell_module = e_shell_registry_get_module_by_scheme (scheme);
+
+	/* Scheme lookup failed so try looking up the shell module by
+	 * name.  Note, we only open a shell window if the URI refers
+	 * to a shell module by name, not by scheme. */
+	if (shell_module == NULL) {
+		EShellWindow *shell_window;
+
+		shell_module = e_shell_registry_get_module_by_name (scheme);
+
+		if (shell_module == NULL)
+			return FALSE;
+
+		shell_window = e_shell_create_window ();
+		/* FIXME  Set window to appropriate view. */
+	}
+
+	return e_shell_module_handle_uri (shell_module, uri);
+}
+
+void
+e_shell_show_preferences (GtkWindow *parent)
+{
+	if (preferences != NULL) {
+		gtk_window_present (GTK_WINDOW (preferences));
+		return;
+	}
+
+	preferences = e_shell_settings_dialog_new ();
+	/* FIXME e_shell_settings_dialog_show_type (...); */
+
+	gtk_window_set_transient_for (GTK_WINDOW (preferences), parent);
+	gtk_window_set_destroy_with_parent (GTK_WINDOW (preferences), TRUE);
+	gtk_widget_show (preferences);
+}

Modified: branches/kill-bonobo/shell/e-shell.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell.h	(original)
+++ branches/kill-bonobo/shell/e-shell.h	Fri Aug  8 23:12:59 2008
@@ -43,6 +43,7 @@
 };
 
 EShellWindow *	e_shell_create_window		(void);
+gboolean	e_shell_handle_uri		(const gchar *uri);
 void		e_shell_send_receive		(GtkWindow *parent);
 void		e_shell_show_preferences	(GtkWindow *parent);
 void		e_shell_go_offline		(void);

Modified: branches/kill-bonobo/shell/es-event.c
==============================================================================
--- branches/kill-bonobo/shell/es-event.c	(original)
+++ branches/kill-bonobo/shell/es-event.c	Fri Aug  8 23:12:59 2008
@@ -112,6 +112,14 @@
 	return es_event;
 }
 
+ESEventTargetShell *
+es_event_target_new (ESEvent *eme)
+{
+	return e_event_target_new (
+		&eme->event, ES_EVENT_TARGET_SHELL,
+		sizeof (ESEventTargetShell));
+}
+
 ESEventTargetState *
 es_event_target_new_state(ESEvent *eme, int state)
 {
@@ -130,16 +138,6 @@
 	return t;
 }
 
-ESEventTargetShell *
-es_event_target_new_shell(ESEvent *eme, EShell *shell)
-{
-	ESEventTargetShell *t = e_event_target_new(&eme->event, ES_EVENT_TARGET_SHELL, sizeof(*t));
-
-	t->shell = shell;
-
-	return t;
-}
-
 ESEventTargetUpgrade *
 es_event_target_new_upgrade(ESEvent *eme, int major, int minor, int revision)
 {

Modified: branches/kill-bonobo/shell/es-event.h
==============================================================================
--- branches/kill-bonobo/shell/es-event.h	(original)
+++ branches/kill-bonobo/shell/es-event.h	Fri Aug  8 23:12:59 2008
@@ -27,12 +27,7 @@
 
 #include "e-util/e-event.h"
 
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-struct _EShell;  /* Avoid including "e-shell.h" */
+G_BEGIN_DECLS
 
 typedef struct _ESEvent ESEvent;
 typedef struct _ESEventClass ESEventClass;
@@ -58,8 +53,6 @@
 
 struct _ESEventTargetShell {
 	EEventTarget target;
-
-	struct _EShell *shell;
 };
 
 struct _ESEventTargetState {
@@ -99,8 +92,8 @@
 
 ESEvent *es_event_peek(void);
 
+ESEventTargetShell *es_event_target_new(ESEvent *eme);
 ESEventTargetState *es_event_target_new_state(ESEvent *emp, int state);
-ESEventTargetShell *es_event_target_new_shell(ESEvent *eme, struct _EShell *shell);
 ESEventTargetUpgrade *es_event_target_new_upgrade(ESEvent *emp, int major, int minor, int revision);
 ESEventTargetComponent *es_event_target_new_component(ESEvent *eme, const char *id);
 
@@ -119,8 +112,6 @@
 
 GType es_event_hook_get_type(void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __ES_EVENT_H__ */

Modified: branches/kill-bonobo/shell/main.c
==============================================================================
--- branches/kill-bonobo/shell/main.c	(original)
+++ branches/kill-bonobo/shell/main.c	Fri Aug  8 23:12:59 2008
@@ -56,8 +56,6 @@
 #include <libgnomeui/gnome-ui-init.h>
 #include <libgnomeui/gnome-client.h>
 
-#include <bonobo/bonobo-main.h>
-#include <bonobo/bonobo-moniker-util.h>
 #include <bonobo/bonobo-exception.h>
 
 #include <bonobo-activation/bonobo-activation.h>
@@ -92,9 +90,6 @@
 #define RECOVERY_KEY \
 	"/apps/evolution/shell/recovery"
 
-
-static EShell *shell = NULL;
-
 /* Command-line options.  */
 static gboolean start_online = FALSE;
 static gboolean start_offline = FALSE;
@@ -111,21 +106,6 @@
 static char *evolution_debug_log = NULL;
 static gchar **remaining_args;
 
-static void
-no_windows_left_cb (EShell *shell, gpointer data)
-{
-	bonobo_object_unref (BONOBO_OBJECT (shell));
-	bonobo_main_quit ();
-}
-
-static void
-shell_weak_notify (void *data,
-		   GObject *where_the_object_was)
-{
-	bonobo_main_quit ();
-}
-
-
 #ifdef KILL_PROCESS_CMD
 
 static void
@@ -352,25 +332,15 @@
 }
 
 static void
-open_uris (GNOME_Evolution_Shell corba_shell, gchar **uris)
+open_uris (gchar **uris)
 {
-	CORBA_Environment ev;
-	guint n_uris, ii;
+	guint ii;
 
 	g_return_if_fail (uris != NULL);
-	n_uris = g_strv_length (uris);
-
-	CORBA_exception_init (&ev);
 
-	for (ii = 0; ii < n_uris; ii++) {
-		GNOME_Evolution_Shell_handleURI (corba_shell, uris[ii], &ev);
-		if (ev._major != CORBA_NO_EXCEPTION) {
+	for (ii = 0; uris[ii] != NULL; ii++)
+		if (!e_shell_handle_uri (uris[ii]))
 			g_warning ("Invalid URI: %s", uris[ii]);
-			CORBA_exception_free (&ev);
-		}
-	}
-
-	CORBA_exception_free (&ev);
 }
 
 /* This is for doing stuff that requires the GTK+ loop to be running already.  */
@@ -378,9 +348,6 @@
 static gboolean
 idle_cb (gchar **uris)
 {
-	GNOME_Evolution_Shell corba_shell;
-	CORBA_Environment ev;
-	EShellConstructResult result;
 	EShellStartupLineMode startup_line_mode;
 
 	g_return_val_if_fail (uris == NULL || g_strv_length (uris) > 0, FALSE);
@@ -389,8 +356,6 @@
 	kill_old_dataserver ();
 #endif
 
-	CORBA_exception_init (&ev);
-
 	if (! start_online && ! start_offline)
 		startup_line_mode = E_SHELL_STARTUP_LINE_MODE_CONFIG;
 	else if (start_online)
@@ -398,93 +363,51 @@
 	else
 		startup_line_mode = E_SHELL_STARTUP_LINE_MODE_OFFLINE;
 
-	shell = e_shell_new (startup_line_mode, &result);
-
-	switch (result) {
-	case E_SHELL_CONSTRUCT_RESULT_OK:
-		g_signal_connect (shell, "no_windows_left", G_CALLBACK (no_windows_left_cb), NULL);
-		g_object_weak_ref (G_OBJECT (shell), shell_weak_notify, NULL);
-		corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell));
-		corba_shell = CORBA_Object_duplicate (corba_shell, &ev);
-		break;
-
-	case E_SHELL_CONSTRUCT_RESULT_CANNOTREGISTER:
-		corba_shell = bonobo_activation_activate_from_id (E_SHELL_OAFIID, 0, NULL, &ev);
-		if (ev._major != CORBA_NO_EXCEPTION || corba_shell == CORBA_OBJECT_NIL) {
-			e_error_run(NULL, "shell:noshell", NULL);
-			CORBA_exception_free (&ev);
-			bonobo_main_quit ();
-			return FALSE;
-		}
-		break;
+	/* FIXME Do something with startup_line_mode. */
 
-	default:
-		e_error_run(NULL, "shell:noshell-reason",
-			    e_shell_construct_result_to_string(result), NULL);
-		CORBA_exception_free (&ev);
-		bonobo_main_quit ();
-		return FALSE;
-
-	}
+	if (uris != NULL)
+		open_uris (uris);
+	else {
+		EShellWindow *shell_window;
+		GConfClient *client = gconf_client_get_default ();
+		
+		if (gconf_client_get_bool (client, RECOVERY_KEY, NULL) && e_file_lock_exists ()) {
+			/* It should have crashed last time or a force-shutdown */
+			gboolean skip = gconf_client_get_bool (client, SKIP_RECOVERY_DIALOG_KEY, NULL);
+			gboolean recover = TRUE;
+			if (!skip){
+				int flags = show_recovery_warning ();
 
-	if (shell != NULL) {
-		if (uris != NULL)
-			open_uris (corba_shell, uris);
-		else {
-			GConfClient *client = gconf_client_get_default ();
-			
-			if (gconf_client_get_bool (client, RECOVERY_KEY, NULL) && e_file_lock_exists ()) {
-				/* It should have crashed last time or a force-shutdown */
-				gboolean skip = gconf_client_get_bool (client, SKIP_RECOVERY_DIALOG_KEY, NULL);
-				gboolean recover = TRUE;
-				if (!skip){
-					int flags = show_recovery_warning ();
-
-					gconf_client_set_bool (client, SKIP_RECOVERY_DIALOG_KEY, (flags & (1<<2)) ? TRUE : FALSE, NULL);
-					recover = (flags & (1<<1)) ? TRUE: FALSE;
-				}
-
-				if (recover) {
-					/* Disable the previews */
-					gconf_client_set_bool (client, "/apps/evolution/mail/display/show_preview", FALSE, NULL);
-					gconf_client_set_bool (client, "/apps/evolution/mail/display/safe_list", TRUE, NULL);
-					gconf_client_set_bool (client, "/apps/evolution/addressbook/display/show_preview", FALSE, NULL);
-					gconf_client_set_bool (client, "/apps/evolution/calendar/display/show_task_preview", FALSE, NULL);
-				}
-				/* Let us not delete and recreate a lock, instead reuse it. We don't use timestamps anyways */
-			} else {
-				/* What great can we do, if lock creation fails ?*/
-				e_file_lock_create ();
+				gconf_client_set_bool (client, SKIP_RECOVERY_DIALOG_KEY, (flags & (1<<2)) ? TRUE : FALSE, NULL);
+				recover = (flags & (1<<1)) ? TRUE: FALSE;
 			}
-			g_object_unref (client);
 
-			e_shell_create_window (shell, default_component_id);
+			if (recover) {
+				/* Disable the previews */
+				gconf_client_set_bool (client, "/apps/evolution/mail/display/show_preview", FALSE, NULL);
+				gconf_client_set_bool (client, "/apps/evolution/mail/display/safe_list", TRUE, NULL);
+				gconf_client_set_bool (client, "/apps/evolution/addressbook/display/show_preview", FALSE, NULL);
+				gconf_client_set_bool (client, "/apps/evolution/calendar/display/show_task_preview", FALSE, NULL);
+			}
+			/* Let us not delete and recreate a lock, instead reuse it. We don't use timestamps anyways */
+		} else {
+			/* What great can we do, if lock creation fails ?*/
+			e_file_lock_create ();
 		}
-	} else {
-		CORBA_Environment ev;
-
-		CORBA_exception_init (&ev);
-		if (uris != NULL)
-			open_uris (corba_shell, uris);
-		else
-			if (default_component_id == NULL)
-				GNOME_Evolution_Shell_createNewWindow (corba_shell, "", &ev);
-			else
-				GNOME_Evolution_Shell_createNewWindow (corba_shell, default_component_id, &ev);
+		g_object_unref (client);
 
-		CORBA_exception_free (&ev);
+		shell_window = e_shell_create_window ();
+		/* XXX Switch to default_component_id. */
 	}
 
-	CORBA_Object_release (corba_shell, &ev);
-
-	CORBA_exception_free (&ev);
-
+#if 0  /* MBARNES */
 	if (shell == NULL) {
 		/*there is another instance but because we don't open any windows
 		we must notify the startup was complete manually*/
 		gdk_notify_startup_complete ();
 		bonobo_main_quit ();
 	}
+#endif
 
 	return FALSE;
 }
@@ -547,15 +470,20 @@
 #endif
 
 static gint
-gnome_master_client_save_yourself_cb (GnomeClient *client, GnomeSaveStyle save_style, gint shutdown, GnomeInteractStyle interact_style, gint fast, gpointer user_data)
+gnome_master_client_save_yourself_cb (GnomeClient *client,
+                                      GnomeSaveStyle save_style,
+                                      gint shutdown,
+                                      GnomeInteractStyle interact_style,
+                                      gint fast,
+                                      gpointer user_data)
 {
-	return !shell || e_shell_can_quit (shell);
+	return !e_shell_is_busy ();
 }
 
 static void
 gnome_master_client_die_cb (GnomeClient *client)
 {
-	e_shell_do_quit (shell);
+	e_shell_do_quit ();
 }
 
 static const GOptionEntry options[] = {
@@ -627,15 +555,6 @@
 
 	g_free (path);
 
-	/* Set BONOBO_ACTIVATION_PATH */
-	if (g_getenv ("BONOBO_ACTIVATION_PATH" ) == NULL) {
-		path = g_build_filename (top_folder_utf8,
-					 "lib/bonobo/servers",
-					 NULL);
-		if (!g_setenv ("BONOBO_ACTIVATION_PATH", path, TRUE))
-			g_warning ("Could not set BONOBO_ACTIVATION_PATH");
-		g_free (path);
-	}
 	g_free (top_folder_utf8);
 }
 #endif
@@ -780,7 +699,7 @@
 #endif
 	g_object_unref (client);
 
-	bonobo_main ();
+	gtk_main ();
 
 	e_icon_factory_shutdown ();
 	g_object_unref (program);

Modified: branches/kill-bonobo/shell/shell.error.xml
==============================================================================
--- branches/kill-bonobo/shell/shell.error.xml	(original)
+++ branches/kill-bonobo/shell/shell.error.xml	Fri Aug  8 23:12:59 2008
@@ -51,28 +51,6 @@
   <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
  </error>
 
- <error id="noshell" type="error">
-  <title>Cannot start Evolution</title>
-  <_primary>Evolution can not start.</_primary>
-  <_secondary xml:space="preserve">Your system configuration does not match your Evolution configuration.
-
-Click help for details</_secondary>
-  <help uri="http://go-evolution.org/FAQ#What_does_.22Your_system_configuration_does_not_match_your_Evolution_configuration.22_mean.3F"/>
-  <button stock="gtk-quit" response="GTK_RESPONSE_CANCEL"/>
- </error>
-
- <error id="noshell-reason" type="error">
-  <title>Cannot start Evolution</title>
-  <_primary>Evolution can not start.</_primary>
-  <_secondary xml:space="preserve">Your system configuration does not match your Evolution configuration:
-
-{0}
-
-Click help for details.</_secondary>
-  <help uri="http://go-evolution.org/FAQ#What_does_.22Your_system_configuration_does_not_match_your_Evolution_configuration.22_mean.3F"/>
-  <button stock="gtk-quit" response="GTK_RESPONSE_CANCEL"/>
- </error>
-
  <error id="forget-passwords" type="question" default="GTK_RESPONSE_CANCEL">
   <_primary>Are you sure you want to forget all remembered passwords?</_primary>
   <_secondary xml:space="preserve">Forgetting your passwords will clear all remembered passwords. You will be reprompted next time they are needed.</_secondary>

Modified: branches/kill-bonobo/widgets/misc/e-multi-config-dialog.c
==============================================================================
--- branches/kill-bonobo/widgets/misc/e-multi-config-dialog.c	(original)
+++ branches/kill-bonobo/widgets/misc/e-multi-config-dialog.c	Fri Aug  8 23:12:59 2008
@@ -16,69 +16,33 @@
  * License along with this program; if not, write to the
  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
- *
- * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include "e-multi-config-dialog.h"
 
-#include <table/e-table-scrolled.h>
-#include <table/e-table-memory-store.h>
-#include <table/e-cell-pixbuf.h>
-#include <table/e-cell-vbox.h>
-#include <table/e-cell-text.h>
-
 #include <libgnome/gnome-help.h>
 
 #define SWITCH_PAGE_INTERVAL 250
 
-struct _EMultiConfigDialogPrivate {
-	GSList *pages;
-
-	GtkWidget *list_e_table;
-	ETableModel *list_e_table_model;
+#define E_MULTI_CONFIG_DIALOG_GET_PRIVATE(obj) \
+	(G_TYPE_INSTANCE_GET_PRIVATE \
+	((obj), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialogPrivate))
 
+struct _EMultiConfigDialogPrivate {
+	GtkWidget *icon_view;
 	GtkWidget *notebook;
-
-	int set_page_timeout_id;
-	int set_page_timeout_page;
+	guint timeout_id;
 };
 
-G_DEFINE_TYPE (EMultiConfigDialog, e_multi_config_dialog, GTK_TYPE_DIALOG)
-
-
-/* ETable stuff.  */
-
-static char *list_e_table_spec =
-	"<ETableSpecification cursor-mode=\"line\""
-	"		      selection-mode=\"browse\""
-	"                     no-headers=\"true\""
-        "                     alternating-row-colors=\"false\""
-        "                     horizontal-resize=\"true\""
-        ">"
-	"  <ETableColumn model_col=\"0\""
-	"	         expansion=\"1.0\""
-	"                cell=\"vbox\""
- 	"                minimum_width=\"32\""
-	"                resizable=\"true\""
-	"	         _title=\"Category\""
-	"                compare=\"string\"/>"
-	"  <ETableState>"
-	"    <column source=\"0\"/>"
-	"    <grouping>"
-	"    </grouping>"
-	"  </ETableState>"
-	"</ETableSpecification>";
+enum {
+	COLUMN_TEXT,	/* G_TYPE_STRING */
+	COLUMN_PIXBUF	/* GDK_TYPE_PIXBUF */
+};
 
-/* Page handling.  */
+static gpointer parent_class;
 
 static GtkWidget *
-create_page_container (const char *description,
-		       GtkWidget *widget)
+create_page_container (GtkWidget *widget)
 {
 	GtkWidget *vbox;
 
@@ -92,290 +56,328 @@
 	return vbox;
 }
 
-/* Timeout for switching pages (so it's more comfortable navigating with the
-   keyboard).  */
-
-static int
-set_page_timeout_callback (void *data)
+static GdkPixbuf *
+multi_config_dialog_load_pixbuf (const gchar *icon_name)
 {
-	EMultiConfigDialog *multi_config_dialog;
-	EMultiConfigDialogPrivate *priv;
+	GtkIconTheme *icon_theme;
+	GtkIconInfo *icon_info;
+	GdkPixbuf *pixbuf;
+	const gchar *filename;
+	gint size;
+	GError *error = NULL;
 
-	multi_config_dialog = E_MULTI_CONFIG_DIALOG (data);
-	priv = multi_config_dialog->priv;
+	icon_theme = gtk_icon_theme_get_default ();
 
-	gtk_notebook_set_current_page (
-		GTK_NOTEBOOK (priv->notebook), priv->set_page_timeout_page);
+	if (!gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, 0))
+		return NULL;
 
-	priv->set_page_timeout_id = 0;
-	gtk_widget_grab_focus(priv->list_e_table);
-	return FALSE;
+	icon_info = gtk_icon_theme_lookup_icon (
+		icon_theme, icon_name, size, 0);
+
+	if (icon_info == NULL)
+		return NULL;
+
+	filename = gtk_icon_info_get_filename (icon_info);
+
+	pixbuf = gdk_pixbuf_new_from_file (filename, &error);
+
+	gtk_icon_info_free (icon_info);
+
+	if (error != NULL) {
+		g_warning ("%s", error->message);
+		g_error_free (error);
+	}
+
+	return pixbuf;
 }
 
+static gboolean
+multi_config_dialog_timeout_cb (EMultiConfigDialog *dialog)
+{
+	GtkIconView *icon_view;
+	GtkNotebook *notebook;
+	GList *list;
+
+	icon_view = GTK_ICON_VIEW (dialog->priv->icon_view);
+	notebook = GTK_NOTEBOOK (dialog->priv->notebook);
+
+	list = gtk_icon_view_get_selected_items (icon_view);
+
+	if (list != NULL) {
+		GtkTreePath *path = list->data;
+		gint page;
+
+		page = gtk_tree_path_get_indices (path)[0];
+		gtk_notebook_set_current_page (notebook, page);
+	}
+
+	g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
+	g_list_free (list);
 
-/* Button handling.  */
+	dialog->priv->timeout_id = 0;
+	gtk_widget_grab_focus (GTK_WIDGET (icon_view));
+
+	return FALSE;
+}
 
 static void
-do_close (EMultiConfigDialog *dialog)
+multi_config_dialog_selection_changed_cb (EMultiConfigDialog *dialog)
 {
-	gtk_widget_destroy (GTK_WIDGET (dialog));
+	if (dialog->priv->timeout_id == 0)
+		dialog->priv->timeout_id = g_timeout_add (
+			SWITCH_PAGE_INTERVAL, (GSourceFunc)
+			multi_config_dialog_timeout_cb, dialog);
 }
 
-
-/* ETable signals.  */
-
 static void
-table_cursor_change_callback (ETable *etable,
-			      int row,
-			      void *data)
+multi_config_dialog_dispose (GObject *object)
 {
-	EMultiConfigDialog *dialog;
 	EMultiConfigDialogPrivate *priv;
 
-	dialog = E_MULTI_CONFIG_DIALOG (data);
-	priv = dialog->priv;
+	priv = E_MULTI_CONFIG_DIALOG_GET_PRIVATE (object);
 
-	if (priv->set_page_timeout_id == 0)
-		priv->set_page_timeout_id = g_timeout_add (SWITCH_PAGE_INTERVAL,
-							   set_page_timeout_callback,
-							   dialog);
-
-	priv->set_page_timeout_page = row;
-}
+	if (priv->icon_view != NULL) {
+		g_object_unref (priv->icon_view);
+		priv->icon_view = NULL;
+	}
 
+	if (priv->notebook != NULL) {
+		g_object_unref (priv->notebook);
+		priv->notebook = NULL;
+	}
 
-/* GObject methods.  */
+	/* Chain up to parent's dispose() method. */
+	G_OBJECT_CLASS (parent_class)->dispose (object);
+}
 
 static void
-impl_finalize (GObject *object)
+multi_config_dialog_finalize (GObject *object)
 {
-	EMultiConfigDialog *dialog;
 	EMultiConfigDialogPrivate *priv;
 
-	dialog = E_MULTI_CONFIG_DIALOG (object);
-	priv = dialog->priv;
-
-	if (priv->set_page_timeout_id != 0)
-		g_source_remove (priv->set_page_timeout_id);
-
-	g_slist_free (priv->pages);
+	priv = E_MULTI_CONFIG_DIALOG_GET_PRIVATE (object);
 
-	g_free (priv);
+	if (priv->timeout_id != 0)
+		g_source_remove (priv->timeout_id);
 
-	(* G_OBJECT_CLASS (e_multi_config_dialog_parent_class)->finalize) (object);
+	/* Chain up to parent's finalize() method. */
+	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
+static void
+multi_config_dialog_map (GtkWidget *widget)
+{
+	GtkDialog *dialog;
 
-/* GtkDialog methods.  */
+	/* Chain up to parent's map() method. */
+	GTK_WIDGET_CLASS (parent_class)->map (widget);
+
+	/* Override those stubborn style properties. */
+	dialog = GTK_DIALOG (widget);
+	gtk_box_set_spacing (GTK_BOX (dialog->vbox), 12);
+	gtk_container_set_border_width (GTK_CONTAINER (widget), 12);
+	gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 0);
+	gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 0);
+}
 
 static void
-impl_response (GtkDialog *dialog, int response_id)
+multi_config_dialog_response (GtkDialog *dialog,
+		              gint response_id)
 {
-	EMultiConfigDialog *multi_config_dialog;
 	GError *error = NULL;
 
-	multi_config_dialog = E_MULTI_CONFIG_DIALOG (dialog);
-
 	switch (response_id) {
-	case GTK_RESPONSE_HELP:
-		gnome_help_display (
-			"evolution.xml", "config-prefs", &error);
-		if (error != NULL) {
-			g_warning ("%s", error->message);
-			g_error_free (error);
-		}
-		break;
-	case GTK_RESPONSE_CLOSE:
-	default:
-		do_close (multi_config_dialog);
-		break;
+		case GTK_RESPONSE_HELP:
+			gnome_help_display (
+				"evolution.xml", "config-prefs", &error);
+			if (error != NULL) {
+				g_warning ("%s", error->message);
+				g_error_free (error);
+			}
+			break;
+
+		case GTK_RESPONSE_CLOSE:
+		default:
+			gtk_widget_destroy (GTK_WIDGET (dialog));
+			break;
 	}
 }
 
-
-/* GObject ctors.  */
-
 static void
-e_multi_config_dialog_class_init (EMultiConfigDialogClass *class)
+multi_config_dialog_class_init (EMultiConfigDialogClass *class)
 {
 	GObjectClass *object_class;
+	GtkWidgetClass *widget_class;
 	GtkDialogClass *dialog_class;
 
+	parent_class = g_type_class_peek_parent (class);
+	g_type_class_add_private (class, sizeof (EMultiConfigDialogPrivate));
+
 	object_class = G_OBJECT_CLASS (class);
-	object_class->finalize = impl_finalize;
+	object_class->dispose = multi_config_dialog_dispose;
+	object_class->finalize = multi_config_dialog_finalize;
+
+	widget_class = GTK_WIDGET_CLASS (class);
+	widget_class->map = multi_config_dialog_map;
 
 	dialog_class = GTK_DIALOG_CLASS (class);
-	dialog_class->response = impl_response;
+	dialog_class->response = multi_config_dialog_response;
 }
 
-#define RGB_COLOR(color) (((color).red & 0xff00) << 8 | \
-			   ((color).green & 0xff00) | \
-			   ((color).blue & 0xff00) >> 8)
-
 static void
-canvas_realize (GtkWidget *widget, EMultiConfigDialog *dialog)
+multi_config_dialog_init (EMultiConfigDialog *dialog)
 {
-}
+	GtkListStore *store;
+	GtkWidget *container;
+	GtkWidget *hbox;
+	GtkWidget *widget;
 
+	dialog->priv = E_MULTI_CONFIG_DIALOG_GET_PRIVATE (dialog);
 
-static ETableMemoryStoreColumnInfo columns[] = {
-	E_TABLE_MEMORY_STORE_STRING,
-	E_TABLE_MEMORY_STORE_PIXBUF,
-	E_TABLE_MEMORY_STORE_PIXBUF,
-	E_TABLE_MEMORY_STORE_PIXBUF,
-	E_TABLE_MEMORY_STORE_PIXBUF,
-	E_TABLE_MEMORY_STORE_TERMINATOR
-};
+	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+	gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
 
-static void
-e_multi_config_dialog_init (EMultiConfigDialog *multi_config_dialog)
-{
-	EMultiConfigDialogPrivate *priv;
-	ETableModel *list_e_table_model;
-	GtkWidget *dialog_vbox;
-	GtkWidget *hbox;
-	GtkWidget *notebook;
-	GtkWidget *list_e_table;
-	ETableExtras *extras;
-	ECell *pixbuf;
-	ECell *text;
-	ECell *vbox;
-
-	gtk_dialog_set_has_separator (GTK_DIALOG (multi_config_dialog), FALSE);
-	gtk_widget_realize (GTK_WIDGET (multi_config_dialog));
-	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (multi_config_dialog)->vbox), 0);
-	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (multi_config_dialog)->action_area), 12);
-
-	hbox = gtk_hbox_new (FALSE, 6);
-	gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
-	dialog_vbox = GTK_DIALOG (multi_config_dialog)->vbox;
-
-	gtk_container_add (GTK_CONTAINER (dialog_vbox), hbox);
-
-	list_e_table_model = e_table_memory_store_new (columns);
-
-	vbox = e_cell_vbox_new ();
-
-	pixbuf = e_cell_pixbuf_new();
-	g_object_set (G_OBJECT (pixbuf),
-		      "focused_column", 2,
-		      "selected_column", 3,
-		      "unselected_column", 4,
-		      NULL);
-	e_cell_vbox_append (E_CELL_VBOX (vbox), pixbuf, 1);
-	g_object_unref (pixbuf);
-
-	text = e_cell_text_new (NULL, GTK_JUSTIFY_CENTER);
-	e_cell_vbox_append (E_CELL_VBOX (vbox), text, 0);
-	g_object_unref (text);
-
-	extras = e_table_extras_new ();
-	e_table_extras_add_cell (extras, "vbox", vbox);
-
-	list_e_table = e_table_scrolled_new (list_e_table_model, extras, list_e_table_spec, NULL);
-	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (list_e_table), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-	g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (list_e_table)),
-			  "cursor_change", G_CALLBACK (table_cursor_change_callback), multi_config_dialog);
-
-	g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (list_e_table))->table_canvas,
-			  "realize", G_CALLBACK (canvas_realize), multi_config_dialog);
-
-	g_object_unref (extras);
-
-	gtk_box_pack_start (GTK_BOX (hbox), list_e_table, FALSE, TRUE, 0);
-
-	notebook = gtk_notebook_new ();
-	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
-	gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
-	gtk_box_pack_start (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
+	/* XXX Remove this once we kill Bonobo. */
+	gtk_widget_realize (GTK_WIDGET (dialog));
+
+	container = GTK_DIALOG (dialog)->vbox;
 
+	hbox = gtk_hbox_new (FALSE, 12);
+	gtk_container_add (GTK_CONTAINER (container), hbox);
 	gtk_widget_show (hbox);
-	gtk_widget_show (notebook);
-	gtk_widget_show (list_e_table);
 
-	gtk_dialog_add_buttons (GTK_DIALOG (multi_config_dialog),
-				GTK_STOCK_HELP, GTK_RESPONSE_HELP,
-				GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
-				NULL);
-	gtk_dialog_set_default_response (GTK_DIALOG (multi_config_dialog), GTK_RESPONSE_OK);
+	widget = gtk_scrolled_window_new (NULL, NULL);
+	gtk_scrolled_window_set_policy (
+		GTK_SCROLLED_WINDOW (widget),
+		GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_shadow_type (
+		GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
+	gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, TRUE, 0);
+	gtk_widget_show (widget);
+
+	container = widget;
+
+	store = gtk_list_store_new (2, G_TYPE_STRING, GDK_TYPE_PIXBUF);
+	widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store));
+	gtk_icon_view_set_columns (GTK_ICON_VIEW (widget), 1);
+	gtk_icon_view_set_text_column (GTK_ICON_VIEW (widget), COLUMN_TEXT);
+	gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (widget), COLUMN_PIXBUF);
+	g_signal_connect_swapped (
+		widget, "selection-changed",
+		G_CALLBACK (multi_config_dialog_selection_changed_cb), dialog);
+	gtk_container_add (GTK_CONTAINER (container), widget);
+	dialog->priv->icon_view = g_object_ref (widget);
+	gtk_widget_show (widget);
+	g_object_unref (store);
+
+	widget = gtk_notebook_new ();
+	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE);
+	gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE);
+	gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
+	dialog->priv->notebook = g_object_ref (widget);
+	gtk_widget_show (widget);
 
-	gtk_window_set_resizable (GTK_WINDOW (multi_config_dialog), TRUE);
+	gtk_dialog_add_buttons (
+		GTK_DIALOG (dialog),
+		GTK_STOCK_HELP, GTK_RESPONSE_HELP,
+		GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
+		NULL);
+
+	gtk_dialog_set_default_response (
+		GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
+}
+
+GType
+e_multi_config_dialog_get_type (void)
+{
+	static GType type = 0;
+
+	if (G_UNLIKELY (type == 0)) {
+		const GTypeInfo type_info = {
+			sizeof (EMultiConfigDialogClass),
+			(GBaseInitFunc) NULL,
+			(GBaseFinalizeFunc) NULL,
+			(GClassInitFunc) multi_config_dialog_class_init,
+			(GClassFinalizeFunc) NULL,
+			NULL,  /* class_data */
+			sizeof (EMultiConfigDialog),
+			0,     /* n_preallocs */
+			(GInstanceInitFunc) multi_config_dialog_init,
+			NULL   /* value_table */
+		};
 
-	priv = g_new (EMultiConfigDialogPrivate, 1);
-	priv->pages                 = NULL;
-	priv->list_e_table          = list_e_table;
-	priv->list_e_table_model    = list_e_table_model;
-	priv->notebook              = notebook;
-	priv->set_page_timeout_id   = 0;
-	priv->set_page_timeout_page = 0;
+		type = g_type_register_static (
+			GTK_TYPE_DIALOG, "EMultiConfigDialog", &type_info, 0);
+	}
 
-	multi_config_dialog->priv = priv;
+	return type;
 }
 
-
 GtkWidget *
 e_multi_config_dialog_new (void)
 {
 	return g_object_new (e_multi_config_dialog_get_type (), NULL);
 }
 
-
 void
 e_multi_config_dialog_add_page (EMultiConfigDialog *dialog,
-				const char *title,
-				const char *description,
-				GdkPixbuf *icon,
+				const gchar *caption,
+				const gchar *icon_name,
 				EConfigPage *page_widget)
 {
-	EMultiConfigDialogPrivate *priv;
-	AtkObject *a11y;
-	AtkObject *a11yPage;
-	gint page_no;
+	GtkIconView *icon_view;
+	GtkNotebook *notebook;
+	GtkTreeModel *model;
+	GdkPixbuf *pixbuf;
+	GtkTreeIter iter;
 
 	g_return_if_fail (E_IS_MULTI_CONFIG_DIALOG (dialog));
-	g_return_if_fail (title != NULL);
-	g_return_if_fail (description != NULL);
+	g_return_if_fail (caption != NULL);
+	g_return_if_fail (icon_name != NULL);
 	g_return_if_fail (E_IS_CONFIG_PAGE (page_widget));
 
-	priv = dialog->priv;
+	icon_view = GTK_ICON_VIEW (dialog->priv->icon_view);
+	notebook = GTK_NOTEBOOK (dialog->priv->notebook);
 
-	priv->pages = g_slist_append (priv->pages, page_widget);
+	model = gtk_icon_view_get_model (icon_view);
+	pixbuf = multi_config_dialog_load_pixbuf (icon_name);
 
-	e_table_memory_store_insert (E_TABLE_MEMORY_STORE (priv->list_e_table_model), -1, NULL, title, icon, NULL, NULL, NULL);
+	gtk_list_store_append (GTK_LIST_STORE (model), &iter);
 
-	page_no = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
-				  create_page_container (description, GTK_WIDGET (page_widget)),
-				  NULL);
-
-	a11y = gtk_widget_get_accessible (GTK_WIDGET(priv->notebook));
-	a11yPage = atk_object_ref_accessible_child (a11y, page_no);
-	if (a11yPage != NULL) {
-		if (atk_object_get_role (a11yPage) == ATK_ROLE_PAGE_TAB)
-			atk_object_set_name (a11yPage, title);
-		g_object_unref (a11yPage);
-	}
-	if (priv->pages->next == NULL) {
-		ETable *table;
+	gtk_list_store_set (
+		GTK_LIST_STORE (model), &iter,
+		COLUMN_TEXT, caption, COLUMN_PIXBUF, pixbuf, -1);
+
+	if (gtk_tree_model_iter_n_children (model, NULL) == 1) {
+		GtkTreePath *path;
 
-		/* FIXME: This is supposed to select the first entry by default
-		   but it doesn't seem to work at all.  */
-		table = e_table_scrolled_get_table (E_TABLE_SCROLLED (priv->list_e_table));
-		e_table_set_cursor_row (table, 0);
-		e_selection_model_select_all (e_table_get_selection_model (table));
+		path = gtk_tree_path_new_first ();
+		gtk_icon_view_select_path (icon_view, path);
+		gtk_tree_path_free (path);
 	}
+
+	gtk_notebook_append_page (
+		notebook, create_page_container (
+		GTK_WIDGET (page_widget)), NULL);
 }
 
 void
-e_multi_config_dialog_show_page (EMultiConfigDialog *dialog, int page)
+e_multi_config_dialog_show_page (EMultiConfigDialog *dialog,
+                                 gint page)
 {
-	EMultiConfigDialogPrivate *priv;
+	GtkIconView *icon_view;
+	GtkNotebook *notebook;
+	GtkTreePath *path;
 
-	g_return_if_fail (dialog != NULL);
 	g_return_if_fail (E_IS_MULTI_CONFIG_DIALOG (dialog));
 
-	priv = dialog->priv;
+	icon_view = GTK_ICON_VIEW (dialog->priv->icon_view);
+	notebook = GTK_NOTEBOOK (dialog->priv->notebook);
 
-	e_table_set_cursor_row (e_table_scrolled_get_table (E_TABLE_SCROLLED (priv->list_e_table)), page);
-	gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), page);
-}
+	path = gtk_tree_path_new_from_indices (page, -1);
+	gtk_icon_view_select_path (icon_view, path);
+	gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
+	gtk_tree_path_free (path);
 
+	gtk_notebook_set_current_page (notebook, page);
+}

Modified: branches/kill-bonobo/widgets/misc/e-multi-config-dialog.h
==============================================================================
--- branches/kill-bonobo/widgets/misc/e-multi-config-dialog.h	(original)
+++ branches/kill-bonobo/widgets/misc/e-multi-config-dialog.h	Fri Aug  8 23:12:59 2008
@@ -16,12 +16,10 @@
  * License along with this program; if not, write to the
  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
- *
- * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#ifndef _E_MULTI_CONFIG_DIALOG_H_
-#define _E_MULTI_CONFIG_DIALOG_H_
+#ifndef E_MULTI_CONFIG_DIALOG_H
+#define E_MULTI_CONFIG_DIALOG_H
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -31,25 +29,33 @@
 
 #include <gtk/gtk.h>
 
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_MULTI_CONFIG_DIALOG			(e_multi_config_dialog_get_type ())
-#define E_MULTI_CONFIG_DIALOG(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialog))
-#define E_MULTI_CONFIG_DIALOG_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialogClass))
-#define E_IS_MULTI_CONFIG_DIALOG(obj)			(G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MULTI_CONFIG_DIALOG))
-#define E_IS_MULTI_CONFIG_DIALOG_CLASS(klass)		(G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MULTI_CONFIG_DIALOG))
+G_BEGIN_DECLS
 
-
-typedef struct _EMultiConfigDialog        EMultiConfigDialog;
+/* Standard GObject macros */
+#define E_TYPE_MULTI_CONFIG_DIALOG \
+	(e_multi_config_dialog_get_type ())
+#define E_MULTI_CONFIG_DIALOG(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialog))
+#define E_MULTI_CONFIG_DIALOG_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialogClass))
+#define E_IS_MULTI_CONFIG_DIALOG(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_MULTI_CONFIG_DIALOG))
+#define E_IS_MULTI_CONFIG_DIALOG_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((obj), E_TYPE_MULTI_CONFIG_DIALOG))
+#define E_MULTI_CONFIG_DIALOG_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_TYPE \
+	((obj), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialogClass))
+
+typedef struct _EMultiConfigDialog EMultiConfigDialog;
+typedef struct _EMultiConfigDialogClass EMultiConfigDialogClass;
 typedef struct _EMultiConfigDialogPrivate EMultiConfigDialogPrivate;
-typedef struct _EMultiConfigDialogClass   EMultiConfigDialogClass;
 
 struct _EMultiConfigDialog {
 	GtkDialog parent;
-
 	EMultiConfigDialogPrivate *priv;
 };
 
@@ -57,20 +63,16 @@
 	GtkDialogClass parent_class;
 };
 
-
-GType      e_multi_config_dialog_get_type (void);
-GtkWidget *e_multi_config_dialog_new      (void);
-
-void  e_multi_config_dialog_add_page  (EMultiConfigDialog *dialog,
-				       const char         *title,
-				       const char         *description,
-				       GdkPixbuf          *icon,
-				       EConfigPage        *page);
-void  e_multi_config_dialog_show_page (EMultiConfigDialog *dialog,
-				       int                 page);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+GType		e_multi_config_dialog_get_type	(void);
+GtkWidget *	e_multi_config_dialog_new	(void);
+
+void		e_multi_config_dialog_add_page	(EMultiConfigDialog *dialog,
+						 const gchar *caption,
+						 const gchar *icon_name,
+						 EConfigPage *page);
+void		e_multi_config_dialog_show_page	(EMultiConfigDialog *dialog,
+						 gint page);
+
+G_END_DECLS
 
-#endif /* _E_MULTI_CONFIG_DIALOG_H_ */
+#endif /* E_MULTI_CONFIG_DIALOG_H */

Modified: branches/kill-bonobo/widgets/misc/test-multi-config-dialog.c
==============================================================================
--- branches/kill-bonobo/widgets/misc/test-multi-config-dialog.c	(original)
+++ branches/kill-bonobo/widgets/misc/test-multi-config-dialog.c	Fri Aug  8 23:12:59 2008
@@ -41,10 +41,8 @@
 		GtkWidget *page;
 		char *string;
 		char *title;
-		char *description;
 
 		string = g_strdup_printf ("This is page %d", i);
-		description = g_strdup_printf ("Description of page %d", i);
 		title = g_strdup_printf ("Title of page %d", i);
 
 		widget = gtk_label_new (string);
@@ -53,12 +51,12 @@
 		page = e_config_page_new ();
 		gtk_container_add (GTK_CONTAINER (page), widget);
 
-		e_multi_config_dialog_add_page (multi_config_dialog, title, description, NULL,
-						E_CONFIG_PAGE (page));
+		e_multi_config_dialog_add_page (
+			multi_config_dialog, title, "gtk-properties",
+			E_CONFIG_PAGE (page));
 
 		g_free (string);
 		g_free (title);
-		g_free (description);
 	}
 }
 



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