[evolution-patches] [IMPROVED PATCH]Bug#55208:Warn user about wrong birthdate format in contacts



This is the improved patch for the bug#55208, which warns users about
wrong birthdate format and allows him to re-enter valid date.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1622
diff -u -r1.1622 ChangeLog
--- ChangeLog	26 Mar 2004 04:09:17 -0000	1.1622
+++ ChangeLog	6 Apr 2004 14:11:31 -0000
@@ -1,3 +1,9 @@
+2004-04-06 S N Tejasvi <tejasvi_sn rediffmail com>
+
+	* gui/contact-editor/e-contact-editor.c (save_contact):
+	do e_contact_editor_is_valid check to check the birth date format
+	when user wants to save and warn him.
+
 2004-03-25 Sivaiah Nallagatla <snallagatla novell com>
 
 	* gui/component/eab-editor.c (eab_editor_prompt_to_save_changes) : 
Index: gui/contact-editor/e-contact-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-editor.c,v
retrieving revision 1.176
diff -u -r1.176 e-contact-editor.c
--- gui/contact-editor/e-contact-editor.c	24 Mar 2004 20:18:46 -0000	1.176
+++ gui/contact-editor/e-contact-editor.c	6 Apr 2004 14:14:17 -0000
@@ -1596,14 +1596,14 @@
 save_contact (EContactEditor *ce, gboolean should_close)
 {
 	EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);

 	extract_info (ce);
 	if (!ce->target_book)
 		return;
 
 	ecs->ce = ce;
+	if(!e_contact_editor_is_valid(EAB_EDITOR(ce)))
+	should_close = FALSE;
 	g_object_ref (ecs->ce);

 	ecs->should_close = should_close;
 
 	gtk_widget_set_sensitive (ce->app, FALSE);
@@ -1639,8 +1639,24 @@
 static gboolean
 e_contact_editor_is_valid (EABEditor *editor)
 {
+
 	/* insert checks here (date format, for instance, etc.) */
-	return TRUE;
+        EContactEditor *ce = E_CONTACT_EDITOR (editor);
+	GtkWidget *dialog,*widget;
+	gint result;
+	widget = glade_xml_get_widget(ce->gui, "dateedit-birthday");
+
+	if(!(e_date_edit_date_is_valid(E_DATE_EDIT (widget)))){
+                        	dialog=gtk_message_dialog_new(GTK_WINDOW(ce->app),
+                                                               0,
+                                                               GTK_MESSAGE_INFO,
+                                                               GTK_BUTTONS_OK,
+                                                               _("Wrong birth date format"));
+                                result=gtk_dialog_run(GTK_DIALOG(dialog));
+                                gtk_widget_destroy(dialog);
+				return FALSE;
+         }else
+                               return TRUE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]