Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:pchenthill
evolution-data-server
bnc-167330-no-default-alarm-gw-mtg.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-167330-no-default-alarm-gw-mtg.patch of Package evolution-data-server
Index: calendar/backends/groupwise/e-cal-backend-groupwise-utils.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c,v retrieving revision 1.73 diff -u -p -r1.73 e-cal-backend-groupwise-utils.c --- calendar/backends/groupwise/e-cal-backend-groupwise-utils.c 9 Dec 2005 11:21:49 -0000 1.73 +++ calendar/backends/groupwise/e-cal-backend-groupwise-utils.c 17 Jul 2006 06:05:27 -0000 @@ -803,6 +803,67 @@ set_attachments_to_cal_component (EGwIte } +static void +set_default_alarms (ECalComponent *comp) +{ + + GConfClient *gconf = gconf_client_get_default (); + + if (gconf_client_get_bool (gconf, CALENDAR_CONFIG_DEFAULT_REMINDER, NULL)) { + + ECalComponentAlarm *acomp; + int interval; + char * units; + enum { + DAYS, + HOURS, + MINUTES + } duration; + ECalComponentAlarmTrigger trigger; + + interval = gconf_client_get_int (gconf, CALENDAR_CONFIG_DEFAULT_REMINDER_INTERVAL, NULL); + units = gconf_client_get_string (gconf, CALENDAR_CONFIG_DEFAULT_REMINDER_UNITS, NULL); + g_object_unref (gconf); + + if (units && !strcmp (units, "days")) + duration = DAYS; + else if (units && !strcmp (units, "hours")) + duration = HOURS; + else + duration = MINUTES; + g_free (units); + acomp = e_cal_component_alarm_new (); + + e_cal_component_alarm_set_action (acomp, E_CAL_COMPONENT_ALARM_DISPLAY); + + trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; + memset (&trigger.u.rel_duration, 0, sizeof (trigger.u.rel_duration)); + + trigger.u.rel_duration.is_neg = TRUE; + + switch (duration) { + case MINUTES: + trigger.u.rel_duration.minutes = interval; + break; + case HOURS: + trigger.u.rel_duration.hours = interval; + break; + case DAYS: + trigger.u.rel_duration.days = interval; + break; + default: + e_cal_component_alarm_free (acomp); + return; + } + + e_cal_component_alarm_set_trigger (acomp, trigger); + e_cal_component_add_alarm (comp, acomp); + + e_cal_component_alarm_free (acomp); + } +} + + ECalComponent * e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw) { @@ -1111,9 +1172,9 @@ e_gw_item_to_cal_component (EGwItem *ite trigger.u.rel_duration = icaldurationtype_from_int (alarm_duration); e_cal_component_alarm_set_trigger (alarm, trigger); e_cal_component_add_alarm (comp, alarm); - } - + } else + set_default_alarms (comp); break; case E_GW_ITEM_TYPE_TASK : Index: calendar/backends/groupwise/e-cal-backend-groupwise-utils.h =================================================================== RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise-utils.h,v retrieving revision 1.18 diff -u -p -r1.18 e-cal-backend-groupwise-utils.h --- calendar/backends/groupwise/e-cal-backend-groupwise-utils.h 11 Oct 2005 07:56:18 -0000 1.18 +++ calendar/backends/groupwise/e-cal-backend-groupwise-utils.h 17 Jul 2006 06:05:27 -0000 @@ -33,6 +33,13 @@ G_BEGIN_DECLS #define GW_EVENT_TYPE_ID "@4:" #define GW_TODO_TYPE_ID "@3:" + +/* Default reminder */ +#define CALENDAR_CONFIG_PREFIX "/apps/evolution/calendar" +#define CALENDAR_CONFIG_DEFAULT_REMINDER CALENDAR_CONFIG_PREFIX "/other/use_default_reminder" +#define CALENDAR_CONFIG_DEFAULT_REMINDER_INTERVAL CALENDAR_CONFIG_PREFIX "/other/default_reminder_interval" +#define CALENDAR_CONFIG_DEFAULT_REMINDER_UNITS CALENDAR_CONFIG_PREFIX "/other/default_reminder_units" + /* * Items management */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor