comparison frontends/wix/chat.py @ 78:ace2af8abc5a

Added method to know which MUC are joined, and which subjects were received. - plugin xep-0045: new methods getRoomJoined and getRoomSubjects - wix: room joined are openned and subjects are set on profile plug
author Goffi <goffi@goffi.org>
date Wed, 31 Mar 2010 17:16:27 +1100
parents 1ae680f9682e
children db0a0f000e37
comparison
equal deleted inserted replaced
77:1ae680f9682e 78:ace2af8abc5a
49 self.conv_panel.sizer.Add(self.subjectBox, flag=wx.EXPAND) 49 self.conv_panel.sizer.Add(self.subjectBox, flag=wx.EXPAND)
50 self.conv_panel.sizer.Add(self.chatWindow, 1, flag=wx.EXPAND) 50 self.conv_panel.sizer.Add(self.chatWindow, 1, flag=wx.EXPAND)
51 self.conv_panel.sizer.Add(self.textBox, flag=wx.EXPAND) 51 self.conv_panel.sizer.Add(self.textBox, flag=wx.EXPAND)
52 self.conv_panel.SetSizer(self.conv_panel.sizer) 52 self.conv_panel.SetSizer(self.conv_panel.sizer)
53 self.splitter.Initialize(self.conv_panel) 53 self.splitter.Initialize(self.conv_panel)
54 self.SetMenuBar(wx.MenuBar())
54 self.setType(self.type) 55 self.setType(self.type)
55
56 self.__createMenus()
57 56
58 #events 57 #events
59 self.Bind(wx.EVT_CLOSE, self.onClose, self) 58 self.Bind(wx.EVT_CLOSE, self.onClose, self)
60 self.Bind(wx.EVT_TEXT_ENTER, self.onEnterPressed, self.textBox) 59 self.Bind(wx.EVT_TEXT_ENTER, self.onEnterPressed, self.textBox)
61 60
84 def setType(self, type): 83 def setType(self, type):
85 QuickChat.setType(self, type) 84 QuickChat.setType(self, type)
86 if type is 'group' and not self.splitter.IsSplit(): 85 if type is 'group' and not self.splitter.IsSplit():
87 self.__createPresents() 86 self.__createPresents()
88 self.subjectBox.Show() 87 self.subjectBox.Show()
88 self.__eraseMenus()
89
89 elif type is 'one2one' and self.splitter.IsSplit(): 90 elif type is 'one2one' and self.splitter.IsSplit():
90 self.splitter.Unsplit(self.present_panel) 91 self.splitter.Unsplit(self.present_panel)
91 del self.present_panel 92 del self.present_panel
93 self.GetMenuBar().Show()
94 self.subjectBox.Hide()
95 self.__createMenus_O2O()
92 else: 96 else:
93 self.subjectBox.Hide() 97 self.subjectBox.Hide()
98 self.__createMenus_O2O()
94 99
95 def setPresents(self, nicks): 100 def setPresents(self, nicks):
96 """Set the users presents in the contact list for a group chat 101 """Set the users presents in the contact list for a group chat
97 @param nicks: list of nicknames 102 @param nicks: list of nicknames
98 """ 103 """
127 error (_("[INTERNAL] trying to set subject for a non group chat window")) 132 error (_("[INTERNAL] trying to set subject for a non group chat window"))
128 return 133 return
129 self.subjectBox.SetValue(subject) 134 self.subjectBox.SetValue(subject)
130 135
131 136
132 def __createMenus(self): 137 def __eraseMenus(self):
138 """erase all menus"""
139 menuBar = self.GetMenuBar()
140 for i in range(menuBar.GetMenuCount()):
141 menuBar.Remove(i)
142
143 def __createMenus_O2O(self):
144 """create menu bar for one 2 one chat"""
133 info("Creating menus") 145 info("Creating menus")
146 self.__eraseMenus()
147 menuBar = self.GetMenuBar()
134 actionMenu = wx.Menu() 148 actionMenu = wx.Menu()
135 actionMenu.Append(idSEND, _("&SendFile CTRL-s"),_(" Send a file to contact")) 149 actionMenu.Append(idSEND, _("&SendFile CTRL-s"),_(" Send a file to contact"))
136 menuBar = wx.MenuBar()
137 menuBar.Append(actionMenu,_("&Action")) 150 menuBar.Append(actionMenu,_("&Action"))
138 self.SetMenuBar(menuBar)
139 151
140 #events 152 #events
141 wx.EVT_MENU(self, idSEND, self.onSendFile) 153 wx.EVT_MENU(self, idSEND, self.onSendFile)
142 154
143 def __del__(self): 155 def __del__(self):