# HG changeset patch # User Goffi # Date 1304805261 -7200 # Node ID d89982865c5762b1474c75d8a9b006e1cfeb087d # Parent 824516b247e6ecd317820647b178932b10c6e94d browser side: ContactsChooser is now used to ask for 3 others players when tarot game is launched + names refactoring diff -r 824516b247e6 -r d89982865c57 browser_side/panels.py --- a/browser_side/panels.py Sat May 07 23:52:44 2011 +0200 +++ b/browser_side/panels.py Sat May 07 23:54:21 2011 +0200 @@ -41,6 +41,7 @@ from jid import JID from datetime import datetime from time import time +from dialog import ContactsChooser class MenuCmd: @@ -75,7 +76,10 @@ def onTarotGame(self): #Window.alert("Tarot selected") - self.host.tab_panel.add(EmptyPanel(self.host), "Tarot") + #self.host.tab_panel.add(EmptyPanel(self.host), "Tarot") + def onPlayersSelected(other_players): + self.host.bridge.call('launchTarotGame', None, other_players) + ContactsChooser(self.host, onPlayersSelected, 3, text="Please select 3 other players").getContacts() def onXiangqiGame(self): Window.alert("Xiangqi selected") @@ -210,7 +214,7 @@ if self.accept_all: return True for group in self.accepted_groups: - if self.host.contactPanel.isContactInGroup(group, jid): + if self.host.contact_panel.isContactInGroup(group, jid): return True return False @@ -306,7 +310,7 @@ def __init__(self, host): self.host=host HorizontalPanel.__init__(self) - self._left = self.host.contactPanel + self._left = self.host.contact_panel self._right = Grid(1,3) self._right.setWidth('100%') self._right.setHeight('100%') @@ -341,8 +345,8 @@ self.setVerticalAlignment(HasAlignment.ALIGN_TOP) menu = Menu(host) - uni_box = host.uniBox - status = host.statusPanel + uni_box = host.uni_box + status = host.status_panel self.tab_panel = MainTabPannel(self) self.tab_panel.setWidth('100%') self.tab_panel.setHeight('100%')