aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorSam Yang <sam.yang@sun.com>2006-03-03 21:24:39 +0800
committerSimon Zheng <simonz@src.gnome.org>2006-03-03 21:24:39 +0800
commit592f7b147ef9546ddea75d7fe71a6950180eceff (patch)
treec65e391b1660a6393a1fbb578a44fb62615330f5 /calendar
parentc7ce7a09d004d290b291ba26310260d27806e6c7 (diff)
downloadgsoc2013-evolution-592f7b147ef9546ddea75d7fe71a6950180eceff.tar
gsoc2013-evolution-592f7b147ef9546ddea75d7fe71a6950180eceff.tar.gz
gsoc2013-evolution-592f7b147ef9546ddea75d7fe71a6950180eceff.tar.bz2
gsoc2013-evolution-592f7b147ef9546ddea75d7fe71a6950180eceff.tar.lz
gsoc2013-evolution-592f7b147ef9546ddea75d7fe71a6950180eceff.tar.xz
gsoc2013-evolution-592f7b147ef9546ddea75d7fe71a6950180eceff.tar.zst
gsoc2013-evolution-592f7b147ef9546ddea75d7fe71a6950180eceff.zip
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
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/calendar-config.c10
-rw-r--r--calendar/gui/calendar-config.h1
-rw-r--r--calendar/gui/e-tasks.c18
4 files changed, 38 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 9a8c1f024e..2758031801 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -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
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index e8de54d1af..c3af59e82f 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -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)
{
diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h
index e99265e784..4fd1fa4bd4 100644
--- a/calendar/gui/calendar-config.h
+++ b/calendar/gui/calendar-config.h
@@ -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);
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index 0b10001fc0..77056b7860 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -377,6 +377,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)
{
ETasksPrivate *priv;
@@ -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