comparison src/browser/sat_browser/contact_list.py @ 697:b395d1309936

browser_side: clean the code that has been commented or isolated during the refactorisation to base libervia on quick_frontend
author souliane <souliane@mailoo.org>
date Mon, 20 Apr 2015 09:14:03 +0200
parents c2f22ca12e23
children 3b91225b457a
comparison
equal deleted inserted replaced
696:c2f22ca12e23 697:b395d1309936
231 def onNickUpdate(self, jid_, new_nick, profile): 231 def onNickUpdate(self, jid_, new_nick, profile):
232 box = self._contacts_panel.getContactBox(jid_) 232 box = self._contacts_panel.getContactBox(jid_)
233 if box: 233 if box:
234 box.update() 234 box.update()
235 235
236 def hasVisibleMembers(self, group):
237 """Tell if the given group actually has visible members
238
239 @param group (unicode): the group to check
240 @return: boolean
241 """
242 raise Exception # FIXME: remove this method
243 for jid_ in self.groups[group]:
244 if self._contacts_panel.updateContactBox(jid_).isVisible():
245 return True
246 return False
247
248 def offlineContactsToShow(self): 236 def offlineContactsToShow(self):
249 """Tell if offline contacts should be visible according to the user settings 237 """Tell if offline contacts should be visible according to the user settings
250 238
251 @return: boolean 239 @return: boolean
252 """ 240 """
262 def onPresenceUpdate(self, entity, show, priority, statuses, profile): 250 def onPresenceUpdate(self, entity, show, priority, statuses, profile):
263 QuickContactList.onPresenceUpdate(self, entity, show, priority, statuses, profile) 251 QuickContactList.onPresenceUpdate(self, entity, show, priority, statuses, profile)
264 box = self._contacts_panel.getContactBox(entity) 252 box = self._contacts_panel.getContactBox(entity)
265 if box: # box doesn't exist for MUC bare entity, don't create it 253 if box: # box doesn't exist for MUC bare entity, don't create it
266 box.update() 254 box.update()
267
268 # def updateVisibility(self, jids, groups):
269 # """Set the widgets visibility for the given contacts and groups
270
271 # @param jids (list[unicode]): list of JID
272 # @param groups (list[unicode]): list of groups
273 # """
274 # for jid_s in jids:
275 # try:
276 # self._contacts_panel.getContactBox(jid_s).setVisible(jid_s in self.connected or self.offlineContactsToShow())
277 # except TypeError:
278 # log.warning('No box for contact %s: this code line should not be reached' % jid_s)
279 # for group in groups:
280 # try:
281 # self._group_panel.getGroupBox(group).setVisible(self.hasVisibleMembers(group) or self.emtyGroupsToShow())
282 # except TypeError:
283 # log.warning('No box for group %s: this code line should not be reached' % group)
284
285 # def refresh(self):
286 # """Show or hide disconnected contacts and empty groups"""
287 # self.updateVisibility(self._contacts_panel.contacts, self.groups.keys())
288 255
289 256
290 class JIDList(list): 257 class JIDList(list):
291 """JID-friendly list implementation for Pyjamas""" 258 """JID-friendly list implementation for Pyjamas"""
292 259