comparison src/browser/sat_browser/game_radiocol.py @ 839:09ace5cbcb9b

browser (games, menu): rename showFailureRoomInvalid to onJoinMUCFailure and display a nice message when the room has already been joined (it is not a real error)
author souliane <souliane@mailoo.org>
date Wed, 13 Jan 2016 13:11:44 +0100
parents f8a7a046ff9c
children 0c0551967bdf
comparison
equal deleted inserted replaced
838:ab87da500820 839:09ace5cbcb9b
255 self.addClickListener(self) 255 self.addClickListener(self)
256 256
257 help_msg = """Accepted file formats: Ogg Vorbis (recommended), MP3.<br /> 257 help_msg = """Accepted file formats: Ogg Vorbis (recommended), MP3.<br />
258 Please do not submit files that are protected by copyright.<br /> 258 Please do not submit files that are protected by copyright.<br />
259 Click <a style="color: red;">here</a> if you need some support :)""" 259 Click <a style="color: red;">here</a> if you need some support :)"""
260 link_cb = lambda: self._parent.host.bridge.joinMUC(self._parent.host.default_muc, self._parent.nick, profile=C.PROF_KEY_NONE, callback=lambda dummy: None, errback=self.host.showFailureRoomInvalid) 260 link_cb = lambda: self._parent.host.bridge.joinMUC(self._parent.host.default_muc, self._parent.nick, profile=C.PROF_KEY_NONE, callback=lambda dummy: None, errback=self._parent.host.onJoinMUCFailure)
261 self._parent.printInfo(help_msg, type_='link', link_cb=link_cb) 261 self._parent.printInfo(help_msg, type_='link', link_cb=link_cb)
262 262
263 def pushNextSong(self, title): 263 def pushNextSong(self, title):
264 """Add a song to the left panel's next songs queue""" 264 """Add a song to the left panel's next songs queue"""
265 next_song = Label(title) 265 next_song = Label(title)
331 def hostReady(host): 331 def hostReady(host):
332 def onCollectiveRadio(self): 332 def onCollectiveRadio(self):
333 def callback(room_jid, contacts): 333 def callback(room_jid, contacts):
334 contacts = [unicode(contact) for contact in contacts] 334 contacts = [unicode(contact) for contact in contacts]
335 room_jid_s = unicode(room_jid) if room_jid else '' 335 room_jid_s = unicode(room_jid) if room_jid else ''
336 host.bridge.launchRadioCollective(contacts, room_jid_s, profile=C.PROF_KEY_NONE, callback=lambda dummy: None, errback=host.showFailureRoomInvalid) 336 host.bridge.launchRadioCollective(contacts, room_jid_s, profile=C.PROF_KEY_NONE, callback=lambda dummy: None, errback=host.onJoinMUCFailure)
337 dialog.RoomAndContactsChooser(host, callback, ok_button="Choose", title="Collective Radio", visible=(False, True)) 337 dialog.RoomAndContactsChooser(host, callback, ok_button="Choose", title="Collective Radio", visible=(False, True))
338 338
339 339
340 def gotMenus(): 340 def gotMenus():
341 host.menus.addMenu(C.MENU_GLOBAL, (D_(u"Groups"), D_(u"Collective radio")), callback=onCollectiveRadio) 341 host.menus.addMenu(C.MENU_GLOBAL, (D_(u"Groups"), D_(u"Collective radio")), callback=onCollectiveRadio)