comparison browser_side/base_widget.py @ 201:aa76793da353

server + browser: message warning level/sending refactoring: - widgets now manage themselves warning level - widgets now manage themselves text entered (if they are selectable, onTextEntered must be present) - Unibox now default to selected widget/status bar, except if a hook syntax is used (e.g. "@@: public microblog") - warning message is now GROUP (in blue with default theme) when sending a message to a MUC room (instead of green before) - "@.*: " syntaxes are now fully managed by browser, no more by server
author Goffi <goffi@goffi.org>
date Sun, 07 Apr 2013 22:33:55 +0200
parents ab239b3b67b3
children 3092f6b1710c
comparison
equal deleted inserted replaced
200:0f5c2f799913 201:aa76793da353
282 pass 282 pass
283 if self.selectable and not self in self._clickListeners: 283 if self.selectable and not self in self._clickListeners:
284 self.addClickListener(self) 284 self.addClickListener(self)
285 self.__selectable = selectable 285 self.__selectable = selectable
286 286
287 def getWarningData(self):
288 """ Return exposition warning level when this widget is selected and something is sent to it
289 This method should be overriden by children
290 @return: tuple (warning level type/HTML msg). Type can be one of:
291 - PUBLIC
292 - GROUP
293 - ONE2ONE
294 - MISC
295 - NONE
296 """
297 if not self.__selectable:
298 print "ERROR: getWarningLevel must not be called for an unselectable widget"
299 raise Exception
300 # TODO: cleaner warning types (more general constants)
301 return ("NONE", None)
302
287 def setWidget(self, widget, scrollable=True): 303 def setWidget(self, widget, scrollable=True):
288 """Set the widget that will be in the body of the LiberviaWidget 304 """Set the widget that will be in the body of the LiberviaWidget
289 @param widget: widget to put in the body 305 @param widget: widget to put in the body
290 @param scrollable: if true, the widget will be in a ScrollPanelWrapper""" 306 @param scrollable: if true, the widget will be in a ScrollPanelWrapper"""
291 if scrollable: 307 if scrollable: