From 04de0045116774d86de4eb3b93c731b43a133b77 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 5 Aug 2004 18:26:55 +0000 Subject: nuke, unnecessary. (e_entry_start_completion): set item_chosen to FALSE. 2004-08-04 Chris Toshok * 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. svn path=/trunk/; revision=26832 --- widgets/text/e-entry.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c index 132de14ee6..fca872d55c 100644 --- a/widgets/text/e-entry.c +++ b/widgets/text/e-entry.c @@ -122,6 +122,7 @@ struct _EEntryPrivate { guint draw_borders : 1; guint emulate_label_resize : 1; guint have_set_transient : 1; + guint item_chosen : 1; gint last_width; }; @@ -560,13 +561,6 @@ e_entry_show_popup (EEntry *entry, gboolean visible) } } -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) { @@ -576,6 +570,8 @@ e_entry_start_completion (EEntry *entry) 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), @@ -621,20 +617,13 @@ nonempty_cb (ECompletionView *view, gpointer user_data) e_entry_show_popup (entry, TRUE); } -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 @@ activate_cb (ECompletionView *view, ECompletionMatch *match, gpointer user_data) else e_entry_set_text (entry, match->match_text); + entry->priv->item_chosen = TRUE; + e_entry_cancel_delayed_completion (entry); } @@ -803,11 +794,6 @@ e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint del 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", G_CALLBACK (full_cb), -- cgit