From 66701930a9995d48335f8cc28796bd36680d0e89 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 16 Oct 1998 22:19:12 +0000 Subject: Changed a lot of stuff not to use the layout code -- the month view's days 1998-10-16 Federico Mena Quintero * month-view.c: Changed a lot of stuff not to use the layout code -- the month view's days are too small to display layout usefully. Now they display a little list of the events in each day. We also have a popup menu for the days in the month view. * calendar.c (calendar_get_objects_in_range): Reverse the list so that it is returned in increasing order. * eventedit.c (event_editor_new_whole_day): New public function to create an event for the complete span of day_begin to day_end. * year-view.c (new_appointment): Use event_editor_new_whole_day(). * year-view.c (yv_popup_menu): Mark strings for i18n. svn path=/trunk/; revision=452 --- calendar/eventedit.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'calendar/eventedit.c') diff --git a/calendar/eventedit.c b/calendar/eventedit.c index c46da47c1f..a8a972158f 100644 --- a/calendar/eventedit.c +++ b/calendar/eventedit.c @@ -1482,3 +1482,36 @@ event_editor_new (GnomeCalendar *gcal, iCalObject *ical) return retval; } + +void +event_editor_new_whole_day (GnomeCalendar *owner, time_t day) +{ + struct tm tm; + iCalObject *ico; + GtkWidget *ee; + + g_return_if_fail (owner != NULL); + g_return_if_fail (GNOME_IS_CALENDAR (owner)); + + ico = ical_new ("", user_name, ""); + ico->new = TRUE; + + tm = *localtime (&day); + + /* Set the start time of the event to the beginning of the day */ + + tm.tm_hour = day_begin; + tm.tm_min = 0; + tm.tm_sec = 0; + ico->dtstart = mktime (&tm); + + /* Set the end time of the event to the end of the day */ + + tm.tm_hour = day_end; + ico->dtend = mktime (&tm); + + /* Launch the event editor */ + + ee = event_editor_new (owner, ico); + gtk_widget_show (ee); +} -- cgit v1.2.3