comparison frontends/wix/chat.py @ 66:8147b4f40809

SàT: multi-profile: DBus signals and frontend adaptation (first draft) - Quick App: new single_profile parameter in __init__ (default: yes), used to tell if the application use only one profile at the time or not - Quick App: new __check_profile method, tell if the profile is used by the current frontend - Quick App: new methods plug_profile, unplug_profile and clear_profile, must be called by the frontend to tell which profiles to use - DBus Bridge: new methods getProfileName, getProfilesList and createProfile
author Goffi <goffi@goffi.org>
date Wed, 03 Feb 2010 23:35:57 +1100
parents a5b5fb5fc9fd
children 0e50dd3a234a
comparison
equal deleted inserted replaced
65:d35c5edab53f 66:8147b4f40809
90 self.host.bridge.sendMessage(self.to_jid, event.GetString()) 90 self.host.bridge.sendMessage(self.to_jid, event.GetString())
91 self.textBox.Clear() 91 self.textBox.Clear()
92 92
93 93
94 94
95 def printMessage(self, from_jid, msg, timestamp=""): #FIXME: factorize with printDistantMessage 95 def printMessage(self, from_jid, msg, profile, timestamp=""):
96 """Print the message with differents colors depending on where it comes from.""" 96 """Print the message with differents colors depending on where it comes from."""
97 jid=JID(from_jid) 97 jid=JID(from_jid)
98 mymess = (jid.short == self.host.whoami.short) #mymess = True if message comes from local user 98 mymess = (jid.short == self.host.profiles[profile]['whoami'].short) #mymess = True if message comes from local user
99 _font = wx.Font(self.font["points"], self.font["family"], wx.NORMAL, wx.BOLD) 99 _font = wx.Font(self.font["points"], self.font["family"], wx.NORMAL, wx.BOLD)
100 self.chatWindow.SetDefaultStyle(wx.TextAttr( "BLACK" if mymess else "BLUE", font=_font)) 100 self.chatWindow.SetDefaultStyle(wx.TextAttr( "BLACK" if mymess else "BLUE", font=_font))
101 self.chatWindow.AppendText("[%s] " % jid) 101 self.chatWindow.AppendText("[%s] " % jid)
102 _font = wx.Font(self.font["points"], self.font["family"], wx.ITALIC if mymess else wx.NORMAL, wx.NORMAL) 102 _font = wx.Font(self.font["points"], self.font["family"], wx.ITALIC if mymess else wx.NORMAL, wx.NORMAL)
103 self.chatWindow.SetDefaultStyle(wx.TextAttr("BLACK", font=_font)) 103 self.chatWindow.SetDefaultStyle(wx.TextAttr("BLACK", font=_font))