comparison src/browser/sat_browser/game_tarot.py @ 684:e876f493dccc

browser_side: follow changes made on quick_frontend for chat states and MUC symbols + minor fixes following the refactorisation: - some MUC handlers are no more needed, the presence handler is enough - move the chat states logic to quick_frontend - display MUC games symbols - remove classes contact_list.ContactsPanel, contact_panel.Occupant and contact_panel.OccupantsList - move buildPresenceStyle and setPresenceStyle to html_tools - fixes games menu callback
author souliane <souliane@mailoo.org>
date Wed, 18 Mar 2015 10:17:04 +0100
parents 849ffb24d5bf
children 9877607c719a
comparison
equal deleted inserted replaced
683:801eb94aa869 684:e876f493dccc
44 CARD_WIDTH = 74 44 CARD_WIDTH = 74
45 CARD_HEIGHT = 136 45 CARD_HEIGHT = 136
46 CARD_DELTA_Y = 30 46 CARD_DELTA_Y = 30
47 MIN_WIDTH = 950 # Minimum size of the panel 47 MIN_WIDTH = 950 # Minimum size of the panel
48 MIN_HEIGHT = 500 48 MIN_HEIGHT = 500
49
50
51 unicode = str # XXX: pyjama doesn't manage unicode
49 52
50 53
51 class CardWidget(TarotCard, Image, MouseHandler): 54 class CardWidget(TarotCard, Image, MouseHandler):
52 """This class is used to represent a card, graphically and logically""" 55 """This class is used to represent a card, graphically and logically"""
53 56
398 other_players = [unicode(contact) for contact in other_players] 401 other_players = [unicode(contact) for contact in other_players]
399 room_jid_s = unicode(room_jid) if room_jid else '' 402 room_jid_s = unicode(room_jid) if room_jid else ''
400 host.bridge.launchTarotGame(other_players, room_jid_s, profile=C.PROF_KEY_NONE) 403 host.bridge.launchTarotGame(other_players, room_jid_s, profile=C.PROF_KEY_NONE)
401 dialog.RoomAndContactsChooser(host, onPlayersSelected, 3, title="Tarot", title_invite=_(u"Please select 3 other players"), visible=(False, True)) 404 dialog.RoomAndContactsChooser(host, onPlayersSelected, 3, title="Tarot", title_invite=_(u"Please select 3 other players"), visible=(False, True))
402 405
403
404 def gotMenus(): 406 def gotMenus():
405 host.menus.addMenu(C.MENU_GLOBAL, (D_(u"Games"), D_(u"Tarot")), callback=onTarotGame) 407 host.menus.addMenu(C.MENU_GLOBAL, (D_(u"Games"), D_(u"Tarot")), callback=onTarotGame)
406 host.addListener('gotMenus', gotMenus) 408 host.addListener('gotMenus', gotMenus)
407 409
408 host_listener.addListener(hostReady) 410 host_listener.addListener(hostReady)