aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@ximian.com>2001-03-18 16:16:40 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2001-03-18 16:16:40 +0800
commitf4b4da4fcb6a59f56c1fff88ba08a6c9995b807c (patch)
tree174273901eb0b57d53848dc3993e7fd7aa1ed9d5 /calendar/gui/gnome-cal.c
parent3370188296f555ac67b0f859ce2209c2eeba34af (diff)
downloadgsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar.gz
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar.zst
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.zip
Added ShowWeekView, ShowMonthView, ShowDay, ShowWorkWeek to the View menu.
2001-03-17 Miguel de Icaza <miguel@ximian.com> * evolution-calendar.xml: Added ShowWeekView, ShowMonthView, ShowDay, ShowWorkWeek to the View menu. * evolution.xml, evolution-mail.xml: Provide "Actions" in the toplevel evolution. Fill in Actions/Component in Evolution-mail (no visual changes, just internal changes). * evolution-calendar.xml: Added Actions menu. Added New Verb EditNewEvent. 2001-03-17 Miguel de Icaza <miguel@ximian.com> * gui/e-day-view.c (e_day_view_on_new_event, e_day_view_on_new_appointment): Simplifed this function to use the shared code. * gui/e-week-view.c (e_week_view_on_new_event, e_week_view_on_new_appointment): ditto. * gui/gnome-cal.c (gnome_calendar_new_appointment_for): New function used to launch editor components with a time range. A bunch of functions use this code now instead of duplicating code all over the place svn path=/trunk/; revision=8794
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c48
1 files changed, 37 insertions, 11 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 588a7a6687..e5ae424f3e 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1151,23 +1151,30 @@ gnome_calendar_edit_object (GnomeCalendar *gcal, CalComponent *comp)
/**
* gnome_calendar_new_appointment:
* @gcal: An Evolution calendar.
+ * @dtstart: a Unix time_t that marks the beginning of the appointment.
+ * @dtend: a Unix time_t that marks the end of the appointment.
+ * @all_day: if true, the dtstart and dtend are expanded to cover the entire day.
+ *
+ * Opens an event editor dialog for a new appointment.
*
- * Opens an event editor dialog for a new appointment. The appointment's start
- * and end times are set to the currently selected time range in the calendar
- * views.
**/
void
-gnome_calendar_new_appointment (GnomeCalendar *gcal)
+gnome_calendar_new_appointment_for (GnomeCalendar *cal,
+ time_t dtstart, time_t dtend,
+ gboolean all_day)
{
- CalComponent *comp;
- time_t dtstart, dtend;
- CalComponentDateTime dt;
struct icaltimetype itt;
+ CalComponentDateTime dt;
+ CalComponent *comp;
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
+ g_return_if_fail (cal != NULL);
+ g_return_if_fail (GNOME_IS_CALENDAR (cal));
- gnome_calendar_get_current_time_range (gcal, &dtstart, &dtend);
+ if (all_day){
+ dtstart = time_day_begin (dtstart);
+ dtend = time_day_end (dtend);
+ }
+
dt.value = &itt;
dt.tzid = NULL;
@@ -1182,9 +1189,28 @@ gnome_calendar_new_appointment (GnomeCalendar *gcal)
cal_component_commit_sequence (comp);
- gnome_calendar_edit_object (gcal, comp);
+ gnome_calendar_edit_object (cal, comp);
gtk_object_unref (GTK_OBJECT (comp));
+}
+
+/**
+ * gnome_calendar_new_appointment:
+ * @gcal: An Evolution calendar.
+ *
+ * Opens an event editor dialog for a new appointment. The appointment's start
+ * and end times are set to the currently selected time range in the calendar
+ * views.
+ **/
+void
+gnome_calendar_new_appointment (GnomeCalendar *gcal)
+{
+ time_t dtstart, dtend;
+ g_return_if_fail (gcal != NULL);
+ g_return_if_fail (GNOME_IS_CALENDAR (gcal));
+
+ gnome_calendar_get_current_time_range (gcal, &dtstart, &dtend);
+ gnome_calendar_new_appointment_for (gcal, dtstart, dtend, FALSE);
}
/* Returns the selected time range for the current view. Note that this may be