changeset 116:aff34642616b

browser side: widgets are now added in a widgetsPanel when a tab is created
author Goffi <goffi@goffi.org>
date Tue, 05 Jul 2011 14:06:03 +0200
parents f8af6b21ed61
children 2e2e10785c33
files libervia.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libervia.py	Tue Jul 05 14:05:30 2011 +0200
+++ b/libervia.py	Tue Jul 05 14:06:03 2011 +0200
@@ -28,6 +28,7 @@
 from pyjamas.JSONService import JSONProxy
 from browser_side.register import RegisterBox
 from browser_side.contact import ContactPanel
+from browser_side.panels import WidgetsPanel
 from browser_side import panels, dialog
 from browser_side.jid import JID
 from browser_side.tools import html_sanitize
@@ -164,11 +165,13 @@
         if widget:
             self.selected.addStyleName('selected_widget')
 
-    def addTab(self, panel, label):
-        """Add a panel in a tab
-        @param panel: panel to add
+    def addTab(self, wid, label):
+        """Create a new tab and add a widget in
+        @param wid: LiberviaWidget to add
         @param label: label of the tab"""
-        self.tab_panel.add(panel, label)
+        _widgets_panel = WidgetsPanel(self)
+        _widgets_panel.addWidget(wid)
+        self.tab_panel.add(_widgets_panel, label)
 
     def _isRegisteredCB(self, registered):
         if not registered: