Fixes #324560 Request notification of changes to show_task_preview.

2006-03-03  Sam Yang  <sam.yang@sun.com>

        Fixes #324560
        * gui/calendar-config.[ch]:
        (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 notification request and store connection ID.

svn path=/trunk/; revision=31631
This commit is contained in:
Sam Yang
2006-03-03 13:24:39 +00:00
committed by Simon Zheng
parent c7ce7a09d0
commit 592f7b147e
4 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2006-03-03 Sam Yang <sam.yang@sun.com>
Fixes #324560
* gui/calendar-config.[ch]:
(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 notification request and store connection ID.
2006-02-17 Johnny Jacob <johnnyjacob@gmail.com>
Fixes #312423, #329749

View File

@ -658,6 +658,16 @@ calendar_config_set_preview_state (gboolean state)
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)
{

View File

@ -164,6 +164,7 @@ void calendar_config_set_vpane_pos (gint vpane_pos);
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);

View File

@ -376,6 +376,21 @@ view_done_cb (ECalModel *model, ECalendarStatus status, ECalSourceType type, ETa
}
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 (E_SEARCH_BAR (tasks->priv->search_bar)->ui_component, "/commands/ViewPreview", "state", state ? "1" : "0", NULL);
}
static void
setup_config (ETasks *tasks)
{
@ -401,6 +416,9 @@ setup_config (ETasks *tasks)
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