Mercurial > libervia-web
diff 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 |
line wrap: on
line diff
--- a/browser_side/base_widget.py Tue Oct 08 13:48:00 2013 +0200 +++ b/browser_side/base_widget.py Tue Oct 08 13:57:35 2013 +0200 @@ -207,6 +207,12 @@ """ Called when the widget is actually ending """ pass + def refresh(self): + """This can be overwritten by a child class to refresh the display when, + instead of creating a new one, an existing widget is found and reused. + """ + pass + def onSetting(self, sender): widpanel = self.getWidgetsPanel() row, col = widpanel.getIndex(self) @@ -334,6 +340,10 @@ # the event will not propagate to children VerticalPanel.doAttachChildren(self) + def matchEntity(self, entity): + """This method should be overwritten by child classes.""" + raise NotImplementedError + class ScrollPanelWrapper(SimplePanel): """Scroll Panel like component, wich use the full available space