]> git.0d.be Git - empathy.git/commitdiff
[contact-chooser] Don't reselect the first match if something else is selected
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Thu, 20 Oct 2011 04:59:54 +0000 (15:59 +1100)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Thu, 20 Oct 2011 05:02:19 +0000 (16:02 +1100)
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

index 2b568fc58e44b4be8c67c118da917ea39120915f..b16540cf3c88df1e74de18cf8630e9fb17b85fe3 100644 (file)
@@ -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);