Re: [evolution-patches] Pilot Settings



On Fri, 2004-07-23 at 08:28 +0200, Rodrigo Moya wrote: 
> why do we _ref the object in one case and not in the other? I guess you
> then _unref it somewhere, so if it's being ref'ed only in one case, the
> _unref might fail, right?
> 
> the rest of the calendar part looks ok.

Yep.  Should never add a "fix" at the last second.

Hopefully the attached is correct.

-JP
-- 
JP Rosevear <jpr novell com>
Novell, Inc.
? Makefile.bk
? ps-misc.patch
? search-name.patch
? select.patch
? temp.patch
? temp2.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/ChangeLog,v
retrieving revision 1.322
diff -u -r1.322 ChangeLog
--- ChangeLog	26 Jul 2004 15:30:14 -0000	1.322
+++ ChangeLog	1 Aug 2004 19:45:23 -0000
@@ -1,3 +1,16 @@
+2004-08-01  JP Rosevear  <jpr novell com>
+
+	* e-pilot-settings.c (e_pilot_settings_get_source): accessor
+	(e_pilot_settings_set_source): ditto
+	(build_ui): show the source option menu
+	(e_pilot_settings_new): use above
+
+	* e-pilot-settings.h: add prototypes
+
+2004-07-20  JP Rosevear  <jpr novell com>
+
+	* Makefile.am: build pilot setting
+
 2004-07-26  JP Rosevear  <jpr novell com>
  
  	* e-search-bar.c (setup_bonobo_menus): use ctrl-shift-q to clear
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/Makefile.am,v
retrieving revision 1.54
diff -u -r1.54 Makefile.am
--- Makefile.am	1 Jun 2004 17:14:48 -0000	1.54
+++ Makefile.am	1 Aug 2004 19:45:23 -0000
@@ -11,7 +11,16 @@
 
 widgetsincludedir = $(privincludedir)/widgets
 
+if ENABLE_PILOT_CONDUITS
+pilot_sources = e-pilot-settings.c
+pilot_headers = e-pilot-settings.h
+else
+pilot_sources =
+pilot_headers =
+endif
+
 widgetsinclude_HEADERS =			\
+	$(pilot_headers)			\
 	e-activity-handler.h			\
 	e-calendar.h				\
 	e-calendar-item.h			\
@@ -42,6 +51,7 @@
 libemiscwidgets_la_SOURCES =			\
 	$(MARSHAL_GENERATED)			\
 	$(widgetsinclude_HEADERS)		\
+	$(pilot_sources)			\
 	e-activity-handler.c			\
 	e-calendar.c				\
 	e-calendar-item.c			\
