comparison src/browser/sat_browser/card_game.py @ 500:67a4e8383b70

browser side (XMLUI): XMLUI update to follow core changes: - Dialogs are now managed - FileDialog raise a NotImplementedError, it's not yet possible in Libervia - XMLUIPanel.show is implemented - following core changes, we now create an XMLUI with xmlui.create(...) - WidgetFactory now inherit from GenericFactory - workaround for __getattr__ bug in pyjamas, now createXXX are automaticaly created with inspection
author Goffi <goffi@goffi.org>
date Wed, 13 Aug 2014 14:09:09 +0200
parents 97c72fe4a5f2
children 79fbc20c786b
comparison
equal deleted inserted replaced
499:ec3f30253040 500:67a4e8383b70
297 dialog.ConfirmDialog(self._ecartConfirm, "Put these cards into chien ?").show() 297 dialog.ConfirmDialog(self._ecartConfirm, "Put these cards into chien ?").show()
298 298
299 def tarotGameChooseContrat(self, xml_data): 299 def tarotGameChooseContrat(self, xml_data):
300 """Called when the player has to select his contrat 300 """Called when the player has to select his contrat
301 @param xml_data: SàT xml representation of the form""" 301 @param xml_data: SàT xml representation of the form"""
302 body = xmlui.XMLUI(self._parent.host, xml_data, flags=['NO_CANCEL']) 302 body = xmlui.create(self._parent.host, xml_data, flags=['NO_CANCEL'])
303 _dialog = dialog.GenericDialog(_('Please choose your contrat'), body, options=['NO_CLOSE']) 303 _dialog = dialog.GenericDialog(_('Please choose your contrat'), body, options=['NO_CLOSE'])
304 body.setCloseCb(_dialog.close) 304 body.setCloseCb(_dialog.close)
305 _dialog.show() 305 _dialog.show()
306 306
307 def tarotGameShowCards(self, game_stage, cards, data): 307 def tarotGameShowCards(self, game_stage, cards, data):
379 else: 379 else:
380 if self.player_nick in winners: 380 if self.player_nick in winners:
381 title = "You <b>win</b> !" 381 title = "You <b>win</b> !"
382 else: 382 else:
383 title = "You <b>loose</b> :(" 383 title = "You <b>loose</b> :("
384 body = xmlui.XMLUI(self._parent.host, xml_data, title=title, flags=['NO_CANCEL']) 384 body = xmlui.create(self._parent.host, xml_data, title=title, flags=['NO_CANCEL'])
385 _dialog = dialog.GenericDialog(title, body, options=['NO_CLOSE']) 385 _dialog = dialog.GenericDialog(title, body, options=['NO_CLOSE'])
386 body.setCloseCb(_dialog.close) 386 body.setCloseCb(_dialog.close)
387 _dialog.show() 387 _dialog.show()