aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/conduits
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-01-19 22:57:09 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-01-19 22:57:09 +0800
commit3532a74349645ca733bafe1417822ba2bfb9bd26 (patch)
treee53d13bb4fe4f66d8d514f3ab8b3da2ae151889d /calendar/conduits
parent0b808ca4dce7445007567a9b8dedc2246ca134f5 (diff)
downloadgsoc2013-evolution-3532a74349645ca733bafe1417822ba2bfb9bd26.tar.gz
gsoc2013-evolution-3532a74349645ca733bafe1417822ba2bfb9bd26.tar.zst
gsoc2013-evolution-3532a74349645ca733bafe1417822ba2bfb9bd26.zip
create a new cal component alarm (cal_component_add_alarm): add alarm to
2001-01-19 JP Rosevear <jpr@ximian.com> * cal-util/cal-component.c (cal_component_alarm_new): create a new cal component alarm (cal_component_add_alarm): add alarm to the cal component (cal_component_remove_alarm): remove alarm from the cal component (remove_alarm): remove alarm from hash * cal-util/cal-component.h: new protos * conduits/calendar/calendar-conduit.c (comp_from_remote_record): add alarm information, still needs to be hacked to replace an already existing alarm. questions abound about the heuristic for doing this. 2001-01-17 JP Rosevear <jpr@ximian.com> * README: Update package requirements svn path=/trunk/; revision=7647
Diffstat (limited to 'calendar/conduits')
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 868d7bddd7..9b820ef1d3 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -655,6 +655,33 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
} else {
cal_component_set_rrule_list (comp, NULL);
}
+
+ /* Alarm information */
+ if (appt.alarm) {
+ CalComponentAlarm *alarm;
+ CalAlarmTrigger trig;
+
+ alarm = cal_component_alarm_new ();
+ cal_component_add_alarm (comp, alarm);
+
+ memset (&trig, 0, sizeof (trig));
+ trig.type = CAL_ALARM_TRIGGER_RELATIVE_START;
+ trig.u.rel_duration.is_neg = 1;
+ switch (appt.advanceUnits) {
+ case advMinutes:
+ trig.u.rel_duration.minutes = appt.advance;
+ break;
+ case advHours:
+ trig.u.rel_duration.hours = appt.advance;
+ break;
+ case advDays:
+ trig.u.rel_duration.days = appt.advance;
+ break;
+ }
+ cal_component_alarm_set_trigger (alarm, trig);
+
+ cal_component_alarm_set_action (alarm, CAL_ALARM_AUDIO);
+ }
cal_component_set_transparency (comp, CAL_COMPONENT_TRANSP_NONE);