diff options
author | Gary Ekker <gekker@novell.com> | 2004-01-13 09:59:28 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2004-01-13 09:59:28 +0800 |
commit | 449f48576b556874742934cacfbc80c041ff12fd (patch) | |
tree | 373f3fbea0dcc0c4aa8756ce56d7b085a079b6c9 /calendar/gui/calendar-component.c | |
parent | 99f392e5f1db3f927ae93eef5ca657f5a3db7f72 (diff) | |
download | gsoc2013-evolution-449f48576b556874742934cacfbc80c041ff12fd.tar.gz gsoc2013-evolution-449f48576b556874742934cacfbc80c041ff12fd.tar.zst gsoc2013-evolution-449f48576b556874742934cacfbc80c041ff12fd.zip |
add e-pub-utils.[ch] for Free/Busy publishing
2004-01-12 Gary Ekker <gekker@novell.com>
* gui/Makefile.am: add e-pub-utils.[ch]
for Free/Busy publishing
* gui/apps_evolution_calendar.schemas.in.in: add schema for
/apps/evo/calendar/free_busy key
* gui/calendar-commands.c (publish_freebusy_cmd): change to
publish component rather than attach as email
* gui/calendar-config-keys.h: add free_busy/urls key definition
* gui/calendar-config.[ch] (calendar_config_get_free_busy): new
method for retrieving FB gconf key
(calendar_config_set_free_busy): new method for saving FB
gconf key
* gui/e-cal-view.c (on_publish): change to publish component
rather than attach as email
* gui/itip-utils.[ch] (itip_publish_begin): new method to process
e_cal_components and aggregate the data if we are publishing
for multiple calendars
(itip_publish_comp): new method to publish the ical data to an
http server via libsoup
(comp_fb_normalize): new static method to ensure rfc 2446
compliant
data before publishing icalcomponent_get_uid
(fb_sort): new static method to sort FB properties in ascending
order
* gui/dialogs/Makefile.am: add url-editor-dialog.[ch] and
url-editor-dialog.glade for configure FB publishing
* gui/dialogs/cal-prefs-dialog.[ch]
(cal_prefs_dialog_url_add_clicked):
(cal_prefs_dialog_url_edit_clicked):new method for events in FB
tab
of cal-prefs-dialog
(cal_prefs_dialog_url_remove_clicked): ditto
(cal_prefs_dialog_url_enable_clicked): ditto
(cal_prefs_dialog_url_url_list_change): ditto
(cal_prefs_dialog_url_url_list_enable_toggled): ditto
(cal_prefs_dialog_url_url_list_double_click): ditto
(show_fb_config): new method for updating dialog with FB specific
data in gconf
(update_fb_config): new method for updating gconf with FB specific
data from dialogs
(setup_changes): detect changes in url_list gtk_tree_view
(get_widgets): include new dialog widgets for FB config
(init_widgets): connect signals for new FB config widgets
* gui/dialogs/cal-prefs-dialog.glade: add new widgets for FB
config
* gui/dialogs/url-editor-dialog.[ch]: add files for FB url-editor
dialog
* gui/dialogs/url-editor-dialog.glade: ditto
* gui/e-pub-utils.[ch]: add files with FB publishing utilities
* gui/calendar-component.c (init_calendar_publishing): sets up
listeners to publish calendar, g_idle_add, and on gconf change
(init_calendar_publishing_cb): ditto
(conf_changed_callback): ditto
(impl_createControls): ditto
svn path=/trunk/; revision=24190
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r-- | calendar/gui/calendar-component.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 03725c560c..ddcff4165c 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -30,6 +30,8 @@ #include <bonobo/bonobo-control.h> #include <bonobo/bonobo-i18n.h> #include <bonobo/bonobo-exception.h> +#include "e-pub-utils.h" +#include "calendar-config-keys.h" #include "calendar-config.h" #include "calendar-component.h" #include "calendar-commands.h" @@ -59,6 +61,7 @@ struct _CalendarComponentPrivate { char *config_directory; GConfClient *gconf_client; + int gconf_notify_id; ESourceList *source_list; GSList *source_selection; @@ -435,6 +438,25 @@ config_primary_selection_changed_cb (GConfClient *client, guint id, GConfEntry * update_primary_selection (data); } +static gboolean +init_calendar_publishing_cb (gpointer data) +{ + /* Publish if it is time to publish again */ + e_pub_publish (FALSE); + + return FALSE; +} + +static void +conf_changed_callback (GConfClient *client, + unsigned int connection_id, + GConfEntry *entry, + void *user_data) +{ + /* publish config changed, so publish */ + e_pub_publish (TRUE); +} + /* GObject methods. */ static void @@ -582,6 +604,24 @@ impl_upgradeFromVersion (PortableServer_Servant servant, } static void +init_calendar_publishing (CalendarComponent *calendar_component) +{ + guint idle_id = 0; + CalendarComponentPrivate *priv; + + priv = calendar_component->priv; + + gconf_client_add_dir (priv->gconf_client, CALENDAR_CONFIG_PUBLISH, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + + priv->gconf_notify_id + = gconf_client_notify_add (priv->gconf_client, CALENDAR_CONFIG_PUBLISH, + (GConfClientNotifyFunc) conf_changed_callback, NULL, + NULL, NULL); + + idle_id = g_idle_add ((GSourceFunc) init_calendar_publishing_cb, GINT_TO_POINTER (idle_id)); +} + +static void impl_createControls (PortableServer_Servant servant, Bonobo_Control *corba_sidebar_control, Bonobo_Control *corba_view_control, @@ -629,6 +669,9 @@ impl_createControls (PortableServer_Servant servant, gtk_widget_show (statusbar_widget); statusbar_control = bonobo_control_new (statusbar_widget); + /* Initialize Calendar Publishing */ + init_calendar_publishing (calendar_component); + /* connect after setting the initial selections, or we'll get unwanted calls to calendar_control_sensitize_calendar_commands */ g_signal_connect_object (priv->source_selector, "selection_changed", |