aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-07-03 01:31:49 +0800
committerMilan Crha <mcrha@redhat.com>2009-07-03 01:31:49 +0800
commitafea64785f1fbcb9852fa520f67f3a60f303c372 (patch)
tree2f24acbadabe51ff4623206c3f1c6176d239073e
parent42e75c9162402078ac629740821c3533925ee342 (diff)
downloadgsoc2013-evolution-afea64785f1fbcb9852fa520f67f3a60f303c372.tar.gz
gsoc2013-evolution-afea64785f1fbcb9852fa520f67f3a60f303c372.tar.zst
gsoc2013-evolution-afea64785f1fbcb9852fa520f67f3a60f303c372.zip
Bug #252296 - Do not preset alarm for all day events
-rw-r--r--calendar/gui/comp-util.c8
-rw-r--r--calendar/gui/comp-util.h2
-rw-r--r--calendar/gui/e-cal-model.c6
-rw-r--r--calendar/gui/e-cal-model.h2
-rw-r--r--calendar/gui/e-calendar-view.c2
-rw-r--r--calendar/gui/e-day-view.c2
-rw-r--r--calendar/gui/e-week-view.c2
-rw-r--r--calendar/gui/gnome-cal.c2
8 files changed, 13 insertions, 13 deletions
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index 62a55d2c30..cb3cf95def 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -278,12 +278,12 @@ is_icalcomp_on_the_server (icalcomponent *icalcomp, ECal *client)
* cal_comp_event_new_with_defaults:
*
* Creates a new VEVENT component and adds any default alarms to it as set in
- * the program's configuration values.
+ * the program's configuration values, but only if not the all_day event.
*
* Return value: A newly-created calendar component.
**/
ECalComponent *
-cal_comp_event_new_with_defaults (ECal *client)
+cal_comp_event_new_with_defaults (ECal *client, gboolean all_day)
{
icalcomponent *icalcomp;
ECalComponent *comp;
@@ -303,7 +303,7 @@ cal_comp_event_new_with_defaults (ECal *client)
e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
}
- if (!calendar_config_get_use_default_reminder ())
+ if (all_day || !calendar_config_get_use_default_reminder ())
return comp;
interval = calendar_config_get_default_reminder_interval ();
@@ -361,7 +361,7 @@ cal_comp_event_new_with_current_time (ECal *client, gboolean all_day)
ECalComponentDateTime dt;
icaltimezone *zone;
- comp = cal_comp_event_new_with_defaults (client);
+ comp = cal_comp_event_new_with_defaults (client, all_day);
g_return_val_if_fail (comp, NULL);
diff --git a/calendar/gui/comp-util.h b/calendar/gui/comp-util.h
index f6090543a5..de6595672f 100644
--- a/calendar/gui/comp-util.h
+++ b/calendar/gui/comp-util.h
@@ -46,7 +46,7 @@ gboolean cal_comp_is_on_server (ECalComponent *comp,
ECal *client);
gboolean is_icalcomp_on_the_server (icalcomponent *icalcomp, ECal *client);
-ECalComponent *cal_comp_event_new_with_defaults (ECal *client);
+ECalComponent *cal_comp_event_new_with_defaults (ECal *client, gboolean all_day);
ECalComponent *cal_comp_event_new_with_current_time (ECal *client, gboolean all_day);
ECalComponent *cal_comp_task_new_with_defaults (ECal *client);
ECalComponent *cal_comp_memo_new_with_defaults (ECal *client);
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index eec7403ff3..be61d1fd72 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -856,7 +856,7 @@ ecm_append_row (ETableModel *etm, ETableModel *source, gint row)
if (!(comp_data.client && e_cal_get_load_state (comp_data.client) == E_CAL_LOAD_LOADED))
return;
- comp_data.icalcomp = e_cal_model_create_component_with_defaults (model);
+ comp_data.icalcomp = e_cal_model_create_component_with_defaults (model, FALSE);
/* set values for our fields */
set_categories (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_CATEGORIES, row));
@@ -2139,7 +2139,7 @@ e_cal_model_set_search_query_with_time_range (ECalModel *model, const gchar *sex
* e_cal_model_create_component_with_defaults
*/
icalcomponent *
-e_cal_model_create_component_with_defaults (ECalModel *model)
+e_cal_model_create_component_with_defaults (ECalModel *model, gboolean all_day)
{
ECalModelPrivate *priv;
ECalComponent *comp;
@@ -2158,7 +2158,7 @@ e_cal_model_create_component_with_defaults (ECalModel *model)
switch (priv->kind) {
case ICAL_VEVENT_COMPONENT :
- comp = cal_comp_event_new_with_defaults (client);
+ comp = cal_comp_event_new_with_defaults (client, all_day);
break;
case ICAL_VTODO_COMPONENT :
comp = cal_comp_task_new_with_defaults (client);
diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h
index 6f3d3637b1..adaf736494 100644
--- a/calendar/gui/e-cal-model.h
+++ b/calendar/gui/e-cal-model.h
@@ -163,7 +163,7 @@ void e_cal_model_set_time_range (ECalModel
const gchar *e_cal_model_get_search_query (ECalModel *model);
void e_cal_model_set_search_query (ECalModel *model,
const gchar *sexp);
-icalcomponent *e_cal_model_create_component_with_defaults (ECalModel *model);
+icalcomponent *e_cal_model_create_component_with_defaults (ECalModel *model, gboolean all_day);
const gchar *e_cal_model_get_color_for_component (ECalModel *model,
ECalModelComponent *comp_data);
gboolean e_cal_model_get_rgb_color_for_component (ECalModel *model,
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 2bca3e7ed9..07e067e7f5 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -1970,7 +1970,7 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view,
else
dt.tzid = icaltimezone_get_tzid (e_cal_model_get_timezone (cal_view->priv->model));
- icalcomp = e_cal_model_create_component_with_defaults (priv->model);
+ icalcomp = e_cal_model_create_component_with_defaults (priv->model, all_day);
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomp);
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index a0ac7098e1..ef9e9b1f23 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -4838,7 +4838,7 @@ e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key
if (!e_cal_is_read_only (ecal, &read_only, NULL) || read_only)
return FALSE;
- icalcomp = e_cal_model_create_component_with_defaults (model);
+ icalcomp = e_cal_model_create_component_with_defaults (model, day_view->selection_in_top_canvas);
if (!icalcomp)
return FALSE;
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 839cad6688..7853adda5a 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -4053,7 +4053,7 @@ e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar *
return FALSE;
/* Add a new event covering the selected range. */
- icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)));
+ icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)), TRUE);
if (!icalcomp)
return FALSE;
uid = icalcomponent_get_uid (icalcomp);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 1e943eeb14..806f8be698 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -3510,7 +3510,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend)
flags |= COMP_EDITOR_NEW_ITEM;
editor = task_editor_new (ecal, flags);
- icalcomp = e_cal_model_create_component_with_defaults (model);
+ icalcomp = e_cal_model_create_component_with_defaults (model, FALSE);
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomp);