comparison 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
comparison
equal deleted inserted replaced
510:886754295efe 511:62f7f2403093
71 for group in self.groups: 71 for group in self.groups:
72 if jid.short in self.groups[group][1]: 72 if jid.short in self.groups[group][1]:
73 return True 73 return True
74 return False 74 return False
75 75
76 def setFocus(self, name): 76 def setFocus(self, name, select=False):
77 """give focus to the first group or contact with the given name""" 77 """give focus to the first group or contact wich contain the given name
78 @param name: name to check
79 @param select: if True, the contact/group is also clicked"""
78 idx = 0 80 idx = 0
79 for widget in self.frame.body.body: 81 for widget in self.frame.body.body:
80 try: 82 try:
81 if widget.getValue() == name: 83 if name in widget.getValue():
82 self.frame.body.set_focus(idx) 84 self.frame.body.set_focus(idx)
85 if select:
86 self.__contactClicked(widget, True)
83 return 87 return
84 except AttributeError: 88 except AttributeError:
85 pass 89 pass
86 idx+=1 90 idx+=1
87 91