[evolution-patches] Pilot Settings



So the pilot settings needed a way to set the calendar/address
book/tasks source to sync with.

a) the breaks string freeze
b) this is late but i got too busy doing the release yesterday to do it 

-JP
-- 
JP Rosevear <jpr novell com>
Novell, Inc.
? 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.1794
diff -u -r1.1794 ChangeLog
--- ChangeLog	19 Jul 2004 17:23:46 -0000	1.1794
+++ ChangeLog	20 Jul 2004 15:43:20 -0000
@@ -1,3 +1,18 @@
+2004-07-20  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-16  Hans Petter Jansson  <hpj ximian com>
 
 	* gui/contact-editor/e-contact-editor.c (contact_added_cb)
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	20 Jul 2004 15:43:20 -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	20 Jul 2004 15:43:20 -0000
@@ -143,6 +143,7 @@
 	guint32 pilot_id;
 	GnomePilotConduitSyncType  sync_type;
 
+	char *source_uid;
 	gboolean secret;
 	EContactField default_address;
 
@@ -177,6 +178,7 @@
 	/* Custom settings */
 	gnome_config_push_prefix (prefix);
 
+	c->source_uid = gnome_config_get_string ("source_uid");
 	c->secret = gnome_config_get_bool ("secret=FALSE");
 	address = gnome_config_get_string ("default_address=business");
 	if (!strcmp (address, "business"))
@@ -202,6 +204,7 @@
 		    c->pilot_id);
 
 	gnome_config_push_prefix (prefix);
