diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar.c | 4 | ||||
-rw-r--r-- | calendar/gui/calendar.h | 3 | ||||
-rw-r--r-- | calendar/gui/gncal-week-view.c | 2 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 18 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.h | 1 | ||||
-rw-r--r-- | calendar/gui/test.vcf | 132 | ||||
-rw-r--r-- | calendar/gui/year-view.c | 24 |
7 files changed, 161 insertions, 23 deletions
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c index 641d6d765e..be45bb04bb 100644 --- a/calendar/gui/calendar.c +++ b/calendar/gui/calendar.c @@ -35,8 +35,6 @@ calendar_add_object (Calendar *cal, iCalObject *obj) switch (obj->type){ case ICAL_EVENT: cal->events = g_list_prepend (cal->events, obj); - if (obj->recur) - cal->recur = g_list_prepend (cal->recur, obj); break; case ICAL_TODO: @@ -61,8 +59,6 @@ calendar_remove_object (Calendar *cal, iCalObject *obj) switch (obj->type){ case ICAL_EVENT: cal->events = g_list_remove (cal->events, obj); - if (obj->recur) - cal->recur = g_list_remove (cal->recur, obj); break; case ICAL_TODO: diff --git a/calendar/gui/calendar.h b/calendar/gui/calendar.h index e68b74ebf4..94b471d3da 100644 --- a/calendar/gui/calendar.h +++ b/calendar/gui/calendar.h @@ -17,9 +17,6 @@ typedef struct { GList *todo; GList *journal; - /* Events that have a recurrence field are also present here */ - GList *recur; - /* Time at which the calendar was created */ time_t created; diff --git a/calendar/gui/gncal-week-view.c b/calendar/gui/gncal-week-view.c index e391c80344..59252baa0c 100644 --- a/calendar/gui/gncal-week-view.c +++ b/calendar/gui/gncal-week-view.c @@ -159,8 +159,6 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week) tm.tm_mday++; day_end = mktime (&tm); - printf ("Boundary: "); - print_time_t (day_start); gncal_day_view_set_bounds (wview->days[i], day_start, day_end - 1); day_start = day_end; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 14c9a53975..862c659d83 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -91,7 +91,7 @@ setup_widgets (GnomeCalendar *gcal) gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->day_view_container, gtk_label_new (_("Day View"))); gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->week_view, gtk_label_new (_("Week View"))); gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->year_view, gtk_label_new (_("Year View"))); - gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->task_view, gtk_label_new (_("Todo"))); +/* gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->task_view, gtk_label_new (_("Todo"))); */ gtk_widget_show_all (gcal->notebook); @@ -166,6 +166,13 @@ gnome_calendar_previous (GnomeCalendar *gcal) gnome_calendar_direction (gcal, -1); } +void +gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time) +{ + gtk_notebook_set_page (GTK_NOTEBOOK (gcal->notebook), 0); + gnome_calendar_goto (gcal, time); +} + GtkWidget * gnome_calendar_new (char *title) { @@ -210,13 +217,18 @@ gnome_calendar_load (GnomeCalendar *gcal, char *file) void gnome_calendar_add_object (GnomeCalendar *gcal, iCalObject *obj) { - printf ("Adding object at: "); - print_time_t (obj->dtstart); calendar_add_object (gcal->cal, obj); gnome_calendar_update_all (gcal, obj, CHANGE_NEW); } void +gnome_calendar_remove_object (GnomeCalendar *gcal, iCalObject *obj) +{ + calendar_remove_object (gcal->cal, obj); + gnome_calendar_update_all (gcal, obj, CHANGE_ALL); +} + +void gnome_calendar_object_changed (GnomeCalendar *gcal, iCalObject *obj, int flags) { g_return_if_fail (gcal != NULL); diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index 96567ab722..71c5c386c8 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -44,6 +44,7 @@ void gnome_calendar_add_object (GnomeCalendar *gcal, iCalObject *obj); void gnome_calendar_next (GnomeCalendar *gcal); void gnome_calendar_previous (GnomeCalendar *gcal); void gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time); +void gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time); /* Flags is a bitmask of CalObjectChange values */ void gnome_calendar_object_changed (GnomeCalendar *gcal, iCalObject *obj, int flags); diff --git a/calendar/gui/test.vcf b/calendar/gui/test.vcf index ed6aedb8ac..f2910c50d8 100644 --- a/calendar/gui/test.vcf +++ b/calendar/gui/test.vcf @@ -8,19 +8,143 @@ DCREATED:19980402T023552 UID:KOrganizer - 1804289383 SEQUENCE:1 LAST-MODIFIED:19980330T225948 -DTSTART:19980401T116000 -DTEND:19980401T119000 -SUMMARY:Primer miercoles, 4 meses +DTSTART:19980415T003000 +DTEND:19980415T010000 +SUMMARY: Semana: Mi, Ju, Vi, Dom (10 veces) STATUS:NEEDS ACTION CLASS:PUBLIC PRIORITY:0 TRANSP:0 -RRULE:MP1 1+ WE # 4 +RRULE:W1 WE TH FR SU #10 RELATED-TO:0 X-PILOTID:0 X-PILOTSTAT:0 END:VEVENT +BEGIN:VEVENT +DCREATED:19980402T023552 +UID:KOrganizer - 1804289383 +SEQUENCE:1 +LAST-MODIFIED:19980330T225948 +DTSTART:19980415T006000 +DTEND:19980415T009000 +SUMMARY:Diario durante 5 dias +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RRULE:D1 #5 +RELATED-TO:0 +X-PILOTID:0 +X-PILOTSTAT:0 +END:VEVENT + +BEGIN:VEVENT +DCREATED:19980402T023552 +UID:KOrganizer - 1804289383 +SEQUENCE:1 +LAST-MODIFIED:19980330T225948 +DTSTART:19980415T116000 +DTEND:19980415T119000 +SUMMARY:Semanal -- 4 semanas +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RRULE:W1 #4 +RELATED-TO:0 +X-PILOTID:0 +X-PILOTSTAT:0 +END:VEVENT + +BEGIN:VEVENT +DCREATED:19980402T023552 +UID:KOrganizer - 1804289383 +SEQUENCE:1 +LAST-MODIFIED:19980330T225948 +DTSTART:19980415T006000 +DTEND:19980415T009000 +SUMMARY:Diario durante 5 dias +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RRULE:D1 #5 +RELATED-TO:0 +X-PILOTID:0 +X-PILOTSTAT:0 +END:VEVENT + +BEGIN:VEVENT +DCREATED:19980402T023558 +UID:KOrganizer - 846930886 +SEQUENCE:1 +LAST-MODIFIED:19980402T023558 +DTSTART:19980415T140000 +DTEND:19980415T160000 +SUMMARY:Normal +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +X-PILOTID:0 +X-PILOTSTAT:0 +END:VEVENT + +BEGIN:VEVENT +DCREATED:19980402T023558 +UID:KOrganizer - 846930886 +SEQUENCE:1 +LAST-MODIFIED:19980402T023558 +DTSTART:19980501T140000 +DTEND:19980501T140000 +RRULE:D1 19980601T140000 +SUMMARY:Diariamente de 05/01 al 06/01 +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +X-PILOTID:0 +X-PILOTSTAT:0 +END:VEVENT + +BEGIN:VEVENT +DCREATED:19980402T023558 +UID:KOrganizer - 846930886 +SEQUENCE:1 +LAST-MODIFIED:19980402T023558 +DTSTART:19980501T140000 +DTEND:19980501T140000 +RRULE:D1 #5 +SUMMARY:5 dias. +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +X-PILOTID:0 +X-PILOTSTAT:0 +END:VEVENT + +BEGIN:VEVENT +DCREATED:19980402T023558 +UID:KOrganizer - 846930886 +SEQUENCE:1 +LAST-MODIFIED:19980402T023558 +DTSTART:19980601T150000 +DTEND:19980601T150000 +RRULE:D2 19980701T140000 +SUMMARY:Cada dos dias de 06/01 al 07/01 +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +X-PILOTID:0 +X-PILOTSTAT:0 +END:VEVENT END:VCALENDAR diff --git a/calendar/gui/year-view.c b/calendar/gui/year-view.c index a922ac2748..5376826239 100644 --- a/calendar/gui/year-view.c +++ b/calendar/gui/year-view.c @@ -15,9 +15,20 @@ static void gncal_year_view_init (GncalYearView *yview); static void -double_click(GtkWidget *widget, gpointer data) +double_click(GtkCalendar *gc, GncalYearView *yview) { - printf("Recieved double click.\n"); + struct tm tm; + time_t t; + + tm.tm_mday = gc->selected_day; + tm.tm_mon = gc->month; + tm.tm_year = gc->year; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + t = mktime (&tm); + + gnome_calendar_dayjump (yview->gcal, t); } static void @@ -189,6 +200,7 @@ gncal_year_view_set_year (GncalYearView *yview, int year) for (i = 0; i < 12; i++) { gtk_calendar_select_month (GTK_CALENDAR(yview->calendar[i]), i, yview->year); + gtk_calendar_clear_marks (GTK_CALENDAR (yview->calendar[i])); } year_begin = time_year_begin (yview->year); @@ -197,7 +209,7 @@ gncal_year_view_set_year (GncalYearView *yview, int year) l = calendar_get_events_in_range (yview->gcal->cal, year_begin, year_end); for (; l; l = l->next){ CalendarObject *co = l->data; - + year_view_mark_day (co->ico, co->ev_start, co->ev_end, yview); } calendar_destroy_event_list (l); @@ -221,10 +233,8 @@ gncal_year_view_update (GncalYearView *yview, iCalObject *ico, int flags) g_return_if_fail (GNCAL_IS_YEAR_VIEW (yview)); /* If only the summary changed, we dont care */ - if ((flags & CHANGE_SUMMARY) == flags) + if (flags && (flags & CHANGE_SUMMARY) == flags) return; - printf ("MARCANDO!\n"); - if (flags & CHANGE_NEW) - gncal_year_view_set_year (yview, yview->year); + gncal_year_view_set_year (yview, yview->year); } |