[evolution-patches] patch for autocompletion



To see this bug you need to be fairly speedy with the keyboard, and/or
have a slow ldap server and a fast local addressbook to complete from.

What happens is you type the requisite 3 letters, and the local folder
comes back with matches almost instantaneously.  You select one of them,
and the dropdown goes away.  Then when the ldap results come back in, we
show the dropdown again.  If all the backend results are in before you
select one, you won't see the bug.


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.882
diff -u -r1.882 ChangeLog
--- ChangeLog	2 Aug 2004 18:37:23 -0000	1.882
+++ ChangeLog	4 Aug 2004 16:29:40 -0000
@@ -1,3 +1,11 @@
+2004-08-04  Chris Toshok  <toshok ximian com>
+
+	* gal/e-text/e-entry.c (e_entry_refresh_popup): nuke, unnecessary.
+	(e_entry_start_completion): set item_chosen to FALSE.
+	(added_cb): nuke, unnecessary.
+	(full_cb): only show the popup if the user hasn't chosen an entry.
+	(activate_cb): set item_chosen to TRUE.
+
 2004-08-02  JP Rosevear  <jpr novell com>
 
 	* configure.in: bump version
Index: gal/e-text/e-entry.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-text/e-entry.c,v
retrieving revision 1.58
diff -u -r1.58 e-entry.c
--- gal/e-text/e-entry.c	11 Jun 2004 14:05:01 -0000	1.58
+++ gal/e-text/e-entry.c	4 Aug 2004 16:29:42 -0000
@@ -122,6 +122,7 @@
 	guint draw_borders : 1;
 	guint emulate_label_resize : 1;
 	guint have_set_transient : 1;
+	guint item_chosen : 1;
 	gint last_width;
 };
 
@@ -561,13 +562,6 @@
 }
 
 static void
-e_entry_refresh_popup (EEntry *entry)
-{
-	if (entry->priv->popup_is_visible)
-		e_entry_show_popup (entry, TRUE);
-}
-
-static void
 e_entry_start_completion (EEntry *entry)
 {
 	if (entry->priv->completion == NULL)
@@ -576,6 +570,8 @@
 	if (e_entry_is_empty (entry))
 		return;
 
+	entry->priv->item_chosen = FALSE;
+
 	e_completion_begin_search (entry->priv->completion,
 				   e_entry_get_text (entry),
 				   entry->priv->last_completion_pos = e_entry_get_position (entry),
@@ -622,19 +618,12 @@
 }
 
 static void
-added_cb (ECompletionView *view, gpointer user_data)
-{
-	EEntry *entry = E_ENTRY (user_data);
-	e_entry_refresh_popup (entry);
-}
-
-static void
 full_cb (ECompletionView *view, gpointer user_data)
 {
 	EEntry *entry = E_ENTRY (user_data);
 	gboolean show;
 
-	show = GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry->canvas)) && view->choices->len > 0;
+	show = GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry->canvas)) && view->choices->len > 0 && !entry->priv->item_chosen;
 	e_entry_show_popup (entry, show);
 }
 
@@ -691,6 +680,8 @@
 	else
 		e_entry_set_text (entry, match->match_text);
 
+	entry->priv->item_chosen = TRUE;
+
 	e_entry_cancel_delayed_completion (entry);
 }
 
@@ -802,11 +793,6 @@
 							    "nonempty",
 							    G_CALLBACK (nonempty_cb),
 							    entry);
-
-	entry->priv->added_signal_id = g_signal_connect (entry->priv->completion_view,
-							 "added",
-							 G_CALLBACK (added_cb),
-							 entry);
 
 	entry->priv->full_signal_id = g_signal_connect (entry->priv->completion_view,
 							"full",


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