+	gnome_config_set_string ("source_uid", c->source_uid);
 	gnome_config_set_bool ("secret", c->secret);
 	switch (c->default_address) {
 	case E_CONTACT_ADDRESS_WORK:
@@ -234,6 +237,7 @@
 	retval->sync_type = c->sync_type;
 	retval->pilot_id = c->pilot_id;
 
+	retval->source_uid = g_strdup (c->source_uid);
 	retval->secret = c->secret;
 	retval->default_address = c->default_address;
 	retval->last_uri = g_strdup (c->last_uri);
@@ -246,6 +250,7 @@
 {
 	g_return_if_fail (c != NULL);
 
+	g_free (c->source_uid);
 	g_free (c->last_uri);
 	g_free (c);
 }
@@ -334,6 +339,7 @@
 
 	EAddrConduitCfg *cfg;
 	EAddrConduitCfg *new_cfg;
+	ESourceList *source_list;
 	EAddrConduitGui *gui;
 	GtkWidget *ps;
 	
@@ -355,6 +361,8 @@
 
 	ctxt->cfg = addrconduit_load_configuration (pilot_id);
 	ctxt->new_cfg = addrconduit_dupe_configuration (ctxt->cfg);
+       if (!e_book_get_addressbooks (&ctxt->source_list, NULL))
+               ctxt->source_list = NULL;
 	ctxt->gui = NULL;
 	ctxt->ps = NULL;
 	ctxt->ebook = NULL;
@@ -378,6 +386,8 @@
 		addrconduit_destroy_configuration (ctxt->cfg);
 	if (ctxt->new_cfg != NULL)
 		addrconduit_destroy_configuration (ctxt->new_cfg);
+	if (ctxt->source_list != NULL)
+		g_object_unref (ctxt->source_list);
 	if (ctxt->gui != NULL)
 		e_addr_gui_destroy (ctxt->gui);
 	
@@ -1149,13 +1159,19 @@
 
 	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)) {
+	ESource *source = NULL;
+	if (ctxt->cfg->source_uid)
+		source = e_source_list_peek_source_by_uid (ctxt->source_list, ctxt->cfg->source_uid);
+	
+	if (source) {
+		ctxt->ebook = e_book_new (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 +1633,13 @@
 static void
 fill_widgets (EAddrConduitContext *ctxt)
 {
+	ESource *source = NULL;
+	
+	if (ctxt->cfg->source_uid)
+		source = e_source_list_peek_source_by_uid (ctxt->source_list, ctxt->cfg->source_uid);
+	if (source)
+		e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps),
+					     source);
 	e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
 				     ctxt->cfg->secret);
 
@@ -1629,8 +1652,11 @@
 			EAddrConduitContext *ctxt)
 {
 	LOG (g_message ( "create_settings_window" ));
+	
+	if (!ctxt->source_list)
+		return -1;
 
-	ctxt->ps = e_pilot_settings_new ();
+	ctxt->ps = e_pilot_settings_new (ctxt->source_list);
 	ctxt->gui = e_addr_gui_new (E_PILOT_SETTINGS (ctxt->ps));
 
 	gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
@@ -1651,8 +1677,12 @@
 static void
 save_settings    (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
 {
-	LOG (g_message ( "save_settings" ));
+	ESource *source;
 
+        LOG (g_message ( "save_settings" ));
+	
+	source = e_pilot_settings_get_source (E_PILOT_SETTINGS (ctxt->ps));
+	ctxt->new_cfg->source_uid = g_strdup (e_source_peek_uid (source));
 	ctxt->new_cfg->secret =
 		e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
 	e_addr_gui_fill_config (ctxt->gui, ctxt->new_cfg);
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2450
diff -u -r1.2450 ChangeLog
--- ChangeLog	19 Jul 2004 22:02:28 -0000	1.2450
+++ ChangeLog	20 Jul 2004 15:44:45 -0000
@@ -1,3 +1,22 @@
+2004-07-20  JP Rosevear  <jpr novell com>
+
+	* conduits/todo/todo-conduit.c (todoconduit_load_configuration):
+	get source uid
+	(todoconduit_dupe_configuration): copy source_uid
+	(todoconduit_destroy_configuration): free source_uid
+	(e_todo_context_new): get the source list
+	(e_todo_context_destroy): unref the source list
+	(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): save source uid
+
+	* conduits/calendar/calendar-conduit.c: as above
+	
+	* conduits/todo/Makefile.am: link to and include misc. widgets
+
+	* conduits/calendar/Makefile.am: ditto	
+
 2004-07-16  JP Rosevear  <jpr novell com>
 
 	Fixes #61451
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	20 Jul 2004 15:44:45 -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	20 Jul 2004 15:44:46 -0000
@@ -94,6 +94,7 @@
 	guint32 pilot_id;
 	GnomePilotConduitSyncType  sync_type;
 
+	char *source_uid;
 	gboolean secret;
 	gboolean multi_day_split;
 	
@@ -130,6 +131,7 @@
 	g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", pilot_id);
 	gnome_config_push_prefix (prefix);
 
+	c->source_uid = gnome_config_get_string ("source_uid");
 	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 +166,7 @@
 	g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", c->pilot_id);
 	gnome_config_push_prefix (prefix);
 
+	gnome_config_set_string ("source_uid", c->source_uid);
 	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 +187,8 @@
 	retval = g_new0 (ECalConduitCfg, 1);
 	retval->pilot_id = c->pilot_id;
 	retval->sync_type = c->sync_type;
+
+	retval->source_uid = c->source_uid;
 	retval->secret = c->secret;
 	retval->multi_day_split = c->multi_day_split;
 	retval->last_uri = g_strdup (c->last_uri);
@@ -196,6 +201,7 @@
 {
 	g_return_if_fail (c != NULL);
 
+	g_free (c->source_uid);
 	g_free (c->last_uri);
 	g_free (c);
 }
@@ -261,6 +267,7 @@
 
 	ECalConduitCfg *cfg;
 	ECalConduitCfg *new_cfg;
+	ESourceList *source_list;
 	ECalConduitGui *gui;
 	GtkWidget *ps;
 	
@@ -288,6 +295,8 @@
 	
 	ctxt->cfg = calconduit_load_configuration (pilot_id);
 	ctxt->new_cfg = calconduit_dupe_configuration (ctxt->cfg);
+	if (!e_cal_get_sources (&ctxt->source_list, E_CAL_SOURCE_TYPE_EVENT, NULL))
+		ctxt->source_list = NULL;
 	ctxt->ps = NULL;
 	ctxt->dbi = NULL;
 	ctxt->client = NULL;
@@ -321,6 +330,8 @@
 		calconduit_destroy_configuration (ctxt->cfg);
 	if (ctxt->new_cfg != NULL)
 		calconduit_destroy_configuration (ctxt->new_cfg);
+	if (ctxt->source_list != NULL)
+		g_object_unref (ctxt->source_list);
 	if (ctxt->gui != NULL)
 		e_cal_gui_destroy (ctxt->gui);
 
@@ -406,15 +417,24 @@
 static int
 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))
-		return -1;
-	
-	return 0;
+       ESource *source = NULL;
+
+       g_return_val_if_fail (ctxt != NULL, -2);
+
+       if (ctxt->cfg->source_uid)
+	       source = e_source_list_peek_source_by_uid (ctxt->source_list, ctxt->cfg->source_uid);
+       
+       if (source) {
+               ctxt->client = e_cal_new (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;
+
 }
 
 /* Utility routines */
@@ -1801,6 +1821,14 @@
 static void
 fill_widgets (ECalConduitContext *ctxt)
 {
+	ESource *source = NULL;
+
+	if (ctxt->cfg->source_uid)
+		source = e_source_list_peek_source_by_uid (ctxt->source_list, ctxt->cfg->source_uid);
+	if (source)
+		e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps),
+					     source);
+	
 	e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
 				     ctxt->cfg->secret);
 
