MUC: added subject management

- plugin xep-0045: added roomNewSubject signal
- wix: added subject bar for group windows
This commit is contained in:
Goffi 2010-03-30 13:15:05 +11:00
commit 5486458797

View file

@ -43,15 +43,17 @@ class Chat(wx.Frame, QuickChat):
self.conv_panel = wx.Panel(self.splitter)
self.conv_panel.sizer = wx.BoxSizer(wx.VERTICAL)
self.subjectBox = wx.TextCtrl(self.conv_panel, -1, style = wx.TE_READONLY)
self.chatWindow = wx.TextCtrl(self.conv_panel, -1, style = wx.TE_MULTILINE | wx.TE_RICH | wx.TE_READONLY)
self.textBox = wx.TextCtrl(self.conv_panel, -1, style = wx.TE_PROCESS_ENTER)
self.conv_panel.sizer.Add(self.subjectBox, flag=wx.EXPAND)
self.conv_panel.sizer.Add(self.chatWindow, 1, flag=wx.EXPAND)
self.conv_panel.sizer.Add(self.textBox, flag=wx.EXPAND)
self.conv_panel.SetSizer(self.conv_panel.sizer)
self.splitter.Initialize(self.conv_panel)
self.setType(self.type)
self.createMenus()
self.__createMenus()
#events
self.Bind(wx.EVT_CLOSE, self.onClose, self)
@ -83,9 +85,12 @@ class Chat(wx.Frame, QuickChat):
QuickChat.setType(self, type)
if type is 'group' and not self.splitter.IsSplit():
self.__createPresents()
self.subjectBox.Show()
elif type is 'one2one' and self.splitter.IsSplit():
self.splitter.Unsplit(self.present_panel)
del self.present_panel
else:
self.subjectBox.Hide()
def setPresents(self, nicks):
"""Set the users presents in the contact list for a group chat
@ -115,9 +120,16 @@ class Chat(wx.Frame, QuickChat):
return
self.present_panel.presents.remove(nick)
def setSubject(self, subject):
"""Set title for a group chat"""
debug(_("Setting subject to %s") % subject)
if self.type != "group":
error (_("[INTERNAL] trying to set subject for a non group chat window"))
return
self.subjectBox.SetValue(subject)
def createMenus(self):
def __createMenus(self):
info("Creating menus")
actionMenu = wx.Menu()
actionMenu.Append(idSEND, _("&SendFile CTRL-s"),_(" Send a file to contact"))