From d41f4a6bfc66b854fdd45a78fd63fd3a2eda376d Mon Sep 17 00:00:00 2001 From: James Bowes Date: Sat, 18 Dec 2004 13:01:17 +0000 Subject: Add schema for Free/Busy template uri. 2004-12-18 James Bowes * 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 --- calendar/gui/dialogs/cal-prefs-dialog.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'calendar/gui/dialogs/cal-prefs-dialog.c') diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index 6c5062a881..79a825ef73 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -370,6 +370,14 @@ url_list_changed (DialogData *dialog_data) g_slist_free (url_list); } +static void +template_url_changed (GtkEntry *entry, DialogData *dialog_data) +{ + calendar_config_set_free_busy_template (gtk_entry_get_text (entry)); + + return FALSE; +} + static void setup_changes (DialogData *dialog_data) { @@ -412,6 +420,8 @@ setup_changes (DialogData *dialog_data) G_CALLBACK (default_reminder_interval_changed), dialog_data); g_signal_connect (GTK_OPTION_MENU (dialog_data->default_reminder_units)->menu, "selection-done", G_CALLBACK (default_reminder_units_changed), dialog_data); + + g_signal_connect (dialog_data->template_url, "changed", G_CALLBACK (template_url_changed), dialog_data); } /* Gets the widgets from the XML file and returns if they are all available. @@ -463,6 +473,8 @@ get_widgets (DialogData *data) data->url_enable = GW ("url_enable"); data->url_list = GTK_TREE_VIEW (GW ("url_list")); + data->template_url = GW("template_url"); + #undef GW return (data->page @@ -859,6 +871,7 @@ show_fb_config (DialogData *dialog_data) GSList *url_config_list = NULL; GtkListStore *model; GtkTreeIter iter; + gchar *template_url; model = (GtkListStore *) gtk_tree_view_get_model (dialog_data->url_list); gtk_list_store_clear (model); @@ -910,6 +923,11 @@ show_fb_config (DialogData *dialog_data) g_slist_foreach (url_config_list, (GFunc) g_free, NULL); g_slist_free (url_config_list); + + template_url = calendar_config_get_free_busy_template (); + gtk_entry_set_text (GTK_ENTRY (dialog_data->template_url), template_url); + + g_free (template_url); } /* Shows the current task list settings in the dialog */ -- cgit v1.2.3