aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gncal-full-day.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1998-05-15 07:12:10 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-05-15 07:12:10 +0800
commit3799134926a1db309a2b46706d8a33581999f778 (patch)
tree46d2561103752aac54d3dd0430a3b0d72687a3e4 /calendar/gui/gncal-full-day.c
parentdc9b92ba1949fc7004aec9cbc369e173e03af0a8 (diff)
downloadgsoc2013-evolution-3799134926a1db309a2b46706d8a33581999f778.tar.gz
gsoc2013-evolution-3799134926a1db309a2b46706d8a33581999f778.tar.zst
gsoc2013-evolution-3799134926a1db309a2b46706d8a33581999f778.zip
Do not add the spurious padding.
1998-05-14 Miguel de Icaza <miguel@nuclecu.unam.mx> * 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
Diffstat (limited to 'calendar/gui/gncal-full-day.c')
-rw-r--r--calendar/gui/gncal-full-day.c44
1 files changed, 39 insertions, 5 deletions
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