aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-01-13 20:24:47 +0800
committerMilan Crha <mcrha@src.gnome.org>2009-01-13 20:24:47 +0800
commit158dea659db463a9bb7c4552e2f009b22b092e65 (patch)
treed9cdc0172fc4782869a000ed7bd48b66024f3b6b /calendar/gui/dialogs
parentf7b5533e5eb094f0c9a45d6224f9ea3b44c721b7 (diff)
downloadgsoc2013-evolution-158dea659db463a9bb7c4552e2f009b22b092e65.tar
gsoc2013-evolution-158dea659db463a9bb7c4552e2f009b22b092e65.tar.gz
gsoc2013-evolution-158dea659db463a9bb7c4552e2f009b22b092e65.tar.bz2
gsoc2013-evolution-158dea659db463a9bb7c4552e2f009b22b092e65.tar.lz
gsoc2013-evolution-158dea659db463a9bb7c4552e2f009b22b092e65.tar.xz
gsoc2013-evolution-158dea659db463a9bb7c4552e2f009b22b092e65.tar.zst
gsoc2013-evolution-158dea659db463a9bb7c4552e2f009b22b092e65.zip
** Fix for bug #489437
2009-01-13 Milan Crha <mcrha@redhat.com> ** Fix for bug #489437 * gui/dialogs/recurrence-page.c: (fill_component): Check whether the 'until' date is in the future, and report error if not. svn path=/trunk/; revision=37066
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/recurrence-page.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 8a93c4dfee..15171d52ed 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -903,6 +903,37 @@ fill_component (RecurrencePage *rpage, ECalComponent *comp)
e_cal_component_set_exdate_list (comp, list);
e_cal_component_free_exdate_list (list);
+ if (GTK_WIDGET_VISIBLE (priv->ending_menu) && GTK_WIDGET_IS_SENSITIVE (priv->ending_menu) &&
+ e_dialog_option_menu_get (priv->ending_menu, ending_types_map) == ENDING_UNTIL) {
+ /* check whether the "until" date is in the future */
+ struct icaltimetype tt;
+ gboolean ok = TRUE;
+
+ if (e_date_edit_get_date (E_DATE_EDIT (priv->ending_date_edit), &tt.year, &tt.month, &tt.day)) {
+ ECalComponentDateTime dtstart;
+
+ /* the dtstart should be set already */
+ e_cal_component_get_dtstart (comp, &dtstart);
+
+ tt.is_date = 1;
+ tt.zone = NULL;
+
+ if (dtstart.value && icaltime_is_valid_time (*dtstart.value)) {
+ ok = icaltime_compare_date_only (*dtstart.value, tt) <= 0;
+
+ if (!ok)
+ e_date_edit_set_date (E_DATE_EDIT (priv->ending_date_edit), dtstart.value->year, dtstart.value->month, dtstart.value->day);
+ }
+
+ e_cal_component_free_datetime (&dtstart);
+ }
+
+ if (!ok) {
+ comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage), _("End time of the recurrence was before event's start"), priv->ending_date_edit);
+ return FALSE;
+ }
+ }
+
return TRUE;
}