From a6c4b535334a6da5c8d1622b11a0893d0c55abee Mon Sep 17 00:00:00 2001 From: Russell Steinthal Date: Wed, 3 Nov 1999 02:36:31 +0000 Subject: Add default alarm support, Beep on display alarms option Since there are now some calls from prop.c into previously static functions in eventedit.c, the code in those files should probably be reorganized. Perhaps a new alarm-utils.c file? In any case, this commits working code to the repository before we reorganize. svn path=/trunk/; revision=1366 --- calendar/cal-util/calobj.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'calendar/cal-util/calobj.c') diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c index 806c27d8ff..f3004ddb13 100644 --- a/calendar/cal-util/calobj.c +++ b/calendar/cal-util/calobj.c @@ -15,6 +15,8 @@ #include "timeutil.h" #include "../libversit/vcc.h" +extern CalendarAlarm alarm_defaults[4]; + static char * ical_gen_uid (void) { @@ -62,19 +64,12 @@ ical_object_new (void) static void default_alarm (iCalObject *ical, CalendarAlarm *alarm, char *def_mail, enum AlarmType type) { - alarm->enabled = 0; - alarm->type = type; - - if (type != ALARM_MAIL){ - alarm->count = 15; - alarm->units = ALARM_MINUTES; - } else { - alarm->count = 1; - alarm->units = ALARM_DAYS; - } - - if (type == ALARM_MAIL) - alarm->data = g_strdup (def_mail); + alarm->type = type; + alarm->enabled = alarm_defaults[type].enabled; + alarm->count = alarm_defaults[type].count; + alarm->units = alarm_defaults[type].units; + if (alarm_defaults[type].data) + alarm->data = g_strdup (alarm_defaults[type].data); else alarm->data = g_strdup (""); } -- cgit