comparison frontends/src/primitivus/chat.py @ 1185:6184779544c7

Primitivus (xmlui): fixed window closing on save params + removed now unused onConfigureRoom in Chat
author Goffi <goffi@goffi.org>
date Mon, 08 Sep 2014 18:32:36 +0200
parents 69aace10b46d
children 802b7e6bf098
comparison
equal deleted inserted replaced
1184:62cba918cc63 1185:6184779544c7
24 from urwid_satext import sat_widgets 24 from urwid_satext import sat_widgets
25 from urwid_satext.files_management import FileDialog 25 from urwid_satext.files_management import FileDialog
26 from sat_frontends.quick_frontend.quick_chat import QuickChat 26 from sat_frontends.quick_frontend.quick_chat import QuickChat
27 from sat_frontends.primitivus.card_game import CardGame 27 from sat_frontends.primitivus.card_game import CardGame
28 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate 28 from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate
29 from sat_frontends.primitivus import xmlui
30 from sat_frontends.primitivus.constants import Const as C 29 from sat_frontends.primitivus.constants import Const as C
31 from sat_frontends.primitivus.keys import action_key_map as a_key 30 from sat_frontends.primitivus.keys import action_key_map as a_key
32 import time 31 import time
33 from sat_frontends.tools.jid import JID 32 from sat_frontends.tools.jid import JID
34 33
370 if len(self.occupants) != 4: 369 if len(self.occupants) != 4:
371 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)) 370 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))
372 else: 371 else:
373 self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile) 372 self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile)
374 373
375 def onConfigureRoom(self, menu):
376 def gotUI(xml_ui):
377 self.host.addWindow(xmlui.create(self.host, xml_ui))
378 def configureError(failure):
379 self.host.showPopUp(sat_widgets.Alert(failure.fullname, failure.message, ok_cb=self.host.removePopUp))
380 self.host.bridge.configureRoom(self.id, self.host.profile, callback=gotUI, errback=configureError)
381
382 def onSendFileRequest(self, menu): 374 def onSendFileRequest(self, menu):
383 # TODO: move this to core with dynamic menus 375 # TODO: move this to core with dynamic menus
384 dialog = FileDialog(ok_cb=self.onFileSelected, cancel_cb=self.host.removePopUp) 376 dialog = FileDialog(ok_cb=self.onFileSelected, cancel_cb=self.host.removePopUp)
385 self.host.showPopUp(dialog, 80, 80) 377 self.host.showPopUp(dialog, 80, 80)
386 378