comparison browser_side/panels.py @ 200:0f5c2f799913

browser side: clicking on the contacts list (contact item, group or the "contacts" main title) open a discussion or microblog
author Goffi <goffi@goffi.org>
date Mon, 25 Mar 2013 14:09:10 +0100
parents 39311c7dad77
children aa76793da353
comparison
equal deleted inserted replaced
199:39311c7dad77 200:0f5c2f799913
261 self.vpanel.setStyleName('microblogPanel') 261 self.vpanel.setStyleName('microblogPanel')
262 self.setWidget(self.vpanel) 262 self.setWidget(self.vpanel)
263 263
264 @classmethod 264 @classmethod
265 def registerClass(cls): 265 def registerClass(cls):
266 base_widget.LiberviaWidget.addDropKey("GROUP", cls.onDropCreateGroup) 266 base_widget.LiberviaWidget.addDropKey("GROUP", cls.createGroup)
267 base_widget.LiberviaWidget.addDropKey("CONTACT_TITLE", cls.onDropCreateMeta) 267 base_widget.LiberviaWidget.addDropKey("CONTACT_TITLE", cls.createMeta)
268 268
269 @classmethod 269 @classmethod
270 def onDropCreateGroup(cls, host, item): 270 def createGroup(cls, host, item):
271 _new_panel = MicroblogPanel(host, [item]) #XXX: pyjamas doesn't support use of cls directly 271 _new_panel = MicroblogPanel(host, [item]) #XXX: pyjamas doesn't support use of cls directly
272 _new_panel.setAcceptedGroup(item) 272 _new_panel.setAcceptedGroup(item)
273 host.FillMicroblogPanel(_new_panel) 273 host.FillMicroblogPanel(_new_panel)
274 host.bridge.call('getMassiveLastMblogs', _new_panel.massiveInsert, 'GROUP', [item], 10) 274 host.bridge.call('getMassiveLastMblogs', _new_panel.massiveInsert, 'GROUP', [item], 10)
275 return _new_panel 275 return _new_panel
276 276
277 @classmethod 277 @classmethod
278 def onDropCreateMeta(cls, host, item): 278 def createMeta(cls, host, item):
279 _new_panel = MicroblogPanel(host, []) #XXX: pyjamas doesn't support use of cls directly 279 _new_panel = MicroblogPanel(host, []) #XXX: pyjamas doesn't support use of cls directly
280 host.FillMicroblogPanel(_new_panel) 280 host.FillMicroblogPanel(_new_panel)
281 host.bridge.call('getMassiveLastMblogs', _new_panel.massiveInsert, 'ALL', [], 10) 281 host.bridge.call('getMassiveLastMblogs', _new_panel.massiveInsert, 'ALL', [], 10)
282 return _new_panel 282 return _new_panel
283 283
474 #the event will not propagate to children 474 #the event will not propagate to children
475 base_widget.ScrollPanelWrapper.doAttachChildren(self)""" 475 base_widget.ScrollPanelWrapper.doAttachChildren(self)"""
476 476
477 @classmethod 477 @classmethod
478 def registerClass(cls): 478 def registerClass(cls):
479 base_widget.LiberviaWidget.addDropKey("CONTACT", cls.onDropCreate) 479 base_widget.LiberviaWidget.addDropKey("CONTACT", cls.createChat)
480 480
481 @classmethod 481 @classmethod
482 def onDropCreate(cls, host, item): 482 def createChat(cls, host, item):
483 _contact = JID(item) 483 _contact = JID(item)
484 host.contact_panel.setContactMessageWaiting(_contact.bare, False) 484 host.contact_panel.setContactMessageWaiting(_contact.bare, False)
485 _new_panel = ChatPanel(host, _contact) #XXX: pyjamas doesn't seems to support creating with cls directly 485 _new_panel = ChatPanel(host, _contact) #XXX: pyjamas doesn't seems to support creating with cls directly
486 _new_panel.historyPrint() 486 _new_panel.historyPrint()
487 return _new_panel 487 return _new_panel