changeset 614:14bdf5394ae9 frontends_multi_profiles

browser side: fixed jid's public blog menu
author Goffi <goffi@goffi.org>
date Tue, 10 Feb 2015 20:43:26 +0100
parents deddd1cd8aa5
children 70872a83ef15
files src/browser/libervia_main.py src/browser/sat_browser/contact_list.py
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/libervia_main.py	Tue Feb 10 20:42:39 2015 +0100
+++ b/src/browser/libervia_main.py	Tue Feb 10 20:43:26 2015 +0100
@@ -404,7 +404,8 @@
         elif "public_blog" in data:
             # TODO: use the bare instead of node when all blogs can be retrieved
             node = jid.JID(data['public_blog']).node
-            self.addTab("%s's blog" % node, panels.WebPanel(self, "/blog/%s" % node))
+            web_widget = self.widgets.getOrCreateWidget(panels.WebPanel, "/blog/{}".format(node), profile=C.PROF_KEY_NONE, on_new_widget=None, on_existing_widget=C.WIDGET_RECREATE) # FIXME: won't work with unicode nodes
+            self.addTab("{}'s blog".format(unicode(node)), web_widget)
         else:
             dialog.InfoDialog("Error",
                               "Unmanaged action result", Width="400px").center()
--- a/src/browser/sat_browser/contact_list.py	Tue Feb 10 20:42:39 2015 +0100
+++ b/src/browser/sat_browser/contact_list.py	Tue Feb 10 20:43:26 2015 +0100
@@ -40,6 +40,9 @@
 import chat
 
 
+unicode = str # XXX: pyjama doesn't manage unicode
+
+
 def buildPresenceStyle(presence, base_style=None):
     """Return the CSS classname to be used for displaying the given presence information.
     @param presence (str): presence is a value in ('', 'chat', 'away', 'dnd', 'xa')
@@ -137,8 +140,8 @@
             self.click_listener = click_listener
 
     def addMenus(self, menu_bar):
-        menu_bar.addCachedMenus(C.MENU_ROSTER_JID_CONTEXT, {'jid': self.jid})
-        menu_bar.addCachedMenus(C.MENU_JID_CONTEXT, {'jid': self.jid})
+        menu_bar.addCachedMenus(C.MENU_ROSTER_JID_CONTEXT, {'jid': unicode(self.jid)})
+        menu_bar.addCachedMenus(C.MENU_JID_CONTEXT, {'jid': unicode(self.jid)})
 
     def setMessageWaiting(self, waiting):
         """Show a visual indicator if message are waiting