diff libervia.py @ 218:4e6467efd6bf

browser_side: small improvements for parameters panel - auto-select the first tab - remove the parameters item if there's nothing to display
author souliane <souliane@mailoo.org>
date Sat, 07 Sep 2013 19:54:41 +0200
parents e830a0c60d32
children 624a87377412
line wrap: on
line diff
--- a/libervia.py	Sun Sep 08 12:34:00 2013 +0200
+++ b/libervia.py	Sat Sep 07 19:54:41 2013 +0200
@@ -287,6 +287,7 @@
 
         #it's time to fill the page
         self.bridge.call('getContacts', self._getContactsCB)
+        self.bridge.call('getParamsUI', self._getParamsUICB)
         self.bridge_signals.call('getSignals', self._getSignalsCB)
         #We want to know our own jid
         self.bridge.call('getProfileJid', self._getProfileJidCB)
@@ -345,6 +346,11 @@
         elif name == 'chatStateReceived':
             self._chatStateReceivedCb(*args)
 
+    def _getParamsUICB(self, xmlui):
+        """Hide the parameters item if there's nothing to display"""
+        if not xmlui:
+            self.panel.menu.removeItemParams()
+
     def _ownBlogsFills(self, mblogs):
         #put our own microblogs in cache, then fill all panels with them
         for publisher in mblogs: