[empathy: 6/7] [contact-chooser] Don't reselect the first match if something else is selected



commit e2bf0b6f26a6203288b550217a554651feb5c60b
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Thu Oct 20 15:59:54 2011 +1100

    [contact-chooser] Don't reselect the first match if something else is selected
    
    This patch isn't quite the behaviour I want, but I think it's better than just
    re-selecting the first entry every time I type something.

 libempathy-gtk/empathy-contact-chooser.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c
index 2b568fc..b16540c 100644
--- a/libempathy-gtk/empathy-contact-chooser.c
+++ b/libempathy-gtk/empathy-contact-chooser.c
@@ -229,8 +229,11 @@ get_contacts_cb (TpConnection *connection,
 
   individual_store_add_individual_and_connect (self->priv->store, individual);
 
-  /* Make sure that the first matching item is selected */
-  empathy_individual_view_select_first (self->priv->view);
+  /* if nothing is selected, select the first matching node */
+  if (!gtk_tree_selection_get_selected (
+        gtk_tree_view_get_selection (GTK_TREE_VIEW (self->priv->view)),
+        NULL, NULL))
+    empathy_individual_view_select_first (self->priv->view);
 
   g_clear_object (&persona_new);
   g_clear_object (&personas);



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