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 | |
parent | b467d0af35b230923dcd01a730e88a4a45f0d143 (diff) | |
download | gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.tar gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.tar.gz gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.tar.bz2 gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.tar.lz gsoc2013-evolution-f9e394b345c636056ade16b48ceac0b2e27b595d.tar.xz 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')
-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); |