[Tasks] Updated patch for Bug #324560
sam yang <[email protected]>
| Newsgroups | gmane.comp.gnome.evolution.patches |
|---|---|
| Organization | SCERI |
| Message-ID | <[email protected]> |
Hi, This updated patch is for Bug #324560: Evolution doesn't respect to change of show_task_preview in gconf. The last patch lost the changes made in calendar-config.h. So here it is the updated patch with these changes. Is there anyone who can review it? thanks Sam Yang _______________________________________________ Evolution-patches mailing list [email protected] http://mail.gnome.org/mailman/listinfo/evolution-patches
324560_updated.patch
(text/x-patch, 4.5 KB)
Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v retrieving revision 1.3000 diff -u -r1.3000 ChangeLog --- ChangeLog 24 Feb 2006 02:57:09 -0000 1.3000 +++ ChangeLog 27 Feb 2006 03:35:08 -0000 @@ -1,3 +1,14 @@ +2006-02-27 Sam Yang <[email protected]> + + 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-02-23 Chenthill Palanisamy <[email protected]> Fixes #330677 Index: gui/calendar-config.c =================================================================== RCS file: /cvs/gnome/evolution/calendar/gui/calendar-config.c,v retrieving revision 1.85 diff -u -r1.85 calendar-config.c --- gui/calendar-config.c 13 Jan 2006 11:02:13 -0000 1.85 +++ gui/calendar-config.c 27 Feb 2006 03:35: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.45 diff -u -r1.45 calendar-config.h --- gui/calendar-config.h 13 Jan 2006 11:02:10 -0000 1.45 +++ gui/calendar-config.h 27 Feb 2006 03:35: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.129 diff -u -r1.129 e-tasks.c --- gui/e-tasks.c 8 Feb 2006 13:06:02 -0000 1.129 +++ gui/e-tasks.c 27 Feb 2006 03:35:08 -0000 @@ -377,6 +377,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; @@ -401,6 +416,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 27 Feb 2006 03:35:08 -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.86 diff -u -r1.86 tasks-control.c --- gui/tasks-control.c 15 Feb 2006 06:35:46 -0000 1.86 +++ gui/tasks-control.c 27 Feb 2006 03:35:08 -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);