diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2003-10-23 15:40:08 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2003-10-23 15:40:08 +0800 |
commit | f9e394b345c636056ade16b48ceac0b2e27b595d (patch) | |
tree | cca07cbe38783a0cd5446d1bd76f07dd936c270b /calendar/gui/gnome-cal.c | |
parent | b467d0af35b230923dcd01a730e88a4a45f0d143 (diff) | |
download | gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.tar.gz gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.tar.zst gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.zip |
new function to remove calendars from the views.
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.
svn path=/trunk/; revision=23027
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 37 |
1 files changed, 37 insertions, 0 deletions
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 |