@@ -1813,8 +1841,11 @@
 			ECalConduitContext *ctxt)
 {
 	LOG (g_message ( "create_settings_window" ));
+	
+	if (!ctxt->source_list)
+		return -1;
 
-	ctxt->ps = e_pilot_settings_new ();
+	ctxt->ps = e_pilot_settings_new (ctxt->source_list);
 	ctxt->gui = e_cal_gui_new (E_PILOT_SETTINGS (ctxt->ps));
 
 	gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
@@ -1835,8 +1866,12 @@
 static void
 save_settings    (GnomePilotConduit *conduit, ECalConduitContext *ctxt)
 {
-	LOG (g_message ( "save_settings" ));
-
+	ESource *source;
+	
+        LOG (g_message ( "save_settings" ));
+	
+	source = e_pilot_settings_get_source (E_PILOT_SETTINGS (ctxt->ps));
+	ctxt->new_cfg->source_uid = g_strdup (e_source_peek_uid (source));
 	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	20 Jul 2004 15:44:46 -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	20 Jul 2004 15:44:46 -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,7 @@
 	guint32 pilot_id;
 	GnomePilotConduitSyncType  sync_type;
 
+	char *source_uid;
 	gboolean secret;
 	gint priority;
 
@@ -131,6 +132,7 @@
 	/* Custom settings */
 	gnome_config_push_prefix (prefix);
 
+	c->source_uid = gnome_config_get_string ("source_uid");
 	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 +151,7 @@
 		    c->pilot_id);
 
 	gnome_config_push_prefix (prefix);
+	gnome_config_set_string ("source_uid", c->source_uid);
 	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 +172,7 @@
 	retval->sync_type = c->sync_type;
 	retval->pilot_id = c->pilot_id;
 
+	retval->source_uid = g_strdup (c->source_uid);
 	retval->secret = c->secret;
 	retval->priority = c->priority;
 	retval->last_uri = g_strdup (c->last_uri);
@@ -181,6 +185,7 @@
 {
 	g_return_if_fail (c != NULL);
 
+	g_free (c->source_uid);
 	g_free (c->last_uri);
 	g_free (c);
 }
@@ -249,6 +254,7 @@
 
 	EToDoConduitCfg *cfg;
 	EToDoConduitCfg *new_cfg;
+	ESourceList *source_list;
 	EToDoConduitGui *gui;
 	GtkWidget *ps;
 	
@@ -273,6 +279,8 @@
 
 	ctxt->cfg = todoconduit_load_configuration (pilot_id);
 	ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg);
+	if (!e_cal_get_sources (&ctxt->source_list, E_CAL_SOURCE_TYPE_TODO, NULL))
+		ctxt->source_list = NULL;
 	ctxt->gui = NULL;
 	ctxt->ps = NULL;
 	ctxt->client = NULL;