Index: e-pilot-settings.c
===================================================================
RCS file: e-pilot-settings.c
diff -N e-pilot-settings.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ e-pilot-settings.c	1 Aug 2004 19:45:23 -0000
@@ -0,0 +1,198 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-pilot-settings.c
+ *
+ * Copyright (C) 2001  JP Rosevear
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: JP Rosevear
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <libgnome/gnome-i18n.h>
+#include "e-source-option-menu.h"
+#include "e-pilot-settings.h"
+
+struct _EPilotSettingsPrivate 
+{
+	GtkWidget *source;
+	GtkWidget *secret;
+	GtkWidget *cat;
+	GtkWidget *cat_btn;
+};
+
+
+static void class_init (EPilotSettingsClass *klass);
+static void init (EPilotSettings *ps);
+
+static GObjectClass *parent_class = NULL;
+
+
+GType
+e_pilot_settings_get_type (void)
+{
+	static GType type = 0;
+
+	if (!type) {
+		static GTypeInfo info = {
+                        sizeof (EPilotSettingsClass),
+                        (GBaseInitFunc) NULL,
+                        (GBaseFinalizeFunc) NULL,
+                        (GClassInitFunc) class_init,
+                        NULL, NULL,
+                        sizeof (EPilotSettings),
+                        0,
+                        (GInstanceInitFunc) init
+                };
+		type = g_type_register_static (GTK_TYPE_TABLE, "EPilotSettings", &info, 0);
+	}
+
+	return type;
+}
+
+static void
+class_init (EPilotSettingsClass *klass)
+{
+	GObjectClass *object_class;
+
+	object_class = G_OBJECT_CLASS (klass);
+
+	parent_class = g_type_class_ref (GTK_TYPE_TABLE);
+}
+
+static void
+init (EPilotSettings *ps)
+{
+	EPilotSettingsPrivate *priv;
+	
+	priv = g_new0 (EPilotSettingsPrivate, 1);
+
+	ps->priv = priv;
+}
+
+
+static void
+build_ui (EPilotSettings *ps, ESourceList *source_list)
+{
+	EPilotSettingsPrivate *priv;
+	GtkWidget *lbl;
+	
+	priv = ps->priv;
+
+	gtk_table_resize (GTK_TABLE (ps), 2, 2);
+	gtk_container_set_border_width (GTK_CONTAINER (ps), 4);
+	gtk_table_set_col_spacings (GTK_TABLE (ps), 6);
+
+	lbl = gtk_label_new (_("Sync with:"));
+	gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
+	priv->source = e_source_option_menu_new (source_list);
+	gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, 0, 1);
+	gtk_table_attach_defaults (GTK_TABLE (ps), priv->source, 1, 2, 0, 1);
+	gtk_widget_show (lbl);
+	gtk_widget_show (priv->source);
+
+	lbl = gtk_label_new (_("Sync Private Records:"));
+	gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
+	priv->secret = gtk_check_button_new ();
+	gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, 1, 2);
+	gtk_table_attach_defaults (GTK_TABLE (ps), priv->secret, 1, 2, 1, 2);
+	gtk_widget_show (lbl);
+	gtk_widget_show (priv->secret);
+
+#if 0
+	lbl = gtk_label_new (_("Sync Categories:"));
+	gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
+	priv->cat = gtk_check_button_new ();
+	gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, 2, 3);
+	gtk_table_attach_defaults (GTK_TABLE (ps), priv->cat, 1, 2, 2, 3);
+	gtk_widget_show (lbl);
+	gtk_widget_show (priv->cat);
+#endif
+}
+
+
+
+GtkWidget *
+e_pilot_settings_new (ESourceList *source_list)
+{
+	EPilotSettings *ps;
+	EPilotSettingsPrivate *priv;
+	
+	ps = g_object_new (E_TYPE_PILOT_SETTINGS, NULL);
+	priv = ps->priv;
+
+	build_ui (ps, source_list);
+	
+	return GTK_WIDGET (ps);
+}
+
+ESource *
+e_pilot_settings_get_source (EPilotSettings *ps)
+{
+	EPilotSettingsPrivate *priv;
+	
+	g_return_val_if_fail (ps != NULL, FALSE);
+	g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), FALSE);
+
+	priv = ps->priv;
+	
+	return e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (priv->source));
+}
+
+void
+e_pilot_settings_set_source (EPilotSettings *ps, ESource *source)
+{
+	EPilotSettingsPrivate *priv;
+	
+	g_return_if_fail (ps != NULL);
+	g_return_if_fail (E_IS_PILOT_SETTINGS (ps));
+
+	priv = ps->priv;
+
+	e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source), source);
+}
+
+gboolean
+e_pilot_settings_get_secret (EPilotSettings *ps)
+{
+	EPilotSettingsPrivate *priv;
+	
+	g_return_val_if_fail (ps != NULL, FALSE);
+	g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), FALSE);
+
+	priv = ps->priv;
+	
+	return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->secret));
+}
+
+void
+e_pilot_settings_set_secret (EPilotSettings *ps, gboolean secret)
+{
+	EPilotSettingsPrivate *priv;
+	
+	g_return_if_fail (ps != NULL);
+	g_return_if_fail (E_IS_PILOT_SETTINGS (ps));
+
+	priv = ps->priv;
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->secret),
+				      secret);
+}
+
Index: e-pilot-settings.h
===================================================================
RCS file: e-pilot-settings.h
diff -N e-pilot-settings.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ e-pilot-settings.h	1 Aug 2004 19:45:23 -0000
@@ -0,0 +1,72 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-pilot-settings.h
+ *
+ * Copyright (C) 2001  JP Rosevear
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: JP Rosevear
+ */
+
+#ifndef _E_PILOT_SETTINGS_H_
+#define _E_PILOT_SETTINGS_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <libedataserver/e-source-list.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define E_TYPE_PILOT_SETTINGS			(e_pilot_settings_get_type ())
+#define E_PILOT_SETTINGS(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_PILOT_SETTINGS, EPilotSettings))
+#define E_PILOT_SETTINGS_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_PILOT_SETTINGS, EPilotSettingsClass))
+#define E_IS_PILOT_SETTINGS(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
+#define E_IS_PILOT_SETTINGS_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
+
+
+typedef struct _EPilotSettings        EPilotSettings;
+typedef struct _EPilotSettingsPrivate EPilotSettingsPrivate;
+typedef struct _EPilotSettingsClass   EPilotSettingsClass;
+
+#define E_PILOT_SETTINGS_TABLE_ROWS 3
+#define E_PILOT_SETTINGS_TABLE_COLS 3
+
+struct _EPilotSettings {
+	GtkTable parent;
+
+	EPilotSettingsPrivate *priv;
+};
+
+struct _EPilotSettingsClass {
+	GtkTableClass parent_class;
+};
+
+
+GType      e_pilot_settings_get_type (void);
+GtkWidget *e_pilot_settings_new      (ESourceList *source_list);
+
+ESource *e_pilot_settings_get_source (EPilotSettings *ps);
+void e_pilot_settings_set_source (EPilotSettings *ps, ESource *source);
+
+gboolean e_pilot_settings_get_secret (EPilotSettings *ps);
+void e_pilot_settings_set_secret (EPilotSettings *ps, gboolean secret);
+
+G_END_DECLS
+
+#endif
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/ChangeLog,v
retrieving revision 1.1351
diff -u -r1.1351 ChangeLog
--- ChangeLog	25 Jul 2004 19:34:45 -0000	1.1351
+++ ChangeLog	1 Aug 2004 19:44:20 -0000
@@ -1,3 +1,7 @@
+2004-08-01  JP Rosevear  <jpr novell com>
+
+	* configure.in: add libedataserver to E_UTIL flags
+
 2004-07-25  Gil Osher  <dolfin rpg org il>
 
 	* configure.in: Added 'he' (Hebrew) to ALL_LINGUAS.
Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution/configure.in,v
retrieving revision 1.701
diff -u -r1.701 configure.in
--- configure.in	25 Jul 2004 19:34:16 -0000	1.701
+++ configure.in	1 Aug 2004 19:44:20 -0000
@@ -1066,7 +1066,7 @@
 AC_SUBST(E_NAME_CFLAGS)
 AC_SUBST(E_NAME_LIBS)
 
-EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-2.2 >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 $mozilla_nspr, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
+EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-2.2 >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 libedataserver-1.0 >= $EDS_REQUIRED $mozilla_nspr, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
 AC_SUBST(E_UTIL_CFLAGS)
 AC_SUBST(E_UTIL_LIBS)
 
? ps-util.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
retrieving revision 1.472
diff -u -r1.472 ChangeLog
--- ChangeLog	22 Jul 2004 03:35:11 -0000	1.472
+++ ChangeLog	1 Aug 2004 19:45:09 -0000
@@ -1,3 +1,14 @@
+2004-08-01  JP Rosevear  <jpr novell com>
+
+	* e-pilot-util.c (e_pilot_get_sync_source): find the source with
+	the pilot-sync property
+	(e_pilot_set_sync_source): give the source the pilot-sync property
+	and make sure its the only one
+
+	* e-pilot-util.h: add prototypes
+
+	* Makefile.am (eutilincludedir): don't build pilot settings
+
 2004-07-20  Not Zed  <NotZed Ximian com>
 
 	* e-dialog-utils.c: include config.h.  See #61395.
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/e-util/Makefile.am,v
retrieving revision 1.117
diff -u -r1.117 Makefile.am
--- Makefile.am	27 May 2004 18:23:57 -0000	1.117
+++ Makefile.am	1 Aug 2004 19:45:09 -0000
@@ -95,13 +95,11 @@
 
 econdinclude_HEADERS =		\
 	e-pilot-map.h		\
-	e-pilot-settings.h	\
 	e-pilot-util.h
 
 pilot_sources = \
 	$(econdinclude_HEADERS)	\
 	e-pilot-map.c		\
-	e-pilot-settings.c	\
 	e-pilot-util.c
 
 if ENABLE_PILOT_CONDUITS
Index: e-pilot-settings.c
===================================================================
RCS file: e-pilot-settings.c
diff -N e-pilot-settings.c
--- e-pilot-settings.c	27 Jan 2003 06:23:58 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,150 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-pilot-settings.c
- *
- * Copyright (C) 2001  JP Rosevear
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <libgnome/gnome-i18n.h>
-#include "e-pilot-settings.h"
-
-struct _EPilotSettingsPrivate 
-{
-	GtkWidget *secret;
-	GtkWidget *cat;
-	GtkWidget *cat_btn;
-};
-
-
-static void class_init (EPilotSettingsClass *klass);
-static void init (EPilotSettings *ps);
-
-static GObjectClass *parent_class = NULL;
-
-
-GType
-e_pilot_settings_get_type (void)
-{
-	static GType type = 0;
-
-	if (!type) {
-		static GTypeInfo info = {
-                        sizeof (EPilotSettingsClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) class_init,
-                        NULL, NULL,
-                        sizeof (EPilotSettings),
-                        0,
-                        (GInstanceInitFunc) init
-                };
-		type = g_type_register_static (GTK_TYPE_TABLE, "EPilotSettings", &info, 0);
-	}
-
-	return type;
-}
-
-static void
-class_init (EPilotSettingsClass *klass)
-{
-	GObjectClass *object_class;
-
-	object_class = G_OBJECT_CLASS (klass);
-
-	parent_class = g_type_class_ref (GTK_TYPE_TABLE);
-}
-
-
-static void
-init (EPilotSettings *ps)
-{
-	EPilotSettingsPrivate *priv;
-	GtkWidget *lbl;
-	
-	priv = g_new0 (EPilotSettingsPrivate, 1);
-
-	ps->priv = priv;
-
-	gtk_table_resize (GTK_TABLE (ps), 2, 2);
-	gtk_container_set_border_width (GTK_CONTAINER (ps), 4);
-	gtk_table_set_col_spacings (GTK_TABLE (ps), 4);
-
-	lbl = gtk_label_new (_("Sync Private Records:"));
-	gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
-	priv->secret = gtk_check_button_new ();
-	gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, 0, 1);
-	gtk_table_attach_defaults (GTK_TABLE (ps), priv->secret, 1, 2, 0, 1);
-	gtk_widget_show (lbl);
-	gtk_widget_show (priv->secret);
-
-#if 0
-	lbl = gtk_label_new (_("Sync Categories:"));
-	gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
-	priv->cat = gtk_check_button_new ();
-	gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, 1, 2);
-	gtk_table_attach_defaults (GTK_TABLE (ps), priv->cat, 1, 2, 1, 2);
-	gtk_widget_show (lbl);
-	gtk_widget_show (priv->cat);
-#endif
-}
-
-
-
-GtkWidget *
-e_pilot_settings_new (void)
-{
-	GtkWidget *w = g_object_new (E_TYPE_PILOT_SETTINGS, NULL);
-	g_object_ref (w);
-	gtk_object_sink (GTK_OBJECT (w));
-
-	return w;
-}
-
-gboolean
-e_pilot_settings_get_secret (EPilotSettings *ps)
-{
-	EPilotSettingsPrivate *priv;
-	
-	g_return_val_if_fail (ps != NULL, FALSE);
-	g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), FALSE);
-
-	priv = ps->priv;
-	
-	return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->secret));
-}
-
-void
-e_pilot_settings_set_secret (EPilotSettings *ps, gboolean secret)
-{
-	EPilotSettingsPrivate *priv;
-	
-	g_return_if_fail (ps != NULL);
-	g_return_if_fail (E_IS_PILOT_SETTINGS (ps));
-
-	priv = ps->priv;
-
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->secret),
-				      secret);
-}
-
Index: e-pilot-settings.h
===================================================================
RCS file: e-pilot-settings.h
diff -N e-pilot-settings.h
--- e-pilot-settings.h	26 Jan 2003 04:04:52 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,73 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-pilot-settings.h
- *
- * Copyright (C) 2001  JP Rosevear
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifndef _E_PILOT_SETTINGS_H_
-#define _E_PILOT_SETTINGS_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_PILOT_SETTINGS			(e_pilot_settings_get_type ())
-#define E_PILOT_SETTINGS(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_PILOT_SETTINGS, EPilotSettings))
-#define E_PILOT_SETTINGS_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_PILOT_SETTINGS, EPilotSettingsClass))
-#define E_IS_PILOT_SETTINGS(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
-#define E_IS_PILOT_SETTINGS_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
-
-
-typedef struct _EPilotSettings        EPilotSettings;
-typedef struct _EPilotSettingsPrivate EPilotSettingsPrivate;
-typedef struct _EPilotSettingsClass   EPilotSettingsClass;
-
-#define E_PILOT_SETTINGS_TABLE_ROWS 2
-#define E_PILOT_SETTINGS_TABLE_COLS 2
-
-struct _EPilotSettings {
-	GtkTable parent;
-
-	EPilotSettingsPrivate *priv;
-};
-
-struct _EPilotSettingsClass {
-	GtkTableClass parent_class;
-};
-
-
-GType      e_pilot_settings_get_type (void);
-GtkWidget *e_pilot_settings_new      (void);
-
-gboolean e_pilot_settings_get_secret (EPilotSettings *ps);
-void e_pilot_settings_set_secret (EPilotSettings *ps, gboolean secret);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_PILOT_SETTINGS_H_ */
Index: e-pilot-util.c
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-pilot-util.c,v
retrieving revision 1.9
diff -u -r1.9 e-pilot-util.c
--- e-pilot-util.c	19 Feb 2004 06:06:47 -0000	1.9
+++ e-pilot-util.c	1 Aug 2004 19:45:09 -0000
@@ -61,3 +61,47 @@
 	
 	return ustring;
 }
