comparison frontends/src/wix/main_window.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 e9634d2e7b38
children 8ee9113d307b
comparison
equal deleted inserted replaced
509:64ff046dc201 510:886754295efe
20 """ 20 """
21 21
22 22
23 from sat_frontends.quick_frontend.quick_chat_list import QuickChatList 23 from sat_frontends.quick_frontend.quick_chat_list import QuickChatList
24 from sat_frontends.quick_frontend.quick_app import QuickApp 24 from sat_frontends.quick_frontend.quick_app import QuickApp
25 from sat_frontends.quick_frontend.quick_contact_management import QuickContactManagement
26 import wx 25 import wx
27 from sat_frontends.wix.contact_list import ContactList 26 from sat_frontends.wix.contact_list import ContactList
28 from sat_frontends.wix.chat import Chat 27 from sat_frontends.wix.chat import Chat
29 from sat_frontends.wix.param import Param 28 from sat_frontends.wix.param import Param
30 from sat_frontends.wix.xmlui import XMLUI 29 from sat_frontends.wix.xmlui import XMLUI
31 from sat_frontends.wix.gateways import GatewaysManager 30 from sat_frontends.wix.gateways import GatewaysManager
32 from sat_frontends.wix.profile import Profile 31 from sat_frontends.wix.profile import Profile
33 from sat_frontends.wix.profile_manager import ProfileManager 32 from sat_frontends.wix.profile_manager import ProfileManager
34 import gobject
35 import os.path 33 import os.path
36 import pdb
37 from sat.tools.jid import JID 34 from sat.tools.jid import JID
38 from logging import debug, info, warning, error 35 from logging import debug, info, warning, error
39 import sat_frontends.wix.constants 36 import sat_frontends.wix.constants
40 37
41 idCONNECT,\ 38 idCONNECT,\
49 idJOIN_ROOM,\ 46 idJOIN_ROOM,\
50 idFIND_GATEWAYS = range(10) 47 idFIND_GATEWAYS = range(10)
51 48
52 class ChatList(QuickChatList): 49 class ChatList(QuickChatList):
53 """This class manage the list of chat windows""" 50 """This class manage the list of chat windows"""
54
55 def __init__(self, host):
56 QuickChatList.__init__(self, host)
57 51
58 def createChat(self, target): 52 def createChat(self, target):
59 return Chat(target, self.host) 53 return Chat(target, self.host)
60 54
61 class MainWindow(wx.Frame, QuickApp): 55 class MainWindow(wx.Frame, QuickApp):
184 wx.EVT_MENU(self, idSHOW_PROFILE, self.onShowProfile) 178 wx.EVT_MENU(self, idSHOW_PROFILE, self.onShowProfile)
185 wx.EVT_MENU(self, idJOIN_ROOM, self.onJoinRoom) 179 wx.EVT_MENU(self, idJOIN_ROOM, self.onJoinRoom)
186 wx.EVT_MENU(self, idFIND_GATEWAYS, self.onFindGateways) 180 wx.EVT_MENU(self, idFIND_GATEWAYS, self.onFindGateways)
187 181
188 182
189 def newMessage(self, from_jid, msg, type, to_jid, profile): 183 def newMessage(self, from_jid, to_jid, msg, _type, profile):
190 QuickApp.newMessage(self, from_jid, msg, type, to_jid, profile) 184 QuickApp.newMessage(self, from_jid, to_jid, msg, _type, profile)
191 185
192 def showAlert(self, message): 186 def showAlert(self, message):
193 # TODO: place this in a separate class 187 # TODO: place this in a separate class
194 popup=wx.PopupWindow(self) 188 popup=wx.PopupWindow(self)
195 ### following code come from wxpython demo 189 ### following code come from wxpython demo