@@ -306,6 +314,8 @@
 		todoconduit_destroy_configuration (ctxt->cfg);
 	if (ctxt->new_cfg != NULL)
 		todoconduit_destroy_configuration (ctxt->new_cfg);
+	if (ctxt->source_list != NULL)
+		g_object_unref (ctxt->source_list);
 	if (ctxt->gui != NULL)
 		e_todo_gui_destroy (ctxt->gui);
 	
@@ -398,14 +408,21 @@
 static int
 start_calendar_server (EToDoConduitContext *ctxt)
 {
-	g_return_val_if_fail (ctxt != NULL, -2);
+	ESource *source = NULL;
 	
-	/* FIXME Need a mechanism for the user to select uri's */
-	/* FIXME Can we use the cal model? */
+	g_return_val_if_fail (ctxt != NULL, -2);
 	
-	if (!e_cal_open_default (&ctxt->client, E_CAL_SOURCE_TYPE_TODO, NULL, NULL, NULL))
+	if (ctxt->cfg->source_uid)
+		source = e_source_list_peek_source_by_uid (ctxt->source_list, ctxt->cfg->source_uid);
+
+	if (source) {
+		ctxt->client = e_cal_new (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 +1309,13 @@
 static void
 fill_widgets (EToDoConduitContext *ctxt)
 {
+	ESource *source = NULL;
+	
+	if (ctxt->cfg->source_uid)
+		source = e_source_list_peek_source_by_uid (ctxt->source_list, ctxt->cfg->source_uid);
+	if (source)
+		e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps), 
+					     source);
 	e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
 				     ctxt->cfg->secret);
 
@@ -1304,8 +1328,11 @@
 			EToDoConduitContext *ctxt)
 {
 	LOG (g_message ( "create_settings_window" ));
+	
+	if (!ctxt->source_list)	
+		return -1;
 
-	ctxt->ps = e_pilot_settings_new ();
+	ctxt->ps = e_pilot_settings_new (ctxt->source_list);
 	ctxt->gui = e_todo_gui_new (E_PILOT_SETTINGS (ctxt->ps));
 
 	gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
@@ -1315,6 +1342,7 @@
 	
 	return 0;
 }
+
 static void
 display_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
 {
@@ -1326,8 +1354,12 @@
 static void
 save_settings    (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
 {
+	ESource *source;
+	
 	LOG (g_message ( "save_settings" ));
 
+	source = e_pilot_settings_get_source (E_PILOT_SETTINGS (ctxt->ps));	
+	ctxt->new_cfg->source_uid = g_strdup (e_source_peek_uid (source));
 	ctxt->new_cfg->secret = e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
 	e_todo_gui_fill_config (ctxt->gui, ctxt->new_cfg);
 	
? 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.319
diff -u -r1.319 ChangeLog
--- ChangeLog	16 Jul 2004 08:11:59 -0000	1.319
+++ ChangeLog	20 Jul 2004 15:50:08 -0000
@@ -1,3 +1,16 @@
+2004-07-20  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-16  Chris Toshok  <toshok ximian com>
 
 	* e-clipped-label.c (e_clipped_label_recalc_chars_displayed):
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	20 Jul 2004 15:50:08 -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	20 Jul 2004 15:50:08 -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	20 Jul 2004 15:50:08 -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
? ps-util.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
retrieving revision 1.471
diff -u -r1.471 ChangeLog
--- ChangeLog	14 Jul 2004 15:19:58 -0000	1.471
+++ ChangeLog	20 Jul 2004 15:46:46 -0000
@@ -1,3 +1,7 @@
+2004-07-20  JP Rosevear  <jpr novell com>
+
+	* Makefile.am (eutilincludedir): don't build pilot settings
+
 2004-07-12  Dan Winship  <danw novell com>
 
 	* e-mktemp.c (e_mktemp, e_mkdtemp): un-const the return values,
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	20 Jul 2004 15:46:46 -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_ */


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