comparison src/browser/sat_browser/contact_list.py @ 606:7af8f4ab3675 frontends_multi_profiles

browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
author Goffi <goffi@goffi.org>
date Mon, 09 Feb 2015 21:55:16 +0100
parents 32dbbc941123
children 537649f6a2d0
comparison
equal deleted inserted replaced
605:917e271975d9 606:7af8f4ab3675
111 base_widget.WidgetMenuBar.onBrowserEvent(self, event) 111 base_widget.WidgetMenuBar.onBrowserEvent(self, event)
112 event.stopPropagation() # prevent opening the chat dialog 112 event.stopPropagation() # prevent opening the chat dialog
113 113
114 @classmethod 114 @classmethod
115 def getCategoryHTML(cls, menu_name_i18n, type_): 115 def getCategoryHTML(cls, menu_name_i18n, type_):
116 return '<img src="%s"/>' % C.DEFAULT_AVATAR 116 return '<img src="%s"/>' % C.DEFAULT_AVATAR_URL
117 117
118 def setUrl(self, url): 118 def setUrl(self, url):
119 """Set the URL of the contact avatar.""" 119 """Set the URL of the contact avatar."""
120 self.items[0].setHTML('<img src="%s" />' % url) 120 self.items[0].setHTML('<img src="%s" />' % url)
121 121
126 VerticalPanel.__init__(self, StyleName='contactBox', VerticalAlignment='middle') 126 VerticalPanel.__init__(self, StyleName='contactBox', VerticalAlignment='middle')
127 base_widget.DragLabel.__init__(self, jid_, "CONTACT", host) 127 base_widget.DragLabel.__init__(self, jid_, "CONTACT", host)
128 self.jid = jid_ 128 self.jid = jid_
129 self.label = ContactLabel(jid_, name) 129 self.label = ContactLabel(jid_, name)
130 self.avatar = ContactMenuBar(self, host) if handle_menu else Image() 130 self.avatar = ContactMenuBar(self, host) if handle_menu else Image()
131 # self.updateAvatar(host.getAvatar(jid_)) # FIXME 131 self.updateAvatar(host.getAvatarURL(jid_))
132 self.add(self.avatar) 132 self.add(self.avatar)
133 self.add(self.label) 133 self.add(self.label)
134 if click_listener: 134 if click_listener:
135 ClickHandler.__init__(self) 135 ClickHandler.__init__(self)
136 self.addClickListener(self) 136 self.addClickListener(self)