Mercurial > libervia-web
comparison browser_side/panels.py @ 20:8f4b1a8914c3
- User status is now updated
- by default, the uniBar target the status
- clicking on user's status unselect the selected widget
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 16 Apr 2011 18:06:02 +0200 |
parents | e8e3704eb97f |
children | 586f69e85559 |
comparison
equal
deleted
inserted
replaced
19:e8e3704eb97f | 20:8f4b1a8914c3 |
---|---|
210 for group in self.accepted_groups: | 210 for group in self.accepted_groups: |
211 if self.host.contactPanel.isContactInGroup(group, jid): | 211 if self.host.contactPanel.isContactInGroup(group, jid): |
212 return True | 212 return True |
213 return False | 213 return False |
214 | 214 |
215 class StatusPanel(HTMLPanel): | 215 class StatusPanel(HTMLPanel, ClickHandler): |
216 def __init__(self, status=''): | 216 def __init__(self, host, status=''): |
217 self.status = status | 217 self.host = host |
218 self.status = status or ' ' | |
218 HTMLPanel.__init__(self, self.__getContent()) | 219 HTMLPanel.__init__(self, self.__getContent()) |
220 self.setStyleName('statusPanel') | |
221 ClickHandler.__init__(self) | |
222 self.addClickListener(self) | |
219 | 223 |
220 def __getContent(self): | 224 def __getContent(self): |
221 return "<span class='status'>%(status)s</span>" % {'status':self.status} | 225 return "<span class='status'>%(status)s</span>" % {'status':self.status} |
222 | 226 |
223 def changeStatus(self, new_status): | 227 def changeStatus(self, new_status): |
224 self.status = new_status | 228 self.status = new_status or ' ' |
225 self.setHTML(self.__getContent()) | 229 self.setHTML(self.__getContent()) |
230 | |
231 def onClick(self, sender, event): | |
232 #As status is the default target of uniBar, we don't want to select anything if click on it | |
233 self.host.select(None) | |
226 | 234 |
227 class ChatText(HTMLPanel): | 235 class ChatText(HTMLPanel): |
228 | 236 |
229 def __init__(self, timestamp, nick, mymess, msg): | 237 def __init__(self, timestamp, nick, mymess, msg): |
230 _date = datetime.fromtimestamp(float(timestamp or time())) | 238 _date = datetime.fromtimestamp(float(timestamp or time())) |