comparison browser_side/panels.py @ 22:586f69e85559

browser_side: removed some useless mess + changed delay for warning message to 2s
author Goffi <goffi@goffi.org>
date Sun, 17 Apr 2011 00:38:33 +0200
parents 8f4b1a8914c3
children 0ce2a57b34ca
comparison
equal deleted inserted replaced
21:77c2e48efa29 22:586f69e85559
125 _new_panel.historyPrint() 125 _new_panel.historyPrint()
126 elif item_type=="CONTACT_TITLE": 126 elif item_type=="CONTACT_TITLE":
127 _new_panel = MicroblogPanel(self.host, accept_all=True) 127 _new_panel = MicroblogPanel(self.host, accept_all=True)
128 self.host.mpanels.remove(self) 128 self.host.mpanels.remove(self)
129 self.host.mpanels.append(_new_panel) 129 self.host.mpanels.append(_new_panel)
130 print "DEBUG"
131 grid = self.getParent() 130 grid = self.getParent()
132 row_idx, cell_idx = self._getCellAndRow(grid, event) 131 row_idx, cell_idx = self._getCellAndRow(grid, event)
133 self.removeFromParent() 132 self.removeFromParent()
134 if self.host.selected == self: 133 if self.host.selected == self:
135 self.host.select(None) 134 self.host.select(None)
234 233
235 class ChatText(HTMLPanel): 234 class ChatText(HTMLPanel):
236 235
237 def __init__(self, timestamp, nick, mymess, msg): 236 def __init__(self, timestamp, nick, mymess, msg):
238 _date = datetime.fromtimestamp(float(timestamp or time())) 237 _date = datetime.fromtimestamp(float(timestamp or time()))
239 print "DEBUG"
240 print timestamp
241 print time()
242 print _date
243 _msg_class = ["chat_text_msg"] 238 _msg_class = ["chat_text_msg"]
244 if mymess: 239 if mymess:
245 _msg_class.append("chat_text_mymess") 240 _msg_class.append("chat_text_mymess")
246 HTMLPanel.__init__(self, "<span class='chat_text_timestamp'>%(timestamp)s</span> <span class='chat_text_nick'>%(nick)s</span> <span class='%(msg_class)s'>%(msg)s</span>" % 241 HTMLPanel.__init__(self, "<span class='chat_text_timestamp'>%(timestamp)s</span> <span class='chat_text_nick'>%(nick)s</span> <span class='%(msg_class)s'>%(msg)s</span>" %
247 {"timestamp": _date.strftime("%H:%M"), 242 {"timestamp": _date.strftime("%H:%M"),
317 self.add(self._right) 312 self.add(self._right)
318 self.setCellWidth(self._right, "85%") 313 self.setCellWidth(self._right, "85%")
319 self.setHeight('100%') 314 self.setHeight('100%')
320 315
321 def changePanel(self, idx, panel): 316 def changePanel(self, idx, panel):
322 print "panel:",panel
323 print "idx:",idx
324 self._right.setWidget(0,idx,panel) 317 self._right.setWidget(0,idx,panel)
325 318
326 class MainPanel(VerticalPanel): 319 class MainPanel(VerticalPanel):
327 320
328 def __init__(self, host): 321 def __init__(self, host):