comparison browser_side/panels.py @ 394:ee61b0765d6c

browser_side: radiocol supports MP3
author souliane <souliane@mailoo.org>
date Thu, 06 Mar 2014 01:06:19 +0100
parents b90744ec426e
children 98cd5387d291
comparison
equal deleted inserted replaced
393:a3d58514a4d0 394:ee61b0765d6c
289 289
290 def __init__(self): 290 def __init__(self):
291 self._popup = None 291 self._popup = None
292 self._timer = Timer(notify=self._timeCb) 292 self._timer = Timer(notify=self._timeCb)
293 293
294 def showWarning(self, type_=None, msg=None): 294 def showWarning(self, type_=None, msg=None, duration=2000):
295 """Display a popup information message, e.g. to notify the recipient of a message being composed. 295 """Display a popup information message, e.g. to notify the recipient of a message being composed.
296 If type_ is None, a popup being currently displayed will be hidden. 296 If type_ is None, a popup being currently displayed will be hidden.
297 @type_: a type determining the CSS style to be applied (see __showWarning) 297 @type_: a type determining the CSS style to be applied (see __showWarning)
298 @msg: message to be displayed 298 @msg: message to be displayed
299 """ 299 """
304 self.__showWarning(type_, msg) 304 self.__showWarning(type_, msg)
305 elif (type_, msg) != self._popup.target_data: 305 elif (type_, msg) != self._popup.target_data:
306 self._timeCb(None) # we remove the popup 306 self._timeCb(None) # we remove the popup
307 self.__showWarning(type_, msg) 307 self.__showWarning(type_, msg)
308 308
309 self._timer.schedule(2000) 309 self._timer.schedule(duration)
310 310
311 def __showWarning(self, type_, msg): 311 def __showWarning(self, type_, msg):
312 """Display a popup information message, e.g. to notify the recipient of a message being composed. 312 """Display a popup information message, e.g. to notify the recipient of a message being composed.
313 @type_: a type determining the CSS style to be applied. For now the defined styles are 313 @type_: a type determining the CSS style to be applied. For now the defined styles are
314 "NONE" (will do nothing), "PUBLIC", "GROUP", "STATUS" and "ONE2ONE". 314 "NONE" (will do nothing), "PUBLIC", "GROUP", "STATUS" and "ONE2ONE".
322 if type_ == "PUBLIC": 322 if type_ == "PUBLIC":
323 style = "targetPublic" 323 style = "targetPublic"
324 elif type_ == "GROUP": 324 elif type_ == "GROUP":
325 style = "targetGroup" 325 style = "targetGroup"
326 elif type_ == "STATUS": 326 elif type_ == "STATUS":
327 msg = "This will be your new status message"
328 style = "targetStatus" 327 style = "targetStatus"
329 elif type_ == "ONE2ONE": 328 elif type_ == "ONE2ONE":
330 style = "targetOne2One" 329 style = "targetOne2One"
331 else: 330 else:
332 print "ERROR: unknown message type" 331 print "ERROR: unknown message type"