aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-meeting-time-sel.c
diff options
context:
space:
mode:
authorJames Bowes <bowes@cs.dal.ca>2004-12-18 21:01:17 +0800
committerJames Bowes <jbowes@src.gnome.org>2004-12-18 21:01:17 +0800
commitd41f4a6bfc66b854fdd45a78fd63fd3a2eda376d (patch)
treeb15fc8c24217cee59cea9c58ac1cfe89edd9d7fe /calendar/gui/e-meeting-time-sel.c
parent9642ecd2f1d390fafe6ac4bcb6f42ff5d4f42d38 (diff)
downloadgsoc2013-evolution-d41f4a6bfc66b854fdd45a78fd63fd3a2eda376d.tar.gz
gsoc2013-evolution-d41f4a6bfc66b854fdd45a78fd63fd3a2eda376d.tar.zst
gsoc2013-evolution-d41f4a6bfc66b854fdd45a78fd63fd3a2eda376d.zip
Add schema for Free/Busy template uri.
2004-12-18 James Bowes <bowes@cs.dal.ca> * gui/apps_evolution_calendar.schemas.in.in: Add schema for Free/Busy template uri. * gui/calendar-config-keys.h: * gui/calendar-config.c: (calendar_config_get_free_busy_template), (calendar_config_set_free_busy_template), (calendar_config_add_notification_free_busy_template): * gui/calendar-config.h: Functions to get, set and monitor the Free/Busy template uri gconf setting. * gui/dialogs/cal-prefs-dialog.c: (template_url_changed), (setup_changes), (get_widgets), (show_fb_config): * gui/dialogs/cal-prefs-dialog.glade: * gui/dialogs/cal-prefs-dialog.h: Change 'Free/Busy Publish' tab to 'Free/Busy'. Add an entry for setting the default Free/Busy uri. Only change the gconf setting on 'focus out' event * gui/e-meeting-store.c: (refresh_queue_remove): Check the hash using the attendee's mailto: address, rather than the memory address of the attendee object as the key. (e_meeting_store_get_fb_uri), (e_meeting_store_set_fb_uri): Get and set the EMeetingStore's Free/Busy template string. (process_callbacks_main_thread), (process_callbacks): Process callbacks in the main thread, so that widgets can be redrawn properly. (replace_string): Utility function for replacing wildcards in the default Free/Busy uri. (ems_finalize), (ems_init), (freebusy_async), (refresh_busy_periods), (refresh_queue_add), (e_meeting_store_refresh_busy_periods): Add the ability to check for Free/Busy information from a default location, if all else fails. (start_async_read): Use gnome-vfs to read the Free/Busy information. * gui/e-meeting-store.h: Add function prototypes for get and set fb_uri * gui/e-meeting-time-sel.c: (e_meeting_time_selector_init), (e_meeting_time_selector_destroy), (free_busy_timeout_refresh), (free_busy_template_changed_cb): Watch for a change in the Free/Busy template gconf setting, and check for new Free/Busy data if it occurs. * gui/e-meeting-time-sel.h: Include variable for notification function id on changes to the Free/Busy uri in the EMeetingTimeSelector . svn path=/trunk/; revision=28151
Diffstat (limited to 'calendar/gui/e-meeting-time-sel.c')
-rw-r--r--calendar/gui/e-meeting-time-sel.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 0ae13bf07f..5f92ab6a63 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -207,6 +207,9 @@ static void row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter
static void row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
static void row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data);
+static void free_busy_template_changed_cb (GConfClient *client, guint cnxn_id,
+ GConfEntry *entry, gpointer user_data);
+
G_DEFINE_TYPE (EMeetingTimeSelector, e_meeting_time_selector, GTK_TYPE_TABLE);
static void
@@ -252,6 +255,12 @@ e_meeting_time_selector_init (EMeetingTimeSelector * mts)
mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_NONE;
mts->list_view = NULL;
+
+ mts->fb_uri_not =
+ calendar_config_add_notification_free_busy_template ((GConfClientNotifyFunc) free_busy_template_changed_cb,
+ mts);
+
+ mts->fb_refresh_not = 0;
}
@@ -825,6 +834,12 @@ e_meeting_time_selector_destroy (GtkObject *object)
mts->display_top = NULL;
mts->display_main = NULL;
+
+ calendar_config_remove_notification (mts->fb_uri_not);
+
+ if (mts->fb_refresh_not != 0) {
+ g_source_remove (mts->fb_refresh_not);
+ }
if (GTK_OBJECT_CLASS (e_meeting_time_selector_parent_class)->destroy)
(*GTK_OBJECT_CLASS (e_meeting_time_selector_parent_class)->destroy)(object);
@@ -2877,3 +2892,42 @@ row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data)
gtk_widget_queue_draw (mts->display_main);
}
+
+#define REFRESH_PAUSE 5000
+
+static gboolean
+free_busy_timeout_refresh (gpointer data)
+{
+ char *fb_uri;
+
+ EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data);
+
+ fb_uri = calendar_config_get_free_busy_template ();
+ e_meeting_store_set_fb_uri (mts->model, fb_uri);
+ g_free (fb_uri);
+
+ /* Update all free/busy info, so we use the new template uri */
+ e_meeting_time_selector_refresh_free_busy (mts, 0, TRUE);
+
+ mts->fb_refresh_not = 0;
+
+ return FALSE;
+}
+
+static void
+free_busy_template_changed_cb (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer data)
+{
+ EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data);
+
+ /* Wait REFRESH_PAUSE before refreshing, using the latest uri value */
+ if (mts->fb_refresh_not != 0) {
+ g_source_remove (mts->fb_refresh_not);
+ }
+
+ mts->fb_refresh_not = g_timeout_add (REFRESH_PAUSE,
+ free_busy_timeout_refresh,
+ data);
+}