# HG changeset patch # User Goffi # Date 1410193956 -7200 # Node ID 6184779544c703ac5c6a33ce88a697a001ebd4dc # Parent 62cba918cc63e30f71bc0cfc486b783783337457 Primitivus (xmlui): fixed window closing on save params + removed now unused onConfigureRoom in Chat diff -r 62cba918cc63 -r 6184779544c7 frontends/src/primitivus/chat.py --- a/frontends/src/primitivus/chat.py Mon Sep 08 18:15:15 2014 +0200 +++ b/frontends/src/primitivus/chat.py Mon Sep 08 18:32:36 2014 +0200 @@ -26,7 +26,6 @@ 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 import xmlui from sat_frontends.primitivus.constants import Const as C from sat_frontends.primitivus.keys import action_key_map as a_key import time @@ -372,13 +371,6 @@ else: self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile) - def onConfigureRoom(self, menu): - 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) - def onSendFileRequest(self, menu): # TODO: move this to core with dynamic menus dialog = FileDialog(ok_cb=self.onFileSelected, cancel_cb=self.host.removePopUp) diff -r 62cba918cc63 -r 6184779544c7 frontends/src/primitivus/primitivus --- a/frontends/src/primitivus/primitivus Mon Sep 08 18:15:15 2014 +0200 +++ b/frontends/src/primitivus/primitivus Mon Sep 08 18:32:36 2014 +0200 @@ -657,7 +657,8 @@ def onParam(self, menu): def success(params): - self.addWindow(xmlui.create(self, xml_data=params)) + ui = xmlui.create(self, xml_data=params) + ui.show() def failure(error): self.showPopUp(sat_widgets.Alert(_("Error"), _("Can't get parameters (%s)") % error, ok_cb=self.removePopUp)) diff -r 62cba918cc63 -r 6184779544c7 frontends/src/primitivus/xmlui.py --- a/frontends/src/primitivus/xmlui.py Mon Sep 08 18:15:15 2014 +0200 +++ b/frontends/src/primitivus/xmlui.py Mon Sep 08 18:32:36 2014 +0200 @@ -20,6 +20,7 @@ from sat.core.i18n import _ import urwid import copy +from sat.core import exceptions from urwid_satext import sat_widgets from urwid_satext import files_management from sat.core.log import getLogger @@ -405,8 +406,10 @@ def _xmluiClose(self): if self._dest == 'window': self.host.removeWindow() + elif self._dest == 'popup': + self.host.removePopUp() else: - self.host.removePopUp() + raise exceptions.InternalError("self._dest unknown, are you sure you have called XMLUI.show ?") class XMLUIDialog(xmlui.XMLUIDialog):