Mercurial > libervia-web
comparison src/browser/sat_browser/contact_list.py @ 616:1c0d5a87c554 frontends_multi_profiles
browser_side: add and use method displayWidget to harmonize widget's management in Libervia (not completely done, there are some issues)
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 11 Feb 2015 11:18:13 +0100 |
parents | 14bdf5394ae9 |
children | 5baca9d46c34 |
comparison
equal
deleted
inserted
replaced
615:70872a83ef15 | 616:1c0d5a87c554 |
---|---|
33 from __pyjamas__ import doc | 33 from __pyjamas__ import doc |
34 | 34 |
35 from sat_frontends.tools import jid | 35 from sat_frontends.tools import jid |
36 from constants import Const as C | 36 from constants import Const as C |
37 import base_widget | 37 import base_widget |
38 import panels | |
39 import html_tools | 38 import html_tools |
40 import chat | 39 import chat |
40 import blog | |
41 | 41 |
42 | 42 |
43 unicode = str # XXX: pyjama doesn't manage unicode | 43 unicode = str # XXX: pyjama doesn't manage unicode |
44 | 44 |
45 | 45 |
81 base_widget.DragLabel.__init__(self, group, "GROUP", host) | 81 base_widget.DragLabel.__init__(self, group, "GROUP", host) |
82 ClickHandler.__init__(self) | 82 ClickHandler.__init__(self) |
83 self.addClickListener(self) | 83 self.addClickListener(self) |
84 | 84 |
85 def onClick(self, sender): | 85 def onClick(self, sender): |
86 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': self.group}) | 86 self.host.displayWidget(blog.MicroblogPanel, self.group) |
87 | 87 |
88 | 88 |
89 class ContactLabel(HTML): | 89 class ContactLabel(HTML): |
90 def __init__(self, jid, name=None): | 90 def __init__(self, jid, name=None): |
91 HTML.__init__(self) | 91 HTML.__init__(self) |
217 self.click_listener = None | 217 self.click_listener = None |
218 self.handle_menu = handle_menu | 218 self.handle_menu = handle_menu |
219 | 219 |
220 if handle_click: | 220 if handle_click: |
221 def cb(contact_jid): | 221 def cb(contact_jid): |
222 host.widgets.getOrCreateWidget(chat.Chat, contact_jid, type_=C.CHAT_ONE2ONE, profile=C.PROF_KEY_NONE) | 222 host.displayWidget(chat.Chat, contact_jid, type_=C.CHAT_ONE2ONE) |
223 self.click_listener = cb | 223 self.click_listener = cb |
224 | 224 |
225 def add(self, jid_, name=None): | 225 def add(self, jid_, name=None): |
226 """Add a contact to the list. | 226 """Add a contact to the list. |
227 | 227 |
312 base_widget.DragLabel.__init__(self, text, "CONTACT_TITLE", host) | 312 base_widget.DragLabel.__init__(self, text, "CONTACT_TITLE", host) |
313 ClickHandler.__init__(self) | 313 ClickHandler.__init__(self) |
314 self.addClickListener(self) | 314 self.addClickListener(self) |
315 | 315 |
316 def onClick(self, sender): | 316 def onClick(self, sender): |
317 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': None}) | 317 self.host.displayWidget(blog.MicroblogPanel, None) |
318 | 318 |
319 | 319 |
320 class ContactList(SimplePanel, QuickContactList): | 320 class ContactList(SimplePanel, QuickContactList): |
321 """Manage the contacts and groups""" | 321 """Manage the contacts and groups""" |
322 | 322 |