diff options
-rw-r--r-- | calendar/ChangeLog | 5 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 37 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.h | 1 |
3 files changed, 43 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 1b7fec48bc..37aebb7644 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2003-10-22 Rodrigo Moya <rodrigo@ximian.com> + + * gui/gnome-cal.[ch] (gnome_calendar_remove_event_uri): new + function to remove calendars from the views. + 2003-10-22 Ettore Perazzoli <ettore@ximian.com> * gui/GNOME_Evolution_Calendar.server.in.in: Add an diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index bcefd8eeee..c28b965627 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2209,6 +2209,43 @@ gnome_calendar_add_event_uri (GnomeCalendar *gcal, const char *str_uri) return TRUE; } +/** + * gnome_calendar_remove_event_uri + * @gcal: A #GnomeCalendar. + * @str_uri: URI to be removed from the clients. + * + * Removes the given URI from the list of clients being shown by the + * calendar views. + * + * Returns: TRUE if successful, FALSE otherwise. + */ +gboolean +gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri) +{ + GnomeCalendarPrivate *priv; + int i; + + g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE); + g_return_val_if_fail (str_uri != NULL, FALSE); + + priv = gcal->priv; + + for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { + ECalModel *model; + CalClient *client; + + model = e_cal_view_get_model (priv->views[i]); + client = e_cal_model_get_client_for_uri (model, str_uri); + if (client) + e_cal_model_remove_client (model, client); + } + + /* update date navigator query */ + update_query (gcal); + + 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 diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index f56ec69211..f36bafd6d3 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -111,6 +111,7 @@ void gnome_calendar_set_default_client (GnomeCalendar *gcal, CalClient CalClient *gnome_calendar_get_task_pad_cal_client(GnomeCalendar *gcal); gboolean gnome_calendar_add_event_uri (GnomeCalendar *gcal, const char *str_uri); +gboolean gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri); void gnome_calendar_set_query (GnomeCalendar *gcal, const char *sexp); |