diff src/browser/sat_browser/base_widget.py @ 598:ed6d8f7c6026 frontends_multi_profiles

browser side (blog, chat): fixed dropKey callbacks to adapt them to new widget creation system. Drag'n'Drop should be fixed.
author Goffi <goffi@goffi.org>
date Fri, 06 Feb 2015 19:25:17 +0100
parents 9054793ab60d
children 462d0458e679 7af8f4ab3675
line wrap: on
line diff
--- a/src/browser/sat_browser/base_widget.py	Fri Feb 06 19:23:08 2015 +0100
+++ b/src/browser/sat_browser/base_widget.py	Fri Feb 06 19:25:17 2015 +0100
@@ -20,6 +20,7 @@
 import pyjd  # this is dummy in pyjs
 from sat.core.log import getLogger
 log = getLogger(__name__)
+from sat_frontends.quick_frontend import quick_widgets
 from pyjamas.ui.SimplePanel import SimplePanel
 from pyjamas.ui.AbsolutePanel import AbsolutePanel
 from pyjamas.ui.VerticalPanel import VerticalPanel
@@ -104,8 +105,14 @@
         self.setStyleName('dropCell')
 
     @classmethod
-    def addDropKey(cls, key, callback):
-        DropCell.drop_keys[key] = callback
+    def addDropKey(cls, key, cb):
+        """Add a association between a key and a class to create on drop
+
+        @param key: key to be associated (e.g. "CONTACT", "CHAT")
+        @param cb: either a LiberviaWidget instance, or a callback which return one
+        """
+        DropCell.drop_keys[key] = cb
+
 
     def onDragEnter(self, event):
         if self == LiberviaDragWidget.current: