def _fix_expanded_state(self, new_name): # TODO: resolve this horrible layering violation # change the expanded state in the buddylist if necessary from gui.treelist import expanded_id import wx; blist = wx.FindWindowByName('Buddy List').buddyListPanel.blist collapsed = blist.model.collapsed eid = expanded_id(self) if eid in collapsed: # rename self and insert it's expanded ID back into the list collapsed.discard(eid) self.name = new_name collapsed.add(expanded_id(self)) blist.model.update_list()
def __init__(self, parent): from contacts.Group import DGroup AIM=('aim',[caps.BLOCKABLE, caps.EMAIL, caps.FILES, caps.IM, caps.PICTURES, caps.SMS]) MSN=('msn',[caps.BLOCKABLE, caps.EMAIL, caps.FILES, caps.IM]) JBR=('jabber',[caps.EMAIL, caps.FILES, caps.IM]) YHO=('yahoo',[caps.BLOCKABLE, caps.EMAIL, caps.FILES, caps.IM, caps.SMS]) self.dude=MockMetaContact( 'MetaDude', MockBuddy('Dude1',0,*AIM), MockBuddy('Dude2',0,*YHO), MockBuddy('Dude3',0,*MSN), MockBuddy('Dude4',0,*JBR), ) grp = DGroup('coworkers', [], [], [ MockBuddy('Aaron',0,*JBR), MockBuddy('Chris',0,*JBR), MockBuddy('Jeff',0,*AIM), MockBuddy('Kevin',0,*YHO), MockBuddy('Mike',0,*MSN), MockBuddy('Steve',0,*AIM), self.dude ] ) from gui.treelist import expanded_id BuddyList.__init__(self, parent, expanded = [expanded_id(grp)]) self.set_root([grp])
def _fix_expanded_state(self, new_name): # TODO: resolve this horrible layering violation # change the expanded state in the buddylist if necessary from gui.treelist import expanded_id import wx blist = wx.FindWindowByName('Buddy List').buddyListPanel.blist collapsed = blist.model.collapsed eid = expanded_id(self) if eid in collapsed: # rename self and insert it's expanded ID back into the list collapsed.discard(eid) self.name = new_name collapsed.add(expanded_id(self)) blist.model.update_list()