comparison 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
comparison
equal deleted inserted replaced
597:be2891462e63 598:ed6d8f7c6026
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 import pyjd # this is dummy in pyjs 20 import pyjd # this is dummy in pyjs
21 from sat.core.log import getLogger 21 from sat.core.log import getLogger
22 log = getLogger(__name__) 22 log = getLogger(__name__)
23 from sat_frontends.quick_frontend import quick_widgets
23 from pyjamas.ui.SimplePanel import SimplePanel 24 from pyjamas.ui.SimplePanel import SimplePanel
24 from pyjamas.ui.AbsolutePanel import AbsolutePanel 25 from pyjamas.ui.AbsolutePanel import AbsolutePanel
25 from pyjamas.ui.VerticalPanel import VerticalPanel 26 from pyjamas.ui.VerticalPanel import VerticalPanel
26 from pyjamas.ui.HorizontalPanel import HorizontalPanel 27 from pyjamas.ui.HorizontalPanel import HorizontalPanel
27 from pyjamas.ui.ScrollPanel import ScrollPanel 28 from pyjamas.ui.ScrollPanel import ScrollPanel
102 DropWidget.__init__(self) 103 DropWidget.__init__(self)
103 self.host = host 104 self.host = host
104 self.setStyleName('dropCell') 105 self.setStyleName('dropCell')
105 106
106 @classmethod 107 @classmethod
107 def addDropKey(cls, key, callback): 108 def addDropKey(cls, key, cb):
108 DropCell.drop_keys[key] = callback 109 """Add a association between a key and a class to create on drop
110
111 @param key: key to be associated (e.g. "CONTACT", "CHAT")
112 @param cb: either a LiberviaWidget instance, or a callback which return one
113 """
114 DropCell.drop_keys[key] = cb
115
109 116
110 def onDragEnter(self, event): 117 def onDragEnter(self, event):
111 if self == LiberviaDragWidget.current: 118 if self == LiberviaDragWidget.current:
112 return 119 return
113 self.addStyleName('dragover') 120 self.addStyleName('dragover')