From 6a70408ad082eae0acbb9e1d367a934abf7cf6fb Mon Sep 17 00:00:00 2001 From: Veerapuram Varadhan Date: Mon, 11 Jul 2005 16:23:57 +0000 Subject: Added support for opening a calendar-item in the editor when its ESource * Added support for opening a calendar-item in the editor when its ESource id and ECalComponent id/rid are passed in the invocation URI. svn path=/trunk/; revision=29722 --- calendar/gui/gnome-cal.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index a672b534ff..51b54126e8 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -3393,3 +3393,39 @@ ECalMenu *gnome_calendar_get_calendar_menu (GnomeCalendar *gcal) return gcal->priv->calendar_menu; } + +void +gnome_calendar_edit_appointment (GnomeCalendar *gcal, + const char* src_uid, + const char* comp_uid, + const char* comp_rid) +{ + ECal *client = NULL; + GList *l; + icalcomponent* icalcomp = NULL; + icalproperty *attendee_prop = NULL; + + if (!src_uid || !comp_uid) + return; + + for (l = gcal->priv->clients_list[E_CAL_SOURCE_TYPE_EVENT]; l != NULL; l = l->next) { + client = l->data; + ESource *client_src = e_cal_get_source (client); + + if (!strcmp (src_uid, e_source_peek_uid (client_src))) + break; + } + + if (!client) + return; + + e_cal_get_object (client, comp_uid, comp_rid, &icalcomp, NULL); + + if (!icalcomp) + return; + + attendee_prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); + e_calendar_view_edit_appointment (gcal->priv->views[gcal->priv->current_view_type], + client, icalcomp, attendee_prop ? TRUE:FALSE); + icalcomponent_free (icalcomp); +} -- cgit v1.2.3