diff frontends/src/wix/card_game.py @ 1106:e2e1e27a3680

frontends: XMLUI refactoring + dialogs: - there are now XMLUIPanel and XMLUIDialog both inheriting from XMLUIBase - following dialogs are managed: - MessageDialog - NoteDialog - ConfirmDialog - FileDialog - XMLUI creation is now made using xmlui.create(...) instead of instanciating directly XMLUI - classes must be registed in frontends - "parent" attribute renamed to "_xmlui_parent" to avoid name conflicts with frontends toolkits
author Goffi <goffi@goffi.org>
date Wed, 13 Aug 2014 14:48:49 +0200
parents 5a6354ff468c
children
line wrap: on
line diff
--- a/frontends/src/wix/card_game.py	Mon Aug 11 19:10:24 2014 +0200
+++ b/frontends/src/wix/card_game.py	Wed Aug 13 14:48:49 2014 +0200
@@ -25,7 +25,7 @@
 log = getLogger(__name__)
 from sat_frontends.tools.games import TarotCard
 from sat_frontends.quick_frontend.quick_card_game import QuickCardGame
-from sat_frontends.wix.xmlui import XMLUI
+from sat_frontends.wix import xmlui
 
 CARD_WIDTH = 74
 CARD_HEIGHT = 136
@@ -103,7 +103,7 @@
     def chooseContrat(self, xml_data):
         """Called when the player has to select his contrat
         @param xml_data: SàT xml representation of the form"""
-        XMLUI(self.parent.host, xml_data, title=_('Please choose your contrat'), flags=['NO_CANCEL'])
+        xmlui.create(self.parent.host, xml_data, title=_('Please choose your contrat'), flags=['NO_CANCEL'])
 
     def showScores(self, xml_data, winners, loosers):
         """Called when the round is over, display the scores
@@ -112,7 +112,7 @@
             title = _("Draw game")
         else:
             title = _('You win \o/') if self.player_nick in winners else _('You loose :(')
-        XMLUI(self.parent.host, xml_data, title=title, flags=['NO_CANCEL'])
+        xmlui.create(self.parent.host, xml_data, title=title, flags=['NO_CANCEL'])
 
     def cardsPlayed(self, player, cards):
         """A card has been played by player"""