diff frontends/src/primitivus/contact_list.py @ 511:62f7f2403093

Primitivus: present contacts in groups chat can now be clicked - updated GenericList/List signals to manage change/click fix in urwid-satext - a click on a nick in a group chat create a private conversation with her, and select this conversation /!\ history in backend doesn't manage correctly yet the private conversations /!\
author Goffi <goffi@goffi.org>
date Tue, 16 Oct 2012 01:22:40 +0200
parents 886754295efe
children 0bb595eff25b
line wrap: on
line diff
--- a/frontends/src/primitivus/contact_list.py	Thu Oct 11 00:48:35 2012 +0200
+++ b/frontends/src/primitivus/contact_list.py	Tue Oct 16 01:22:40 2012 +0200
@@ -73,13 +73,17 @@
                 return True
         return False
 
-    def setFocus(self, name):
-        """give focus to the first group or contact with the given name"""
+    def setFocus(self, name, select=False):
+        """give focus to the first group or contact wich contain the given name
+        @param name: name to check
+        @param select: if True, the contact/group is also clicked"""
         idx = 0
         for widget in self.frame.body.body:
             try:
-                if widget.getValue() == name:
+                if name in widget.getValue():
                     self.frame.body.set_focus(idx)
+                    if select:
+                        self.__contactClicked(widget, True)
                     return
             except AttributeError:
                 pass