comparison frontends/src/primitivus/chat.py @ 510:886754295efe

quick frontend, primitivus, wix: MUC private messages management /!\ not fully finished, backend part is not done yet /!\ - as resources are discarded to manage chat windows lists, a pretty dirty hack is done to work around this: full jid is escaped using a prefix (it becomes invalid and resource is preserved). - new quick_utils module, with helper methods. escapePrivate and unescapePrivate implementations - MUC private messages are not managed in Wix yet
author Goffi <goffi@goffi.org>
date Thu, 11 Oct 2012 00:48:35 +0200
parents f98bef71a918
children 62f7f2403093
comparison
equal deleted inserted replaced
509:64ff046dc201 510:886754295efe
20 """ 20 """
21 21
22 import urwid 22 import urwid
23 from urwid_satext import sat_widgets 23 from urwid_satext import sat_widgets
24 from urwid_satext.files_management import FileDialog 24 from urwid_satext.files_management import FileDialog
25 from sat_frontends.quick_frontend.quick_contact_list import QuickContactList
26 from sat_frontends.quick_frontend.quick_chat import QuickChat 25 from sat_frontends.quick_frontend.quick_chat import QuickChat
27 from sat_frontends.primitivus.card_game import CardGame 26 from sat_frontends.primitivus.card_game import CardGame
27 from sat_frontends.quick_frontend.quick_utils import unescapePrivate
28 import time 28 import time
29 from sat.tools.jid import JID 29 from sat.tools.jid import JID
30 30
31 31
32 class ChatText(urwid.FlowWidget): 32 class ChatText(urwid.FlowWidget):
143 present_widget = self.__buildPresentList() 143 present_widget = self.__buildPresentList()
144 self.present_panel = sat_widgets.VerticalSeparator(present_widget) 144 self.present_panel = sat_widgets.VerticalSeparator(present_widget)
145 self.__appendPresentPanel() 145 self.__appendPresentPanel()
146 146
147 def __getDecoration(self, widget): 147 def __getDecoration(self, widget):
148 return sat_widgets.LabelLine(widget, sat_widgets.SurroundedText(unicode(self.target))) 148 return sat_widgets.LabelLine(widget, sat_widgets.SurroundedText(unicode(unescapePrivate(self.target))))
149 149
150 def showDecoration(self, show=True): 150 def showDecoration(self, show=True):
151 """Show/Hide the decoration around the chat window""" 151 """Show/Hide the decoration around the chat window"""
152 if show: 152 if show:
153 main_widget = self.__getDecoration(self.pile) 153 main_widget = self.__getDecoration(self.pile)