Re: [evolution-patches] [Tasks] Fixes Bug #324560



Hi, Chenthill and all
I've added what was lost in last patch. Pls review the refined one.

thanks, Sam Yang

On Wed, 2006-01-11 at 14:05, chen wrote:
> On Wed, 2005-12-21 at 15:54 +0800, sam yang wrote:
> > CALENDAR_CONFIG_TASK_PREVIEW,
> please include the changes made in calendar-config.h and
> calendar-config-keys.h
Here is the refined patch with the changes in calendar-config.h.
But is there any need to change calendar-config-keys.h? In line 57, we
have: #define CALENDAR_CONFIG_TASK_PREVIEW CALENDAR_CONFIG_PREFIX
"/display/show_task_preview".
> 
> thanks, Chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2928
diff -u -r1.2928 ChangeLog
--- ChangeLog	12 Jan 2006 15:08:39 -0000	1.2928
+++ ChangeLog	13 Jan 2006 07:11:08 -0000
@@ -1,3 +1,14 @@
+2006-01-13  Sam Yang  <sam yang sun com>
+
+	Fixes #324560	
+	* gui/calendar-config.h:
+	* gui/calendar-config.c:
+	(calendar_config_add_notification_preview_state): Request notification of changes to show_task_preview.
+	* gui/e-tasks.c: (config_preview_state_changed_cb):Callback function.
+	(setup_config): Send request and store connection ID.
+	* gui/e-tasks.h:
+	* gui/tasks-control.c: (tasks_control_activate): Gain access to the Bonobo UI of Tasks view through ETasks.
+
 2006-01-12  Srinivasa Ragavan  <sragavan novell com>
 
 	* gui/GNOME_Evolution_Calendar.server.in.in:
Index: gui/calendar-config.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-config.c,v
retrieving revision 1.84
diff -u -r1.84 calendar-config.c
--- gui/calendar-config.c	10 Jan 2006 08:08:21 -0000	1.84
+++ gui/calendar-config.c	13 Jan 2006 07:11:08 -0000
@@ -658,6 +658,16 @@
 	gconf_client_set_bool (config, CALENDAR_CONFIG_TASK_PREVIEW, state, NULL);
 }
 
+guint
+calendar_config_add_notification_preview_state (GConfClientNotifyFunc func, gpointer data)
+{
+	guint id;
+
+	id = gconf_client_notify_add (config, CALENDAR_CONFIG_TASK_PREVIEW, func, data, NULL, NULL);
+
+	return id;
+}
+
 gint
 calendar_config_get_month_hpane_pos	(void)
 {
Index: gui/calendar-config.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-config.h,v
retrieving revision 1.44
diff -u -r1.44 calendar-config.h
--- gui/calendar-config.h	16 Nov 2005 13:53:46 -0000	1.44
+++ gui/calendar-config.h	13 Jan 2006 07:11:08 -0000
@@ -164,6 +164,7 @@
 
 gboolean  calendar_config_get_preview_state	(void);
 void	  calendar_config_set_preview_state	(gboolean     state);
+guint	  calendar_config_add_notification_preview_state (GConfClientNotifyFunc func, gpointer data);		
 
 gint      calendar_config_get_month_hpane_pos	(void);
 void	  calendar_config_set_month_hpane_pos	(gint	      hpane_pos);
Index: gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.128
diff -u -r1.128 e-tasks.c
--- gui/e-tasks.c	2 Jan 2006 09:49:25 -0000	1.128
+++ gui/e-tasks.c	13 Jan 2006 07:11:09 -0000
@@ -380,6 +380,21 @@
 }
 
 static void
+config_preview_state_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
+{
+	gboolean state;
+	GConfValue *value;
+	ETasks *tasks = (ETasks *)data;
+
+	g_return_if_fail (gconf_entry_get_key (entry) != NULL);
+	g_return_if_fail ((value = gconf_entry_get_value (entry)) != NULL);
+
+	state = gconf_value_get_bool (value);
+	e_tasks_show_preview (tasks, state);
+	bonobo_ui_component_set_prop (tasks->uic, "/commands/ViewPreview", "state", state ? "1" : "0", NULL);
+}
+
+static void
 setup_config (ETasks *tasks)
 {
 	ETasksPrivate *priv;
@@ -404,6 +419,9 @@
 	not = calendar_config_add_notification_hide_completed_tasks_value (config_hide_completed_tasks_changed_cb, 
 							      tasks);
 	priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));	
+
+	not = calendar_config_add_notification_preview_state (config_preview_state_changed_cb, tasks);
+	priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
 }
 
 static void
Index: gui/e-tasks.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.h,v
retrieving revision 1.26
diff -u -r1.26 e-tasks.h
--- gui/e-tasks.h	6 Oct 2005 18:21:51 -0000	1.26
+++ gui/e-tasks.h	13 Jan 2006 07:11:09 -0000
@@ -47,6 +47,9 @@
 
 	/* Private data */
 	ETasksPrivate *priv;
+
+	/* if we're active, this will be set */
+	BonoboUIComponent *uic;
 };
 
 struct _ETasksClass {
Index: gui/tasks-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-control.c,v
retrieving revision 1.85
diff -u -r1.85 tasks-control.c
--- gui/tasks-control.c	26 Nov 2005 02:31:50 -0000	1.85
+++ gui/tasks-control.c	13 Jan 2006 07:11:09 -0000
@@ -268,6 +268,7 @@
 
 	uic = bonobo_control_get_ui_component (control);
 	g_assert (uic != NULL);
+	tasks->uic = uic;
 
 	remote_uih = bonobo_control_get_remote_ui_container (control, NULL);
 	bonobo_ui_component_set_container (uic, remote_uih, NULL);


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