comparison src/browser/sat_browser/libervia_widget.py @ 663:423182fea41c frontends_multi_profiles

browser_side: fixes OTR using the new resource system and proper triggers (send and receive message) or listener (presence update)
author souliane <souliane@mailoo.org>
date Tue, 03 Mar 2015 07:21:50 +0100
parents ebb602d8b3f2
children 849ffb24d5bf
comparison
equal deleted inserted replaced
662:ebb602d8b3f2 663:423182fea41c
360 def __init__(self, host, title='', info=None, selectable=False): 360 def __init__(self, host, title='', info=None, selectable=False):
361 """Init the widget 361 """Init the widget
362 362
363 @param host (SatWebFrontend): SatWebFrontend instance 363 @param host (SatWebFrontend): SatWebFrontend instance
364 @param title (unicode): title shown in the header of the widget 364 @param title (unicode): title shown in the header of the widget
365 @param info (unicode, callable): info shown in the header of the widget 365 @param info (unicode): info shown in the header of the widget
366 @param selectable (bool): True is widget can be selected by user 366 @param selectable (bool): True is widget can be selected by user
367 """ 367 """
368 VerticalPanel.__init__(self) 368 VerticalPanel.__init__(self)
369 DropCell.__init__(self, host) 369 DropCell.__init__(self, host)
370 ClickHandler.__init__(self) 370 ClickHandler.__init__(self)
373 self._setting_button_id = HTMLPanel.createUniqueId() 373 self._setting_button_id = HTMLPanel.createUniqueId()
374 self._close_button_id = HTMLPanel.createUniqueId() 374 self._close_button_id = HTMLPanel.createUniqueId()
375 self._title = Label(title) 375 self._title = Label(title)
376 self._title.setStyleName('widgetHeader_title') 376 self._title.setStyleName('widgetHeader_title')
377 if info is not None: 377 if info is not None:
378 if isinstance(info, unicode): 378 self._info = HTML(info)
379 self._info = HTML(info)
380 else: # the info will be set by a callback
381 assert callable(info)
382 self._info = HTML()
383 info(self._info.setHTML)
384 self._info.setStyleName('widgetHeader_info') 379 self._info.setStyleName('widgetHeader_info')
385 else: 380 else:
386 self._info = None 381 self._info = None
387 header = WidgetHeader(self, host, self._title, self._info) 382 header = WidgetHeader(self, host, self._title, self._info)
388 self.add(header) 383 self.add(header)