From 3799134926a1db309a2b46706d8a33581999f778 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Thu, 14 May 1998 23:12:10 +0000 Subject: Do not add the spurious padding. 1998-05-14 Miguel de Icaza * timeutil.c (isodate_from_time_t): Do not add the spurious padding. * calobj.c (store_date_list): Bug fix: I was using the wrong pointer when saving the exception date list. (set_date_list): Bug fix: load correctly the complete exception date list. (set_date_list): Use ',' for the exception date separator as the versit people can not get their standard right. * gncal-full-day.c (unrecur_appointment): Support for making an existing recurrent event `movable' for a day. * calobj.c (ical_object_add_exdate): New routine, used to add exception dates. (ical_object_duplicate): New routine: used to do the magic recur->no-recur event. svn path=/trunk/; revision=214 --- calendar/gui/gncal-full-day.c | 44 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'calendar/gui/gncal-full-day.c') diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c index 47d5ca8d39..1ac7613dbf 100644 --- a/calendar/gui/gncal-full-day.c +++ b/calendar/gui/gncal-full-day.c @@ -286,7 +286,7 @@ static void child_draw_decor (GncalFullDay *fullday, Child *child, GdkRectangle *area) { iCalObject *ico = child->ico; - GdkRectangle rect, dest; + GdkRectangle rect; int ry = 0; rect.x = child->width - child->decor_width; @@ -432,11 +432,36 @@ delete_appointment (GtkWidget *widget, gpointer data) } static void -child_popup_menu (GncalFullDay *fullday, Child *child, GdkEventButton *event) +unrecur_appointment (GtkWidget *widget, gpointer data) { - int sensitive; + Child *child; + GncalFullDay *fullday; + iCalObject *new; + + child = data; + fullday = GNCAL_FULL_DAY (child->widget->parent); + + /* New object */ + new = ical_object_duplicate (child->ico); + g_free (new->recur); + new->recur = 0; + new->dtstart = child->start; + new->dtend = child->end; + + /* Duplicate, and eliminate the recurrency fields */ + ical_object_add_exdate (child->ico, child->start); + gnome_calendar_object_changed (fullday->calendar, child->ico, CHANGE_ALL); + gnome_calendar_add_object (fullday->calendar, new); +} + +static void +child_popup_menu (GncalFullDay *fullday, Child *child, GdkEventButton *event) +{ + int sensitive, idx, items; + static struct menu_item child_items[] = { + { N_("Make this appointment movable"), (GtkSignalFunc) unrecur_appointment, NULL, TRUE }, { N_("Edit this appointment..."), (GtkSignalFunc) edit_appointment, NULL, TRUE }, { N_("Delete this appointment"), (GtkSignalFunc) delete_appointment, NULL, TRUE }, { NULL, NULL, NULL, TRUE }, @@ -445,14 +470,23 @@ child_popup_menu (GncalFullDay *fullday, Child *child, GdkEventButton *event) child_items[0].data = child; child_items[1].data = child; - child_items[3].data = fullday; + child_items[2].data = child; + child_items[4].data = fullday; sensitive = (child->ico->user_data == NULL); child_items[0].sensitive = sensitive; child_items[1].sensitive = sensitive; + child_items[2].sensitive = sensitive; - popup_menu (child_items, sizeof (child_items) / sizeof (child_items[0]), event); + if (child->ico->recur){ + idx = 0; + items = 5; + } else { + idx = 1; + items = 4; + } + popup_menu (&child_items [idx], items, event); } static void -- cgit v1.2.3