From 40a30cb188b91b331adb9da07820e684f2ae8a12 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Thu, 4 Mar 2004 15:49:36 +0000 Subject: always add the page. 2004-03-04 Rodrigo Moya * gui/dialogs/comp-editor.c (comp_editor_append_page): always add the page. * gui/dialogs/event-page.c (event_page_fill_widgets): continue filling up all other fields even if there are missing ones, and return the validation result. svn path=/trunk/; revision=24965 --- calendar/ChangeLog | 9 +++++++++ calendar/gui/dialogs/comp-editor.c | 6 +----- calendar/gui/dialogs/event-page.c | 22 ++++++++++------------ 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 6a04d05ee0..d0d821dc6a 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2004-03-04 Rodrigo Moya + + * gui/dialogs/comp-editor.c (comp_editor_append_page): always add + the page. + + * gui/dialogs/event-page.c (event_page_fill_widgets): continue filling + up all other fields even if there are missing ones, and return the + validation result. + 2004-03-04 Rodrigo Moya * gui/alarm-notify/alarm-notify-dialog.c (alarm_notify_dialog): diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index b298952a6e..d204de56e8 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -722,11 +722,7 @@ comp_editor_append_page (CompEditor *editor, ECalComponent *comp; comp = comp_editor_get_current_comp (editor); - if (!comp_editor_page_fill_widgets (page, comp)) { - /* dont add the pagge if there is an error */ - g_object_unref (comp); - return; - } + comp_editor_page_fill_widgets (page, comp); g_object_unref (comp); } diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 129acd1a2a..c56e477fe2 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -421,6 +421,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) const char *categories; ESource *source; GSList *l; + gboolean validated = TRUE; g_return_val_if_fail (page->client != NULL, FALSE); @@ -452,18 +453,15 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* Start and end times */ e_cal_component_get_dtstart (comp, &start_date); - if (!start_date.value) { - comp_editor_page_display_validation_error (page, _("Event with no start time"), priv->start_time); - return FALSE; - } - e_cal_component_get_dtend (comp, &end_date); - if (!end_date.value) { - comp_editor_page_display_validation_error (page, _("Event with no end time"), priv->end_time); - return FALSE; - } - - update_time (epage, &start_date, &end_date); + if (!start_date.value) { + comp_editor_page_display_validation_error (page, _("Event with no start date"), priv->start_time); + validated = FALSE; + } else if (!end_date.value) { + comp_editor_page_display_validation_error (page, _("Event with no end date"), priv->end_time); + validated = FALSE; + } else + update_time (epage, &start_date, &end_date); e_cal_component_free_datetime (&start_date); e_cal_component_free_datetime (&end_date); @@ -530,7 +528,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) priv->updating = FALSE; - return TRUE; + return validated; } /* fill_component handler for the event page */ -- cgit v1.2.3