comparison frontends/src/wix/contact_list.py @ 685:0b9bd47dffcd

primitivus, wix: auto-display MUC dialog after it has been joined: - a patch will follow to add a parameter for the user to choose between "always open", "never open" and "ask each time".
author souliane <souliane@mailoo.org>
date Mon, 28 Oct 2013 18:29:34 +0100
parents 84a6e83157c2
children f7878ad3c846
comparison
equal deleted inserted replaced
684:969562c4761b 685:0b9bd47dffcd
164 164
165 _present = self.__presentItem(contact) 165 _present = self.__presentItem(contact)
166 if _present: 166 if _present:
167 self.Insert(_present, gp_idx+1, contact) 167 self.Insert(_present, gp_idx+1, contact)
168 168
169 def setSpecial(self, special_jid, special_type): 169 def setSpecial(self, special_jid, special_type, show=False):
170 QuickContactList.setSpecial(self, special_jid, special_type) 170 """Set entity as a special
171 @param jid: jid of the entity
172 @param _type: special type (e.g.: "MUC")
173 @param show: True to display the dialog to chat with this entity
174 """
175 QuickContactList.setSpecial(self, special_jid, special_type, show)
176 if show:
177 self._showDialog(special_jid)
178
179 def _showDialog(self, jid):
180 """Show the dialog associated to the given jid."""
181 indexes = self.__find_idx(jid)
182 if not indexes:
183 return
184 self.DeselectAll()
185 self.SetSelection(indexes[0])
186 self.onActivated(wx.MouseEvent())
171 187
172 def remove(self, contact): 188 def remove(self, contact):
173 """remove a contact from the list""" 189 """remove a contact from the list"""
174 debug (_("removing %s"), contact) 190 debug (_("removing %s"), contact)
175 list_idx = self.__find_idx(contact) 191 list_idx = self.__find_idx(contact)