+
+ESource *
+e_pilot_get_sync_source (ESourceList *source_list)
+{
+	GSList *g;
+
+	g_return_val_if_fail (source_list != NULL, NULL);
+	g_return_val_if_fail (E_IS_SOURCE_LIST (source_list), NULL);
+
+	for (g = e_source_list_peek_groups (source_list); g; g = g->next) {
+		ESourceGroup *group = E_SOURCE_GROUP (g->data);
+		GSList *s;
+
+		for (s = e_source_group_peek_sources (group); s; s = s->next) {
+			ESource *source = E_SOURCE (s->data);
+			
+			if (e_source_get_property (source, "pilot-sync"))
+				return source;
+		}
+	}
+
+	return NULL;
+}
+
+void
+e_pilot_set_sync_source (ESourceList *source_list, ESource *source)
+{
+	GSList *g;
+	
+	g_return_if_fail (source_list != NULL);
+	g_return_if_fail (E_IS_SOURCE_LIST (source_list));
+
+	for (g = e_source_list_peek_groups (source_list); g; g = g->next) {
+		GSList *s;
+		for (s = e_source_group_peek_sources (E_SOURCE_GROUP (g->data));
+		     s; s = s->next) {
+			e_source_set_property (E_SOURCE (s->data), "pilot-sync", NULL);
+		}
+	}
+
+	if (source)
+		e_source_set_property (source, "pilot-sync", "true");
+	e_source_list_sync (source_list, NULL);
+}
Index: e-pilot-util.h
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-pilot-util.h,v
retrieving revision 1.3
diff -u -r1.3 e-pilot-util.h
--- e-pilot-util.h	27 Oct 2001 23:34:14 -0000	1.3
+++ e-pilot-util.h	1 Aug 2004 19:45:09 -0000
@@ -20,10 +20,17 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <libedataserver/e-source-list.h>
+#include <libedataserver/e-source.h>
+
 #ifndef E_PILOT_UTIL_H
 #define E_PILOT_UTIL_H
 
 char *e_pilot_utf8_to_pchar (const char *string);
 char *e_pilot_utf8_from_pchar (const char *string);
+
+ESource *e_pilot_get_sync_source (ESourceList *source_list);
+void e_pilot_set_sync_source (ESourceList *source_list, ESource *source);
+
 
 #endif /* E_PILOT_UTIL_H */
