aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/gncal-full-day.c44
-rw-r--r--calendar/gui/gnome-cal.c2
2 files changed, 39 insertions, 7 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
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 5db24e9828..24c854ee5c 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -274,7 +274,6 @@ mail_notify (char *mail_address, char *text, time_t app_time)
pipe (p);
pid = fork ();
if (pid == 0){
- const int top = max_open_files ();
int dev_null;
dev_null = open ("/dev/null", O_RDWR);
@@ -362,7 +361,6 @@ gnome_calendar_tag_calendar (GnomeCalendar *cal, GtkCalendar *gtk_cal)
{
time_t month_begin, month_end;
struct tm tm;
- GList *l;
/* compute month_begin */
tm.tm_hour = 0;