diff browser_side/panels.py @ 255:da0487f0a2e7

browser_side: small changes to prepare the contact group manager: - group and contact lists are sorted - avoid adding empty group in the "Add group" panel - allow to show/hide the contact panel from another class
author souliane <souliane@mailoo.org>
date Sat, 09 Nov 2013 15:31:39 +0100
parents c24715dcd2f6
children 533d68585866
line wrap: on
line diff
--- a/browser_side/panels.py	Sat Nov 09 09:38:17 2013 +0100
+++ b/browser_side/panels.py	Sat Nov 09 15:31:39 2013 +0100
@@ -114,6 +114,10 @@
         #self.getCompletionItems().completions.append(key)
 
     def removeKey(self, key):
+        return
+        # TODO: investigate why AutoCompleteTextBox doesn't work here,
+        # maybe it can work on a TextBox but no TextArea. Remove addKey
+        # and removeKey methods if they don't serve anymore.
         try:
             self.getCompletionItems().completions.remove(key)
         except KeyError:
@@ -890,9 +894,9 @@
         # contacts
         self._contacts = HorizontalPanel()
         self._contacts.addStyleName('globalLeftArea')
-        contacts_switch = Button(u'«', self._contactsSwitch)
-        contacts_switch.addStyleName('contactsSwitch')
-        self._contacts.add(contacts_switch)
+        self.contacts_switch = Button(u'«', self._contactsSwitch)
+        self.contacts_switch.addStyleName('contactsSwitch')
+        self._contacts.add(self.contacts_switch)
         self._contacts.add(self.host.contact_panel)
 
         # tabs
@@ -916,8 +920,10 @@
         self.setWidth("100%")
         Window.addWindowResizeListener(self)
 
-    def _contactsSwitch(self, btn):
+    def _contactsSwitch(self, btn=None):
         """ (Un)hide contacts panel """
+        if btn is None:
+            btn = self.contacts_switch
         cpanel = self.host.contact_panel
         cpanel.setVisible(not cpanel.getVisible())
         btn.setText(u"«" if cpanel.getVisible() else u"»")