diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2002-09-17 22:49:07 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2002-09-17 22:49:07 +0800 |
commit | 27a4ae413001ad90d7fbcbe58414a7796a092281 (patch) | |
tree | 9a3adae6f98ff5197139619e88f1c381c7059cfb /calendar/gui | |
parent | fbc229598cebbe3dc971b91d5302b7bca17e6688 (diff) | |
download | gsoc2013-evolution-27a4ae413001ad90d7fbcbe58414a7796a092281.tar gsoc2013-evolution-27a4ae413001ad90d7fbcbe58414a7796a092281.tar.gz gsoc2013-evolution-27a4ae413001ad90d7fbcbe58414a7796a092281.tar.bz2 gsoc2013-evolution-27a4ae413001ad90d7fbcbe58414a7796a092281.tar.lz gsoc2013-evolution-27a4ae413001ad90d7fbcbe58414a7796a092281.tar.xz gsoc2013-evolution-27a4ae413001ad90d7fbcbe58414a7796a092281.tar.zst gsoc2013-evolution-27a4ae413001ad90d7fbcbe58414a7796a092281.zip |
Fixes #26362
2002-09-17 Rodrigo Moya <rodrigo@ximian.com>
Fixes #26362
* gui/e-itip-control.c (show current): add a default reminder if
default reminders are set in the configuration.
svn path=/trunk/; revision=18084
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-itip-control.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index a38fd70dcf..39ac6add91 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -1224,7 +1224,7 @@ show_current (EItipControl *itip) alarm_iter = icalcomponent_begin_component (priv->ical_comp, ICAL_VALARM_COMPONENT); while ((alarm_comp = icalcompiter_deref (&alarm_iter)) != NULL) { icalcomponent_remove_component (priv->ical_comp, alarm_comp); - + icalcompiter_next (&alarm_iter); } @@ -1236,6 +1236,45 @@ show_current (EItipControl *itip) return; }; + /* Add default reminder if the config says so */ + if (calendar_config_get_use_default_reminder ()) { + CalComponent *acomp; + int interval; + CalUnits units; + CalAlarmTrigger trigger; + + interval = calendar_config_get_default_reminder_interval (); + units = calendar_config_get_default_reminder_units (); + + acomp = cal_component_alarm_new (); + + cal_component_alarm_set_action (acomp, CAL_ALARM_DISPLAY); + + trigger.type = CAL_ALARM_TRIGGER_RELATIVE_START; + memset (&trigger.u.rel_duration, 0, sizeof (trigger.u.rel_duration)); + + trigger.u.rel_duration.is_neg = TRUE; + + switch (units) { + case CAL_MINUTES: + trigger.u.rel_duration.minutes = interval; + break; + case CAL_HOURS: + trigger.u.rel_duration.hours = interval; + break; + case CAL_DAYS: + trigger.u.rel_duration.days = interval; + break; + default: + g_assert_not_reached (); + } + + cal_component_alarm_set_trigger (acomp, trigger); + cal_component_add_alarm (priv->comp, acomp); + + cal_component_alarm_free (acomp); + } + type = cal_component_get_vtype (priv->comp); switch (type) { |