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
This commit is contained in:
Goffi 2014-08-13 14:48:49 +02:00
commit b6563c596b

View file

@ -24,7 +24,7 @@ from urwid_satext.files_management import FileDialog
from sat_frontends.quick_frontend.quick_chat import QuickChat
from sat_frontends.primitivus.card_game import CardGame
from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate
from sat_frontends.primitivus.xmlui import XMLUI
from sat_frontends.primitivus import xmlui
from sat_frontends.primitivus.constants import Const as C
import time
from sat.tools.jid import JID
@ -352,8 +352,8 @@ class Chat(urwid.WidgetWrap, QuickChat):
self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile)
def onConfigureRoom(self, menu):
def gotUI(xmlui):
self.host.addWindow(XMLUI(self.host, xmlui))
def gotUI(xml_ui):
self.host.addWindow(xmlui.create(self.host, xml_ui))
def configureError(failure):
self.host.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.host.removePopUp))
self.host.bridge.configureRoom(self.id, self.host.profile, callback=gotUI, errback=configureError)