comparison browser_side/base_widget.py @ 230:266e9678eec0

browser_side: added the flag REUSE_EXISTING_LIBERVIA_WIDGETS - do not create a new chat panel for contacts/groups if a similar one is found in the same tab - this goes with a modification of the methods to create new panels, especially arguments handling - improvement of the accepted groups list for MicroblogPanel (remove duplicates and keep sorted) Details for the new flag: # Set to true to not create a new LiberviaWidget when a similar one # already exist (i.e. a chat panel with the same target). Instead # the existing widget will be eventually removed from its parent # and added to new WidgetsPanel, or replaced to the expected # position if the previous and the new parent are the same.
author souliane <souliane@mailoo.org>
date Tue, 08 Oct 2013 13:57:35 +0200
parents 9b93a21dc5e2
children 0ed09cc0566f
comparison
equal deleted inserted replaced
229:e632f77c4219 230:266e9678eec0
205 205
206 def onQuit(self): 206 def onQuit(self):
207 """ Called when the widget is actually ending """ 207 """ Called when the widget is actually ending """
208 pass 208 pass
209 209
210 def refresh(self):
211 """This can be overwritten by a child class to refresh the display when,
212 instead of creating a new one, an existing widget is found and reused.
213 """
214 pass
215
210 def onSetting(self, sender): 216 def onSetting(self, sender):
211 widpanel = self.getWidgetsPanel() 217 widpanel = self.getWidgetsPanel()
212 row, col = widpanel.getIndex(self) 218 row, col = widpanel.getIndex(self)
213 body = VerticalPanel() 219 body = VerticalPanel()
214 220
331 337
332 def doAttachChildren(self): 338 def doAttachChildren(self):
333 # We need to force the use of a panel subclass method here, else 339 # We need to force the use of a panel subclass method here, else
334 # the event will not propagate to children 340 # the event will not propagate to children
335 VerticalPanel.doAttachChildren(self) 341 VerticalPanel.doAttachChildren(self)
342
343 def matchEntity(self, entity):
344 """This method should be overwritten by child classes."""
345 raise NotImplementedError
336 346
337 347
338 class ScrollPanelWrapper(SimplePanel): 348 class ScrollPanelWrapper(SimplePanel):
339 """Scroll Panel like component, wich use the full available space 349 """Scroll Panel like component, wich use the full available space
340 to work around percent size issue, it use some of the ideas found 350 to work around percent size issue, it use some of the ideas found