? 61451.patch
? cal-conduits.patch
? cal-name.patch
? nav-scroll-2.patch
? nav-scroll-3.patch
? nav-scroll.patch
? gui/Helgdagar_2004.ics
? gui/cal-comp.patch
? gui/month.patch
? gui/monthview.patch
? gui/nav-scroll.patch
? gui/navigator.patch
? gui/new-editor-2.patch
? gui/new-editor.patch
? gui/old-e-cal-model.h
? gui/old.c
? gui/scroll.patch
? gui/sel.patch
? gui/summary.patch
? gui/temp2.c
? gui/alarm-notify/alarm.patch
? gui/dialogs/alarm-dialog.gladep
? gui/dialogs/alarm-list-dialog.gladep
? gui/dialogs/calendar-setup.gladep
? gui/dialogs/event-page.gladep
? gui/dialogs/meeting-page.gladep
? gui/dialogs/recurrence-page.gladep
? gui/dialogs/temp.c
? gui/dialogs/temp2.c
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2469
diff -u -r1.2469 ChangeLog
--- ChangeLog	31 Jul 2004 18:13:29 -0000	1.2469
+++ ChangeLog	1 Aug 2004 19:44:40 -0000
@@ -1,3 +1,20 @@
+2004-08-01  JP Rosevear  <jpr novell com>
+ 
+ 	* conduits/todo/todo-conduit.c (todoconduit_load_configuration):
+ 	get source list and source
+ 	(todoconduit_dupe_configuration): copy source list and source
+ 	(todoconduit_destroy_configuration): unref source list and source
+ 	(start_calendar_server): open the source that was set earlier
+ 	(fill_widgets): set the source option menu value
+ 	(create_settings_window): pass source list to pilot settings
+ 	(save_settings): mark source with pilot-sync property
+
+ 	* conduits/calendar/calendar-conduit.c: as above
+ 	
+ 	* conduits/todo/Makefile.am: link to and include misc. widgets
+ 
+ 	* conduits/calendar/Makefile.am: ditto	
+	
 2004-07-29  JP Rosevear  <jpr novell com>
  
  	* gui/e-calendar-view.c: creating new items no longer needs to be
Index: conduits/calendar/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/calendar/conduits/calendar/Makefile.am,v
retrieving revision 1.39
diff -u -r1.39 Makefile.am
--- conduits/calendar/Makefile.am	1 Dec 2003 19:46:11 -0000	1.39
+++ conduits/calendar/Makefile.am	1 Aug 2004 19:44:40 -0000
@@ -1,6 +1,8 @@
 INCLUDES = 					\
 	-I$(top_srcdir)/e-util			\
 	-I$(top_builddir)/e-util		\
+	-I$(top_srcdir)/widgets/misc		\
+	-I$(top_builddir)/widgets/misc		\
 	$(EVOLUTION_CALENDAR_CONDUIT_CFLAGS)
 
 # Calendar Conduit
@@ -13,6 +15,7 @@
 libecalendar_conduit_la_LIBADD = 					\
 	$(top_builddir)/e-util/libeutil.la				\
 	$(top_builddir)/e-util/libeconduit.la	 			\
+	$(top_builddir)/widgets/misc/libemiscwidgets.la	 		\
 	$(EVOLUTION_CALENDAR_CONDUIT_LIBS)
 
 e-calendar-$(BASE_VERSION).conduit: e-calendar.conduit.in
Index: conduits/calendar/calendar-conduit.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/conduits/calendar/calendar-conduit.c,v
retrieving revision 1.122
diff -u -r1.122 calendar-conduit.c
--- conduits/calendar/calendar-conduit.c	18 Jun 2004 20:45:37 -0000	1.122
+++ conduits/calendar/calendar-conduit.c	1 Aug 2004 19:44:41 -0000
@@ -94,6 +94,8 @@
 	guint32 pilot_id;
 	GnomePilotConduitSyncType  sync_type;
 
+	ESourceList *source_list;
+	ESource *source;
 	gboolean secret;
 	gboolean multi_day_split;
 	
@@ -130,6 +132,19 @@
 	g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", pilot_id);
 	gnome_config_push_prefix (prefix);
 
+	if (!e_cal_get_sources (&c->source_list, E_CAL_SOURCE_TYPE_EVENT, NULL))
+		c->source_list = NULL;
+	if (c->source_list) {
+		c->source = e_pilot_get_sync_source (c->source_list);
+		if (!c->source)
+			c->source = e_source_list_peek_source_any (c->source_list);
+		if (c->source) {
+			g_object_ref (c->source);
+		} else {
+			g_object_unref (c->source_list);
+			c->source_list = NULL;
+		}
+	}
 	c->secret = gnome_config_get_bool ("secret=FALSE");
 	c->multi_day_split = gnome_config_get_bool ("multi_day_split=TRUE");
 	if ((c->last_uri = gnome_config_get_string ("last_uri")) && !strncmp (c->last_uri, "file://", 7)) {
@@ -164,6 +179,7 @@
 	g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", c->pilot_id);
 	gnome_config_push_prefix (prefix);
 
+	e_pilot_set_sync_source (c->source_list, c->source);
 	gnome_config_set_bool ("secret", c->secret);
 	gnome_config_set_bool ("multi_day_split", c->multi_day_split);
 	gnome_config_set_string ("last_uri", c->last_uri);
@@ -184,6 +200,11 @@
 	retval = g_new0 (ECalConduitCfg, 1);
 	retval->pilot_id = c->pilot_id;
 	retval->sync_type = c->sync_type;
+
+	if (c->source_list)
+		retval->source_list = g_object_ref (c->source_list);
+	if (c->source)
+		retval->source = g_object_ref (c->source);
 	retval->secret = c->secret;
 	retval->multi_day_split = c->multi_day_split;
 	retval->last_uri = g_strdup (c->last_uri);
@@ -196,6 +217,8 @@
 {
 	g_return_if_fail (c != NULL);
 
+	g_object_unref (c->source_list);
+	g_object_unref (c->source);
 	g_free (c->last_uri);
 	g_free (c);
 }
@@ -407,14 +430,17 @@
 start_calendar_server (ECalConduitContext *ctxt)
 {
 	g_return_val_if_fail (ctxt != NULL, -2);
-	
-	/* FIXME Need a mechanism for the user to select uri's */
-	/* FIXME Can we use the cal model? */
-	
-	if (!e_cal_open_default (&ctxt->client, E_CAL_SOURCE_TYPE_EVENT, NULL, NULL, NULL))
+
+	if (ctxt->cfg->source) {
+		ctxt->client = e_cal_new (ctxt->cfg->source, E_CAL_SOURCE_TYPE_EVENT);
+		if (!e_cal_open (ctxt->client, TRUE, NULL))
+			return -1;
+	} else if (!e_cal_open_default (&ctxt->client, E_CAL_SOURCE_TYPE_EVENT, NULL, NULL, NULL)) {
 		return -1;
-	
-	return 0;
+	}
+
+        return 0;
+
 }
 
 /* Utility routines */
@@ -1801,6 +1827,9 @@
 static void
 fill_widgets (ECalConduitContext *ctxt)
 {
+	if (ctxt->cfg->source)
+		e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps),
+					     ctxt->cfg->source);	
 	e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
 				     ctxt->cfg->secret);
 
@@ -1813,8 +1842,11 @@
 			ECalConduitContext *ctxt)
 {
 	LOG (g_message ( "create_settings_window" ));
+	
+	if (!ctxt->cfg->source_list)
+		return -1;
 
-	ctxt->ps = e_pilot_settings_new ();
+	ctxt->ps = e_pilot_settings_new (ctxt->cfg->source_list);
 	ctxt->gui = e_cal_gui_new (E_PILOT_SETTINGS (ctxt->ps));
 
 	gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
@@ -1835,8 +1867,11 @@
 static void
 save_settings    (GnomePilotConduit *conduit, ECalConduitContext *ctxt)
 {
-	LOG (g_message ( "save_settings" ));
+        LOG (g_message ( "save_settings" ));
 
+	if (ctxt->new_cfg->source)
+		g_object_unref (ctxt->new_cfg->source);
+	ctxt->new_cfg->source = g_object_ref (e_pilot_settings_get_source (E_PILOT_SETTINGS (ctxt->ps)));
 	ctxt->new_cfg->secret =
 		e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
 	e_cal_gui_fill_config (ctxt->gui, ctxt->new_cfg);
Index: conduits/todo/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/calendar/conduits/todo/Makefile.am,v
retrieving revision 1.41
diff -u -r1.41 Makefile.am
--- conduits/todo/Makefile.am	1 Dec 2003 19:46:12 -0000	1.41
+++ conduits/todo/Makefile.am	1 Aug 2004 19:44:41 -0000
@@ -1,6 +1,8 @@
 INCLUDES = 					\
 	-I$(top_srcdir)/e-util			\
 	-I$(top_builddir)/e-util		\
+	-I$(top_srcdir)/widgets/misc		\
+	-I$(top_builddir)/widgets/misc		\
 	$(EVOLUTION_CALENDAR_CONDUIT_CFLAGS)
 
 # ToDo Conduit
@@ -13,6 +15,7 @@
 libetodo_conduit_la_LIBADD = 						\
 	$(top_builddir)/e-util/libeutil.la				\
 	$(top_builddir)/e-util/libeconduit.la		 		\
+	$(top_builddir)/widgets/misc/libemiscwidgets.la		 	\
 	$(EVOLUTION_CALENDAR_CONDUIT_LIBS)
 
 e-todo-$(BASE_VERSION).conduit: e-todo.conduit.in
Index: conduits/todo/todo-conduit.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/conduits/todo/todo-conduit.c,v
retrieving revision 1.92
diff -u -r1.92 todo-conduit.c
--- conduits/todo/todo-conduit.c	23 Jun 2004 17:54:00 -0000	1.92
+++ conduits/todo/todo-conduit.c	1 Aug 2004 19:44:41 -0000
@@ -48,7 +48,7 @@
 GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
 void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
 
-#define CONDUIT_VERSION "0.1.5"
+#define CONDUIT_VERSION "0.1.6"
 
 #define DEBUG_TODOCONDUIT 1
 /* #undef DEBUG_TODOCONDUIT */
@@ -96,6 +96,8 @@
 	guint32 pilot_id;
 	GnomePilotConduitSyncType  sync_type;
 
+	ESourceList *source_list;
+	ESource *source;
 	gboolean secret;
 	gint priority;
 
@@ -109,6 +111,8 @@
 	GnomePilotConduitManagement *management;
 	GnomePilotConduitConfig *config;
 	gchar prefix[256];
+
+
 	g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/",
 		    pilot_id);
 	
@@ -130,7 +134,21 @@
 	
 	/* Custom settings */
 	gnome_config_push_prefix (prefix);
-
+	
+	if (!e_cal_get_sources (&c->source_list, E_CAL_SOURCE_TYPE_TODO, NULL))
+		c->source_list = NULL;
+	if (c->source_list) {
+		c->source = e_pilot_get_sync_source (c->source_list);
+		if (!c->source)
+			c->source = e_source_list_peek_source_any (c->source_list);
+		if (c->source) {
+			g_object_ref (c->source);
+		} else {
+			g_object_unref (c->source_list);
+			c->source_list = NULL;
+		}
+	}
+	
 	c->secret = gnome_config_get_bool ("secret=FALSE");
 	c->priority = gnome_config_get_int ("priority=3");
 	c->last_uri = gnome_config_get_string ("last_uri");
@@ -149,6 +167,7 @@
 		    c->pilot_id);
 
 	gnome_config_push_prefix (prefix);
