Mercurial > libervia-backend
comparison frontends/src/primitivus/chat.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 | 11e2bb20e896 |
children | d1f6b927131e |
comparison
equal
deleted
inserted
replaced
1105:018bdd687747 | 1106:e2e1e27a3680 |
---|---|
22 from urwid_satext import sat_widgets | 22 from urwid_satext import sat_widgets |
23 from urwid_satext.files_management import FileDialog | 23 from urwid_satext.files_management import FileDialog |
24 from sat_frontends.quick_frontend.quick_chat import QuickChat | 24 from sat_frontends.quick_frontend.quick_chat import QuickChat |
25 from sat_frontends.primitivus.card_game import CardGame | 25 from sat_frontends.primitivus.card_game import CardGame |
26 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate | 26 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate |
27 from sat_frontends.primitivus.xmlui import XMLUI | 27 from sat_frontends.primitivus import xmlui |
28 from sat_frontends.primitivus.constants import Const as C | 28 from sat_frontends.primitivus.constants import Const as C |
29 import time | 29 import time |
30 from sat.tools.jid import JID | 30 from sat.tools.jid import JID |
31 | 31 |
32 | 32 |
350 self.host.showPopUp(sat_widgets.Alert(_("Can't start game"), _("You need to be exactly 4 peoples in the room to start a Tarot game"), ok_cb=self.host.removePopUp)) | 350 self.host.showPopUp(sat_widgets.Alert(_("Can't start game"), _("You need to be exactly 4 peoples in the room to start a Tarot game"), ok_cb=self.host.removePopUp)) |
351 else: | 351 else: |
352 self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile) | 352 self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile) |
353 | 353 |
354 def onConfigureRoom(self, menu): | 354 def onConfigureRoom(self, menu): |
355 def gotUI(xmlui): | 355 def gotUI(xml_ui): |
356 self.host.addWindow(XMLUI(self.host, xmlui)) | 356 self.host.addWindow(xmlui.create(self.host, xml_ui)) |
357 def configureError(failure): | 357 def configureError(failure): |
358 self.host.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.host.removePopUp)) | 358 self.host.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.host.removePopUp)) |
359 self.host.bridge.configureRoom(self.id, self.host.profile, callback=gotUI, errback=configureError) | 359 self.host.bridge.configureRoom(self.id, self.host.profile, callback=gotUI, errback=configureError) |
360 | 360 |
361 def onSendFileRequest(self, menu): | 361 def onSendFileRequest(self, menu): |