comparison src/browser/sat_browser/base_widget.py @ 609:ec77c2bc18d3 frontends_multi_profiles

brower side: removed close listener for LiberviaWidget
author Goffi <goffi@goffi.org>
date Tue, 10 Feb 2015 19:10:28 +0100
parents ea27925ef2a8
children 5b19fb5eae7e
comparison
equal deleted inserted replaced
608:ea27925ef2a8 609:ec77c2bc18d3
292 self._info = HTML() 292 self._info = HTML()
293 info(self._info.setHTML) 293 info(self._info.setHTML)
294 self._info.setStyleName('widgetHeader_info') 294 self._info.setStyleName('widgetHeader_info')
295 else: 295 else:
296 self._info = None 296 self._info = None
297 self._close_listeners = []
298 header = WidgetHeader(self, host, self._title, self._info) 297 header = WidgetHeader(self, host, self._title, self._info)
299 self.add(header) 298 self.add(header)
300 self.setSize('100%', '100%') 299 self.setSize('100%', '100%')
301 self.addStyleName('widget') 300 self.addStyleName('widget')
302 if self._selectable: 301 if self._selectable:
303 self.addClickListener(self) 302 self.addClickListener(self)
304 303
305 def onClose(sender): 304 # FIXME
306 """Check dynamically if the unibox is enable or not""" 305 # def onClose(sender):
307 if self.host.uni_box: 306 # """Check dynamically if the unibox is enable or not"""
308 self.host.uni_box.onWidgetClosed(sender) 307 # if self.host.uni_box:
309 308 # self.host.uni_box.onWidgetClosed(sender)
310 self.addCloseListener(onClose) 309
310 # self.addCloseListener(onClose)
311 # self.host.registerWidget(self) # FIXME 311 # self.host.registerWidget(self) # FIXME
312 312
313 def getDebugName(self): 313 def getDebugName(self):
314 return "%s (%s)" % (self, self._title.getText()) 314 return "%s (%s)" % (self, self._title.getText())
315 315
339 339
340 def onClose(self, sender): 340 def onClose(self, sender):
341 """ Called when the close button is pushed """ 341 """ Called when the close button is pushed """
342 _widgetspanel = self.getWidgetsPanel() 342 _widgetspanel = self.getWidgetsPanel()
343 _widgetspanel.removeWidget(self) 343 _widgetspanel.removeWidget(self)
344 for callback in self._close_listeners:
345 callback(self)
346 self.onQuit() 344 self.onQuit()
347 345
348 def onQuit(self): 346 def onQuit(self):
349 """ Called when the widget is actually ending """ 347 """ Called when the widget is actually ending """
350 pass 348 pass
351
352 def addCloseListener(self, callback):
353 """Add a close listener to this widget
354 @param callback: function to be called from self.onClose"""
355 self._close_listeners.append(callback)
356 349
357 def refresh(self): 350 def refresh(self):
358 """This can be overwritten by a child class to refresh the display when, 351 """This can be overwritten by a child class to refresh the display when,
359 instead of creating a new one, an existing widget is found and reused. 352 instead of creating a new one, an existing widget is found and reused.
360 """ 353 """