comparison src/browser/sat_browser/contact_list.py @ 911:997cf25e785c

browser side (contact list): fixed groups displaying
author Goffi <goffi@goffi.org>
date Wed, 10 Aug 2016 22:51:18 +0200
parents e8b133b77aa4
children 1ced5b522ae2
comparison
equal deleted inserted replaced
910:bc2082685234 911:997cf25e785c
61 61
62 def __init__(self, parent): 62 def __init__(self, parent):
63 VerticalPanel.__init__(self) 63 VerticalPanel.__init__(self)
64 self.setStyleName('groupPanel') 64 self.setStyleName('groupPanel')
65 self._parent = parent 65 self._parent = parent
66 66 self._groups = set()
67 @property
68 def _groups(self):
69 return self._parent.contact_list._groups
70 67
71 def add(self, group): 68 def add(self, group):
72 if group in self._groups: 69 if group in self._groups:
73 log.warning("trying to add an already existing group") 70 log.warning("trying to add an already existing group")
74 return 71 return
100 if isinstance(wid, GroupLabel) and wid.group == group: 97 if isinstance(wid, GroupLabel) and wid.group == group:
101 return wid 98 return wid
102 return None 99 return None
103 100
104 def getGroups(self): 101 def getGroups(self):
105 return set([g for g in self._groups if g is not None]) 102 return self._groups
106 103
107 104
108 class ContactTitleLabel(libervia_widget.DragLabel, Label, ClickHandler): 105 class ContactTitleLabel(libervia_widget.DragLabel, Label, ClickHandler):
109 106
110 def __init__(self, host, text): 107 def __init__(self, host, text):
200 if contact_jid == contact_box.jid: 197 if contact_jid == contact_box.jid:
201 return True 198 return True
202 return False 199 return False
203 200
204 def getGroups(self): 201 def getGroups(self):
205 return self._group_panel.getGroups() 202 return set([g for g in self._groups if g is not None])
206 203
207 def onMouseMove(self, sender, x, y): 204 def onMouseMove(self, sender, x, y):
208 pass 205 pass
209 206
210 def onMouseDown(self, sender, x, y): 207 def onMouseDown(self, sender, x, y):