From 98f0136ffa1428fb21c80dfa4568c88eebbdddc8 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Fri, 24 Oct 2003 13:31:00 +0000 Subject: update protos 2003-10-24 JP Rosevear * gui/gnome-cal.h: update protos * gui/gnome-cal.c (gnome_calendar_set_default_uri): set the default client based on uri * gui/calendar-component.c (add_uri_for_source): rename from load_uri_for_source and take a calendar (remove_uri_for_source): utility routine to remove the source's uri from the calendar (is_in_selection): checks to see if the uid of the given source matches any of those in the given selection (update_uris_for_selection): remove any uris no longer in the selection, add those that still exist (source_selection_changed_callback): call above (primary_source_selection_changed_callback): we have the calendar easily now; set the default by uri (control_activate_cb): handle activation and de-activation (impl_createControls): create the calendar control ourselves so we have access to the calendar (impl_dispose): release the source selection svn path=/trunk/; revision=23057 --- calendar/gui/gnome-cal.c | 67 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 22 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index b576365172..6e572484c8 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2024,28 +2024,6 @@ gnome_calendar_get_default_client (GnomeCalendar *gcal) return e_cal_model_get_default_client (e_cal_view_get_model (E_CAL_VIEW (gcal->priv->week_view))); } -/** - * gnome_calendar_set_default_client - * @gcal: A calendar view. - * @client: The client to use as default. - * - * Set the default client on the given calendar view. The default calendar will - * be used as the default when creating events in the view. - */ -void -gnome_calendar_set_default_client (GnomeCalendar *gcal, CalClient *client) -{ - int i; - - g_return_if_fail (GNOME_IS_CALENDAR (gcal)); - - for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { - e_cal_model_set_default_client ( - e_cal_view_get_model (E_CAL_VIEW (gcal->priv->views[i])), - client); - } -} - /** * gnome_calendar_get_task_pad_cal_client: * @gcal: A calendar view. @@ -2214,6 +2192,51 @@ gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri) return TRUE; } +/** + * gnome_calendar_set_default_uri + * @gcal: A calendar view. + * @client: The client to use as default. + * + * Set the default client on the given calendar view. The default calendar will + * be used as the default when creating events in the view. + */ + +/** + * gnome_calendar_set_default_uri: + * @gcal: A calendar view + * @uri: The uri to use as default + * + * Set the default uri on the given calendar view, the default uri + * will be used as the default when creating events in the view. + + * + * Return value: TRUE if the uri was already added and is set, FALSE + * otherwise + **/ +gboolean +gnome_calendar_set_default_uri (GnomeCalendar *gcal, const char *uri) +{ + GnomeCalendarPrivate *priv; + CalClient *client; + int i; + + g_return_if_fail (GNOME_IS_CALENDAR (gcal)); + + priv = gcal->priv; + + client = g_hash_table_lookup (priv->clients, uri); + if (!client) + return FALSE; + + for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { + e_cal_model_set_default_client ( + e_cal_view_get_model (E_CAL_VIEW (priv->views[i])), + client); + } + + return TRUE; +} + /* Tells the calendar to reload all config settings. If initializing is TRUE it sets the pane positions as well. (We don't want to reset the pane positions after the user clicks 'Apply' in the -- cgit v1.2.3