[evolution-patches] (Addressbook) Patch to fix 258257



Hi,

This fixes the bug #258257.
It  fixes the behavior of OK button in Contact-Editor. OK is not enabled
until both Full name and File Under are specified.

Thanks,

Devashish
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1964
diff -u -p -w -r1.1964 ChangeLog
--- ChangeLog	26 Jul 2005 16:30:48 -0000	1.1964
+++ ChangeLog	1 Aug 2005 11:12:10 -0000
@@ -1,3 +1,9 @@
+2005-08-01 Devashish Sharma <sdevashish novell com>
+
+	* gui/contact-editor/e-contact-editor.c (sensitize_ok): fixes the behaviour of
+	OK button. OK is not enabled until both Full name and File Under are
+	specified. Fixes #258257.
+
 2005-07-26  Harish Krishnaswamy  <kharish novell com>
 
 	* gui/component/Makefile.am: fix make distcheck issues.
Index: e-contact-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-editor.c,v
retrieving revision 1.237
diff -u -p -w -r1.237 e-contact-editor.c
--- e-contact-editor.c	25 Jul 2005 11:28:40 -0000	1.237
+++ e-contact-editor.c	1 Aug 2005 10:39:21 -0000
@@ -518,6 +518,7 @@ name_entry_changed (GtkWidget *widget, E
 	editor->name = e_contact_name_from_string (string);
 	file_as_set_style (editor, style);
 
+	sensitize_ok(editor) ;
 	if (string && !*string)
 		gtk_window_set_title (GTK_WINDOW (editor->app), _("Contact Editor"));
 }
@@ -536,6 +537,7 @@ file_as_entry_changed (GtkWidget *widget
 	else {
 		gtk_window_set_title (GTK_WINDOW (editor->app), _("Contact Editor"));
 	}
+	sensitize_ok(editor) ;
 
 	g_free (string);
 }
@@ -575,9 +577,17 @@ sensitize_ok (EContactEditor *ce)
 {
 	GtkWidget *widget;
 	gboolean   allow_save;
+	GtkWidget *entry_fullname ;
+	GtkWidget *entry_file_as ;
+	entry_fullname = glade_xml_get_widget (ce->gui,"entry-fullname" ) ;
+	entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as") ;
+	const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname));
+	const char *file_as_entry_string= gtk_entry_get_text (GTK_ENTRY (entry_file_as)) ;
 
 	allow_save = ce->target_editable && ce->changed ? TRUE : FALSE;
 
+	if (!strcmp(name_entry_string,"") || !strcmp(file_as_entry_string,""))
+		allow_save = FALSE ;
 	widget = glade_xml_get_widget (ce->gui, "button-ok");
 	gtk_widget_set_sensitive (widget, allow_save);
 }


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