From a62fe63cc0754bb9a9ff8173aa6ab9f0a2fcdef5 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Wed, 23 Jun 2004 03:42:05 +0000 Subject: Add these two callbacks so that we can update the selection in the 2004-06-22 Rodney Dawes * gui/calendar-component.c (config_calendars_selection_changed_cb): (config_primary_calendar_selection_changed_cb): Add these two callbacks so that we can update the selection in the calendar when the gconf key changes, like we do for tasks (create_component_view): Register the two callbacks that we created for updating the selection in the view, and their notification IDs svn path=/trunk/; revision=26470 --- calendar/gui/calendar-component.c | 21 ++++++++++++++++ calendar/gui/dialogs/calendar-setup.glade | 40 +++++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 4 deletions(-) (limited to 'calendar') diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 8769016978..74852b18a3 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -570,6 +570,12 @@ config_primary_selection_changed_cb (GConfClient *client, guint id, GConfEntry * } } +static void +config_calendars_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) +{ + update_selection (data); +} + static void config_tasks_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { @@ -577,6 +583,12 @@ config_tasks_selection_changed_cb (GConfClient *client, guint id, GConfEntry *en } +static void +config_primary_calendar_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) +{ + update_primary_selection (data); +} + static void config_primary_tasks_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { @@ -1114,6 +1126,15 @@ create_component_view (CalendarComponent *calendar_component) update_task_selection (component_view); update_primary_task_selection (component_view); + /* If the calendar selection changes elsewhere, update it */ + not = calendar_config_add_notification_calendars_selected (config_calendars_selection_changed_cb, + component_view); + component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not)); + + not = calendar_config_add_notification_primary_calendar (config_primary_calendar_selection_changed_cb, + component_view); + component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not)); + /* If the task selection changes elsewhere, update it */ not = calendar_config_add_notification_tasks_selected (config_tasks_selection_changed_cb, component_view); diff --git a/calendar/gui/dialogs/calendar-setup.glade b/calendar/gui/dialogs/calendar-setup.glade index d001544ba7..a625828157 100644 --- a/calendar/gui/dialogs/calendar-setup.glade +++ b/calendar/gui/dialogs/calendar-setup.glade @@ -5,14 +5,19 @@ - 450 - 300 Add Calendar GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False + 320 + 240 True False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST @@ -106,6 +111,10 @@ 0.5 0 1 + 0 + 0 + 0 + 0 @@ -335,6 +344,7 @@ True False Pick a color + True 1 @@ -367,6 +377,7 @@ gtk-cancel True GTK_RELIEF_NORMAL + True @@ -376,6 +387,7 @@ True True GTK_RELIEF_NORMAL + True @@ -384,6 +396,10 @@ 0.5 0 0 + 0 + 0 + 0 + 0 @@ -446,14 +462,19 @@ - 450 - 300 Add Tasks Group GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False + 320 + 240 True False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST @@ -572,6 +593,7 @@ True False Pick a color + True 1 @@ -696,6 +718,10 @@ 0.5 0 1 + 0 + 0 + 0 + 0 @@ -809,6 +835,7 @@ gtk-cancel True GTK_RELIEF_NORMAL + True @@ -818,6 +845,7 @@ True True GTK_RELIEF_NORMAL + True @@ -826,6 +854,10 @@ 0.5 0 0 + 0 + 0 + 0 + 0 -- cgit