comparison src/browser/sat_browser/contact.py @ 574:b07f0fe2763a

browser_side: safer attributes handling in getOrCreateLiberviaWidget + use it to create MUC panels
author souliane <souliane@mailoo.org>
date Sat, 18 Oct 2014 13:16:56 +0200
parents f0c8a4d51890
children 668bb04e9708
comparison
equal deleted inserted replaced
573:12823bcbd05b 574:b07f0fe2763a
78 base_widget.DragLabel.__init__(self, group, "GROUP") 78 base_widget.DragLabel.__init__(self, group, "GROUP")
79 ClickHandler.__init__(self) 79 ClickHandler.__init__(self)
80 self.addClickListener(self) 80 self.addClickListener(self)
81 81
82 def onClick(self, sender): 82 def onClick(self, sender):
83 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, self.group) 83 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': self.group})
84 84
85 85
86 class ContactLabel(HTML): 86 class ContactLabel(HTML):
87 def __init__(self, jid, name=None): 87 def __init__(self, jid, name=None):
88 HTML.__init__(self) 88 HTML.__init__(self)
203 self.click_listener = None 203 self.click_listener = None
204 self.handle_menu = handle_menu 204 self.handle_menu = handle_menu
205 205
206 if handle_click: 206 if handle_click:
207 def cb(contact_jid): 207 def cb(contact_jid):
208 self.host.getOrCreateLiberviaWidget(panels.ChatPanel, contact_jid) 208 self.host.getOrCreateLiberviaWidget(panels.ChatPanel, {'item': contact_jid})
209 self.click_listener = cb 209 self.click_listener = cb
210 210
211 def add(self, jid_s, name=None): 211 def add(self, jid_s, name=None):
212 """Add a contact to the list. 212 """Add a contact to the list.
213 213
293 base_widget.DragLabel.__init__(self, text, "CONTACT_TITLE") 293 base_widget.DragLabel.__init__(self, text, "CONTACT_TITLE")
294 ClickHandler.__init__(self) 294 ClickHandler.__init__(self)
295 self.addClickListener(self) 295 self.addClickListener(self)
296 296
297 def onClick(self, sender): 297 def onClick(self, sender):
298 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, None) 298 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': None})
299 299
300 300
301 class ContactPanel(SimplePanel): 301 class ContactPanel(SimplePanel):
302 """Manage the contacts and groups""" 302 """Manage the contacts and groups"""
303 303