def Expand(self, checkchain=1, *args): WindowCore.Expand(self, checkchain, args) if self.sr.topParent: self.sr.topParent.state = uiconst.UI_PICKCHILDREN if self.sr.bottom: self.sr.bottom.state = uiconst.UI_PICKCHILDREN if self.sr.main: self.sr.main.state = uiconst.UI_PICKCHILDREN
def CloseByUser(self, *args): """ Calling this method to close a window registers the _open attribute as False, so the window will not open up automatically on session change. """ if not self.IsKillable(): return WindowCore.CloseByUser(self)
def InitializeStatesAndPosition(self, *args, **kwds): self.startingup = 1 pinned = self.GetRegisteredState('pinned') if pinned: self.Pin(delegate=False) else: self.Unpin(delegate=False) WindowCore.InitializeStatesAndPosition(self, *args, **kwds) self.startingup = 0
def Collapse(self, forceCollapse=False, checkchain=1, *args): if not self._collapseable or not forceCollapse and self.IsCollapsed(): return if self.sr.topParent: self.sr.topParent.state = uiconst.UI_HIDDEN if self.sr.bottom: self.sr.bottom.state = uiconst.UI_HIDDEN if self.sr.main: self.sr.main.state = uiconst.UI_HIDDEN WindowCore.Collapse(self, forceCollapse, checkchain, args)
def ApplyAttributes(self, attributes): self.default_parent = uicore.layer.main self._pinned = False self._pinable = self.default_isPinable self.showforward = False self.showback = False self.isBlinking = False self.iconNum = attributes.get('iconNum', self.GetDefaultWndIcon()) self.scope = attributes.get('scope', self.default_scope) self.topParentHeight = attributes.get('topParentHeight', self.default_topParentHeight) WindowCore.ApplyAttributes(self, attributes)
def Prepare_LoadingIndicator_(self): WindowCore.Prepare_LoadingIndicator_(self) self.sr.loadingIndicator.icons = [ 'ui_38_16_%s' % (210 + i) for i in xrange(8) ]
def ShowDialog(self, modal=False, state=uiconst.UI_NORMAL): if modal: self.NoSeeThrough() return WindowCore.ShowDialog(self, modal, state)
def GetRegisteredState(self, stateName): if stateName == 'locked': if self.GetRegisteredState('pinned') and settings.char.windows.Get( 'lockwhenpinned', False): return True return WindowCore.GetRegisteredState(self, stateName)
def CloseByUser(self, *args): if not self.IsKillable(): return WindowCore.CloseByUser(self)