diff frontends/src/primitivus/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 b12706d164d7
children c0f15e52695a
line wrap: on
line diff
--- a/frontends/src/primitivus/card_game.py	Mon Aug 11 19:10:24 2014 +0200
+++ b/frontends/src/primitivus/card_game.py	Wed Aug 13 14:48:49 2014 +0200
@@ -22,7 +22,7 @@
 from urwid_satext import sat_widgets
 from sat_frontends.tools.games import TarotCard
 from sat_frontends.quick_frontend.quick_card_game import QuickCardGame
-from sat_frontends.primitivus.xmlui import XMLUI
+from sat_frontends.primitivus import xmlui
 
 
 class CardDisplayer(urwid.Text):
@@ -269,7 +269,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"""
-        form = XMLUI(self.parent.host, xml_data, title=_('Please choose your contrat'), flags=['NO_CANCEL'])
+        form = xmlui.create(self.parent.host, xml_data, title=_('Please choose your contrat'), flags=['NO_CANCEL'])
         form.show(valign='top')
 
     def showCards(self, game_stage, cards, data):
@@ -288,7 +288,7 @@
             title = _("Draw game")
         else:
             title = _('You win \o/') if self.player_nick in winners else _('You loose :(')
-        form = XMLUI(self.parent.host, xml_data, title=title, flags=['NO_CANCEL'])
+        form = xmlui.create(self.parent.host, xml_data, title=title, flags=['NO_CANCEL'])
         form.show()
 
     def invalidCards(self, phase, played_cards, invalid_cards):