comparison src/browser/sat_browser/contact_widget.py @ 690:76a67d04c63e

browser_side: improve comments for menus-related methods
author souliane <souliane@mailoo.org>
date Thu, 09 Apr 2015 11:40:53 +0200
parents 3845a086f0b3
children 16079280a39e
comparison
equal deleted inserted replaced
689:a6adefddcb0a 690:76a67d04c63e
82 'contact': contact_html} 82 'contact': contact_html}
83 self.setHTML(html) 83 self.setHTML(html)
84 84
85 85
86 class ContactMenuBar(base_widget.WidgetMenuBar): 86 class ContactMenuBar(base_widget.WidgetMenuBar):
87 """WidgetMenuBar displaying the contact's avatar as category."""
87 88
88 def onBrowserEvent(self, event): 89 def onBrowserEvent(self, event):
89 base_widget.WidgetMenuBar.onBrowserEvent(self, event) 90 base_widget.WidgetMenuBar.onBrowserEvent(self, event)
90 event.stopPropagation() # prevent opening the chat dialog 91 event.stopPropagation() # prevent opening the chat dialog
91 92
92 @classmethod 93 @classmethod
93 def getCategoryHTML(cls, menu_name_i18n, type_): 94 def getCategoryHTML(cls, category):
95 """Return the HTML code for displaying contact's avatar.
96
97 @param category (quick_menus.MenuCategory): ignored
98 @return(unicode): HTML to display
99 """
94 return '<img src="%s"/>' % C.DEFAULT_AVATAR_URL 100 return '<img src="%s"/>' % C.DEFAULT_AVATAR_URL
95 101
96 def setUrl(self, url): 102 def setUrl(self, url):
97 """Set the URL of the contact avatar.""" 103 """Set the URL of the contact avatar.
104
105 @param url (unicode): avatar URL
106 """
98 self.items[0].setHTML('<img src="%s" />' % url) 107 self.items[0].setHTML('<img src="%s" />' % url)
99 108
100 109
101 class ContactBox(VerticalPanel, ClickHandler, libervia_widget.DragLabel): 110 class ContactBox(VerticalPanel, ClickHandler, libervia_widget.DragLabel):
102 111