+	e_pilot_set_sync_source (c->source_list, c->source);
 	gnome_config_set_bool ("secret", c->secret);
 	gnome_config_set_int ("priority", c->priority);
 	gnome_config_set_string ("last_uri", c->last_uri);
@@ -169,6 +188,10 @@
 	retval->sync_type = c->sync_type;
 	retval->pilot_id = c->pilot_id;
 
+	if (c->source_list)
+		retval->source_list = g_object_ref (c->source_list);
+	if (c->source)
+		retval->source = g_object_ref (c->source);
 	retval->secret = c->secret;
 	retval->priority = c->priority;
 	retval->last_uri = g_strdup (c->last_uri);
@@ -181,6 +204,8 @@
 {
 	g_return_if_fail (c != NULL);
 
+	g_object_unref (c->source_list);
+	g_object_unref (c->source);
 	g_free (c->last_uri);
 	g_free (c);
 }
@@ -270,7 +295,7 @@
 e_todo_context_new (guint32 pilot_id) 
 {
 	EToDoConduitContext *ctxt = g_new0 (EToDoConduitContext, 1);
-
+	
 	ctxt->cfg = todoconduit_load_configuration (pilot_id);
 	ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg);
 	ctxt->gui = NULL;
@@ -399,13 +424,15 @@
 start_calendar_server (EToDoConduitContext *ctxt)
 {
 	g_return_val_if_fail (ctxt != NULL, -2);
-	
-	/* FIXME Need a mechanism for the user to select uri's */
-	/* FIXME Can we use the cal model? */
-	
-	if (!e_cal_open_default (&ctxt->client, E_CAL_SOURCE_TYPE_TODO, NULL, NULL, NULL))
+
+	if (ctxt->cfg->source) {
+		ctxt->client = e_cal_new (ctxt->cfg->source, E_CAL_SOURCE_TYPE_TODO);
+		if (!e_cal_open (ctxt->client, TRUE, NULL)) 
+			return -1;
+	} else if (!e_cal_open_default (&ctxt->client, E_CAL_SOURCE_TYPE_TODO, NULL, NULL, NULL)) {
 		return -1;
-	
+	}
+
 	return 0;
 }
 
@@ -1292,6 +1319,9 @@
 static void
 fill_widgets (EToDoConduitContext *ctxt)
 {
+	if (ctxt->cfg->source)
+		e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps), 
+					     ctxt->cfg->source);
 	e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
 				     ctxt->cfg->secret);
 
@@ -1304,8 +1334,11 @@
 			EToDoConduitContext *ctxt)
 {
 	LOG (g_message ( "create_settings_window" ));
+	
+	if (!ctxt->cfg->source_list)	
+		return -1;
 
-	ctxt->ps = e_pilot_settings_new ();
+	ctxt->ps = e_pilot_settings_new (ctxt->cfg->source_list);
 	ctxt->gui = e_todo_gui_new (E_PILOT_SETTINGS (ctxt->ps));
 
 	gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
@@ -1315,6 +1348,7 @@
 	
 	return 0;
 }
+
 static void
 display_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
 {
@@ -1328,6 +1362,9 @@
 {
 	LOG (g_message ( "save_settings" ));
 
+	if (ctxt->new_cfg->source)
+		g_object_unref (ctxt->new_cfg->source);
+	ctxt->new_cfg->source = e_pilot_settings_get_source (E_PILOT_SETTINGS (ctxt->ps));
 	ctxt->new_cfg->secret = e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
 	e_todo_gui_fill_config (ctxt->gui, ctxt->new_cfg);
 	
? addr-conduit.patch
? addr-name.patch
? contact-string.patch
? gui/component/ldap-config.gladep
? gui/component/select-names/select-names.gladep
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1801
diff -u -r1.1801 ChangeLog
--- ChangeLog	30 Jul 2004 18:06:17 -0000	1.1801
+++ ChangeLog	1 Aug 2004 19:44:57 -0000
@@ -1,3 +1,18 @@
+2004-08-01  JP Rosevear  <jpr novell com>
+
+	* conduit/address-conduit.c (addrconduit_load_configuration): get
+	source uid
+	(addrconduit_dupe_configuration): copy source_uid
+	(addrconduit_destroy_configuration): free source_uid
+	(e_addr_context_new): get the source list
+	(e_addr_context_destroy): unref the source list
+	(pre_sync): open the source that was set earlier
+	(fill_widgets): set the source option menu value
+	(create_settings_window): pass source list to pilot settings
+	(save_settings): save source uid
+
+	* conduit/Makefile.am: link to and include misc. widgets
+
 2004-07-30  Chris Toshok  <toshok ximian com>
 
 	[ fixes #61365 and other misc issues with the addressbook source
Index: conduit/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/conduit/Makefile.am,v
retrieving revision 1.38
diff -u -r1.38 Makefile.am
--- conduit/Makefile.am	1 Dec 2003 19:49:07 -0000	1.38
+++ conduit/Makefile.am	1 Aug 2004 19:44:57 -0000
@@ -5,6 +5,8 @@
 	-I$(top_builddir)/addressbook/backend	\
 	-I$(top_srcdir)/e-util			\
 	-I$(top_builddir)/e-util		\
+	-I$(top_srcdir)/widgets/misc		\
+	-I$(top_builddir)/widgets/misc		\
 	$(EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS)
 
 # Address Conduit
@@ -17,6 +19,7 @@
 libeaddress_conduit_la_LIBADD = 					\
 	$(top_builddir)/e-util/libeutil.la				\
 	$(top_builddir)/e-util/libeconduit.la		 		\
+	$(top_builddir)/widgets/misc/libemiscwidgets.la		 	\
 	$(top_builddir)/camel/libcamel.la	 			\
 	$(EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS)
 
Index: conduit/address-conduit.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/conduit/address-conduit.c,v
retrieving revision 1.85
diff -u -r1.85 address-conduit.c
--- conduit/address-conduit.c	21 Jun 2004 15:01:38 -0000	1.85
+++ conduit/address-conduit.c	1 Aug 2004 19:44:57 -0000
@@ -143,6 +143,8 @@
 	guint32 pilot_id;
 	GnomePilotConduitSyncType  sync_type;
 
+	ESourceList *source_list;
+	ESource *source;
 	gboolean secret;
 	EContactField default_address;
 
@@ -177,6 +179,20 @@
 	/* Custom settings */
 	gnome_config_push_prefix (prefix);
 
+	if (!e_book_get_addressbooks (&c->source_list, NULL))
+		c->source_list = NULL;
+	if (c->source_list) {
+		c->source = e_pilot_get_sync_source (c->source_list);
+		if (!c->source)
+			c->source = e_source_list_peek_source_any (c->source_list);
+		if (c->source) {
+			g_object_ref (c->source);
+		} else {
+			g_object_unref (c->source_list);
+			c->source_list = NULL;
+		}
+	}
+	
 	c->secret = gnome_config_get_bool ("secret=FALSE");
 	address = gnome_config_get_string ("default_address=business");
 	if (!strcmp (address, "business"))
@@ -202,6 +218,7 @@
 		    c->pilot_id);
 
 	gnome_config_push_prefix (prefix);
+	e_pilot_set_sync_source (c->source_list, c->source);
 	gnome_config_set_bool ("secret", c->secret);
 	switch (c->default_address) {
 	case E_CONTACT_ADDRESS_WORK:
@@ -234,6 +251,10 @@
 	retval->sync_type = c->sync_type;
 	retval->pilot_id = c->pilot_id;
 
+	if (c->source_list)	
+		retval->source_list = g_object_ref (c->source_list);
+	if (c->source)
+		retval->source = g_object_ref (c->source);
 	retval->secret = c->secret;
 	retval->default_address = c->default_address;
 	retval->last_uri = g_strdup (c->last_uri);
@@ -246,6 +267,8 @@
 {
 	g_return_if_fail (c != NULL);
 
+	g_object_unref (c->source_list);
+	g_object_unref (c->source);
 	g_free (c->last_uri);
 	g_free (c);
 }
@@ -1149,13 +1172,15 @@
 
 	ctxt->dbi = dbi;
 	
-	/* FIXME Need to allow our own concept of "local" */
-	ctxt->ebook = e_book_new_system_addressbook  (NULL);
-	if (!ctxt->ebook
-	    || !e_book_open (ctxt->ebook, FALSE, NULL)) {
+	if (ctxt->cfg->source) {
+		ctxt->ebook = e_book_new (ctxt->cfg->source, NULL);
+	} else {
+		ctxt->ebook = e_book_new_default_addressbook (NULL);
+	}
+	if (!ctxt->ebook || !e_book_open (ctxt->ebook, TRUE, NULL)) {
 		WARN(_("Could not load addressbook"));
 		gnome_pilot_conduit_error (conduit, _("Could not load addressbook"));
-
+		
 		return -1;
 	}
 
@@ -1617,6 +1642,9 @@
 static void
 fill_widgets (EAddrConduitContext *ctxt)
 {
+	if (ctxt->cfg->source)
+		e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps),
+					     ctxt->cfg->source);
 	e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
 				     ctxt->cfg->secret);
 
@@ -1629,8 +1657,11 @@
 			EAddrConduitContext *ctxt)
 {
 	LOG (g_message ( "create_settings_window" ));
+	
+	if (!ctxt->cfg->source_list)
+		return -1;
 
-	ctxt->ps = e_pilot_settings_new ();
+	ctxt->ps = e_pilot_settings_new (ctxt->cfg->source_list);
 	ctxt->gui = e_addr_gui_new (E_PILOT_SETTINGS (ctxt->ps));
 
 	gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
@@ -1651,8 +1682,11 @@
 static void
 save_settings    (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
 {
-	LOG (g_message ( "save_settings" ));
+        LOG (g_message ( "save_settings" ));
 
+       if (ctxt->new_cfg->source)
+               g_object_unref (ctxt->new_cfg->source);
+	ctxt->new_cfg->source = e_pilot_settings_get_source (E_PILOT_SETTINGS (ctxt->ps));
 	ctxt->new_cfg->secret =
 		e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
 	e_addr_gui_fill_config (ctxt->gui, ctxt->new_cfg);


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