diff options
author | JP Rosevear <jpr@ximian.com> | 2002-05-02 00:56:05 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2002-05-02 00:56:05 +0800 |
commit | a37157808d52f4e2cf12db792f0ad3105c02d507 (patch) | |
tree | 6e14750214376c0e363edba9c36174ed83f79be9 | |
parent | 51cade71057025c9de4c663be07c27b358d988e3 (diff) | |
download | gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar.gz gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar.bz2 gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar.lz gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar.xz gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar.zst gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.zip |
modify the start and end hours to accomodate all the events in the day
2002-05-01 JP Rosevear <jpr@ximian.com>
* gui/print.c (print_day_details): modify the start and end hours
to accomodate all the events in the day
* gui/e-day-view.c (free_view_popup): only discard the popup if we
created one
svn path=/trunk/; revision=16655
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 4 | ||||
-rw-r--r-- | calendar/gui/print.c | 23 |
3 files changed, 35 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 93ed4a2a8e..26bf984892 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2002-05-01 JP Rosevear <jpr@ximian.com> + + * gui/print.c (print_day_details): modify the start and end hours + to accomodate all the events in the day + + * gui/e-day-view.c (free_view_popup): only discard the popup if we + created one + 2002-04-30 JP Rosevear <jpr@ximian.com> * gui/gnome-cal.c (gnome_calendar_construct): remove setup_widgets diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 3d63bfa83b..2a346cdbf9 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -3621,8 +3621,12 @@ static void free_view_popup (GtkWidget *widget, gpointer data) { EDayView *day_view = E_DAY_VIEW (data); + + if (day_view->view_menu == NULL) + return; gnome_calendar_discard_view_popup (day_view->calendar, day_view->view_menu); + day_view->view_menu = NULL; } static void diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 6e385a065d..b353fc24fb 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -1132,6 +1132,29 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence, qsort (pdi.events[0]->data, pdi.events[0]->len, sizeof (EDayViewEvent), e_day_view_event_sort_func); + /* Also print events outside of work hours */ + if (pdi.events[0]->len > 0) { + icaltimezone *zone = get_timezone (); + struct icaltimetype tt; + + event = &g_array_index (pdi.events[0], EDayViewEvent, 0); + tt = icaltime_from_timet_with_zone (event->start, FALSE, zone); + if (tt.hour < pdi.start_hour) + pdi.start_hour = tt.hour; + pdi.start_minute_offset = pdi.start_hour * 60; + + event = &g_array_index (pdi.events[0], EDayViewEvent, pdi.events[0]->len - 1); + tt = icaltime_from_timet_with_zone (event->end, FALSE, zone); + if (tt.hour > pdi.end_hour || tt.hour == 0) { + pdi.end_hour = tt.hour ? tt.hour : 24; + if (tt.minute > 0) + pdi.end_hour++; + } + pdi.end_minute_offset = pdi.end_hour * 60; + + pdi.rows = (pdi.end_hour - pdi.start_hour) * 2; + } + /* Lay them out the long events, across the top of the page. */ e_day_view_layout_long_events (pdi.long_events, pdi.days_shown, pdi.day_starts, &rows_in_top_display); |