Mercurial > libervia-backend
comparison frontends/src/wix/chat.py @ 361:141eeb7cd9e6
Quizz game: first draft
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 12 Jun 2011 16:28:33 +0200 |
parents | 1a990a88bff2 |
children | e66d300c5d42 |
comparison
equal
deleted
inserted
replaced
360:6b5626c37909 | 361:141eeb7cd9e6 |
---|---|
28 from logging import debug, info, error, warning | 28 from logging import debug, info, error, warning |
29 from sat.tools.jid import JID | 29 from sat.tools.jid import JID |
30 from sat_frontends.quick_frontend.quick_chat import QuickChat | 30 from sat_frontends.quick_frontend.quick_chat import QuickChat |
31 from sat_frontends.wix.contact_list import ContactList | 31 from sat_frontends.wix.contact_list import ContactList |
32 from sat_frontends.wix.card_game import CardPanel | 32 from sat_frontends.wix.card_game import CardPanel |
33 from sat_frontends.wix.quiz_game import QuizPanel | |
33 | 34 |
34 | 35 |
35 idSEND = 1 | 36 idSEND = 1 |
36 idTAROT = 2 | 37 idTAROT = 2 |
37 | 38 |
116 self.tarot_panel = CardPanel(self, referee, players, self.nick) | 117 self.tarot_panel = CardPanel(self, referee, players, self.nick) |
117 self.sizer.Prepend(self.tarot_panel, 0, flag=wx.EXPAND) | 118 self.sizer.Prepend(self.tarot_panel, 0, flag=wx.EXPAND) |
118 self.sizer.Layout() | 119 self.sizer.Layout() |
119 self.Fit() | 120 self.Fit() |
120 self.splitter.UpdateSize() | 121 self.splitter.UpdateSize() |
122 elif game_type=="Quiz": | |
123 debug (_("configure chat window for Quiz game")) | |
124 self.quiz_panel = QuizPanel(self, referee, players, self.nick) | |
125 self.sizer.Prepend(self.quiz_panel, 0, flag=wx.EXPAND) | |
126 self.sizer.Layout() | |
127 self.Fit() | |
128 self.splitter.UpdateSize() | |
121 | 129 |
122 def getGame(self, game_type): | 130 def getGame(self, game_type): |
123 """Return class managing the game type""" | 131 """Return class managing the game type""" |
124 #TODO: check that the game is launched, and manage errors | 132 #TODO: check that the game is launched, and manage errors |
125 if game_type=="Tarot": | 133 if game_type=="Tarot": |
126 return self.tarot_panel | 134 return self.tarot_panel |
127 | 135 elif game_type=="Quiz": |
136 return self.quiz_panel | |
128 | 137 |
129 def setPresents(self, nicks): | 138 def setPresents(self, nicks): |
130 """Set the users presents in the contact list for a group chat | 139 """Set the users presents in the contact list for a group chat |
131 @param nicks: list of nicknames | 140 @param nicks: list of nicknames |
132 """ | 141 """ |