changeset 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
files src/browser/libervia_main.py src/browser/sat_browser/base_widget.py
diffstat 2 files changed, 7 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/libervia_main.py	Mon Feb 09 21:58:49 2015 +0100
+++ b/src/browser/libervia_main.py	Tue Feb 10 19:10:28 2015 +0100
@@ -79,7 +79,6 @@
         QuickApp.__init__(self, json.BridgeCall)
         self.uni_box = None # FIXME: to be removed
         self.status_panel = HTML('<br />')
-        # self.contact_panel = contact.ContactPanel(self)
         self.panel = panels.MainPanel(self)
         self.discuss_panel = self.panel.discuss_panel
         self.tab_panel = self.panel.tab_panel
@@ -98,16 +97,10 @@
         self.init_cache = []  # used to cache events until initialisation is done
         self.cached_params = {}
 
-        #FIXME: to be removed (managed with cache and in quick_frontend
         #FIXME: microblog cache should be managed directly in blog module
         self.mblog_cache = []  # used to keep our own blog entries in memory, to show them in new mblog panel
 
-
-
-        # panels.ChatPanel.registerClass()
-        # panels.MicroblogPanel.registerClass()
-        # self._selected_listeners = set()
-        # # self.avatars_cache = {}  # keep track of jid's avatar hash (key=jid, value=file)
+        # self._selected_listeners = set() # FIXME: to be done with new listeners mechanism
 
     @property
     def whoami(self):
--- a/src/browser/sat_browser/base_widget.py	Mon Feb 09 21:58:49 2015 +0100
+++ b/src/browser/sat_browser/base_widget.py	Tue Feb 10 19:10:28 2015 +0100
@@ -294,7 +294,6 @@
             self._info.setStyleName('widgetHeader_info')
         else:
             self._info = None
-        self._close_listeners = []
         header = WidgetHeader(self, host, self._title, self._info)
         self.add(header)
         self.setSize('100%', '100%')
@@ -302,12 +301,13 @@
         if self._selectable:
             self.addClickListener(self)
 
-            def onClose(sender):
-                """Check dynamically if the unibox is enable or not"""
-                if self.host.uni_box:
-                    self.host.uni_box.onWidgetClosed(sender)
+            # FIXME
+            # def onClose(sender):
+            #     """Check dynamically if the unibox is enable or not"""
+            #     if self.host.uni_box:
+            #         self.host.uni_box.onWidgetClosed(sender)
 
-            self.addCloseListener(onClose)
+            # self.addCloseListener(onClose)
         # self.host.registerWidget(self) # FIXME
 
     def getDebugName(self):
@@ -341,19 +341,12 @@
         """ Called when the close button is pushed """
         _widgetspanel = self.getWidgetsPanel()
         _widgetspanel.removeWidget(self)
-        for callback in self._close_listeners:
-            callback(self)
         self.onQuit()
 
     def onQuit(self):
         """ Called when the widget is actually ending """
         pass
 
-    def addCloseListener(self, callback):
-        """Add a close listener to this widget
-        @param callback: function to be called from self.onClose"""
-        self._close_listeners.append(callback)
-
     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.