def UpdateRemoteDogmaLocation(self): if session.stationid2 is not None: self.remoteDogmaLM = moniker.GetStationDogmaLocation() self.remoteShipMgr = moniker.GetStationShipAccess() else: self.remoteDogmaLM = moniker.CharGetDogmaLocation() self.remoteShipMgr = moniker.GetShipAccess()
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.shipid = util.GetActiveShip() self.shipItem = self.GetShipItem() self.SetTopparentHeight(72) self.SetWndIcon() self.SetMinSize([300, 200]) self.sr.top = uiprimitives.Container(name='top', align=uiconst.TOTOP, parent=self.sr.topParent, pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, 64)) icon = uicontrols.Icon(parent=self.sr.top, align=uiconst.TOLEFT, left=const.defaultPadding, size=64, state=uiconst.UI_NORMAL, typeID=self.shipItem.typeID) icon.GetMenu = self.ShipMenu uiprimitives.Container(name='push', align=uiconst.TOLEFT, pos=(5, 0, 5, 0), parent=self.sr.top) uicontrols.EveHeaderMedium(name='label', text=cfg.evelocations.Get(self.shipItem.itemID).name, parent=self.sr.top, align=uiconst.TOTOP, bold=True, state=uiconst.UI_NORMAL) uicontrols.EveLabelMedium(name='label', text=evetypes.GetName(self.shipItem.typeID), parent=self.sr.top, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) self.ship = moniker.GetShipAccess() self.conf = self.ship.GetShipConfiguration(self.shipid) modules = self.GetShipModules() for module in modules: self.sr.Set('%sPanel' % module.lower(), uiprimitives.Container(name=module, align=uiconst.TOALL, state=uiconst.UI_HIDDEN, parent=self.sr.main, pos=(0, 0, 0, 0))) tabs = [ [name, self.sr.Get('%sPanel' % module.lower(), None), self, module] for module, name in modules.iteritems() if self.sr.Get('%sPanel' % module.lower()) ] if tabs: self.sr.maintabs = uicontrols.TabGroup(name='tabparent', align=uiconst.TOTOP, height=18, parent=self.sr.main, idx=0, tabs=tabs, groupID='pospanel') else: uicontrols.CaptionLabel(text=localization.GetByLabel('UI/Ship/ShipConfig/ShipConfig'), parent=self.sr.main, size=18, uppercase=0, left=const.defaultPadding, width=const.defaultPadding, top=const.defaultPadding)
def GetShipConfig(self, shipID = None): if shipID is not None: return moniker.GetShipAccess().GetShipConfiguration(shipID) if util.GetActiveShip() != self.shipid: self._ClearCachedAttributes() with locks.TempLock('%s:%s' % (self, self.shipid)): if self.config is None: self.config = self.ship.GetShipConfiguration(self.shipid) return self.config
def GetShipAccess(self): if self.shipAccess is not None: shipAccess, locationID, shipID, charID = self.shipAccess if locationID != eve.session.solarsystemid or eve.session.stationid: self.shipAccess = None elif shipID != eve.session.shipid: self.shipAccess = None elif charID != eve.session.charid: self.shipAccess = None if self.shipAccess is None: self.shipAccess = [ moniker.GetShipAccess(), eve.session.solarsystemid or eve.session.stationid, eve.session.shipid, eve.session.charid ] return self.shipAccess[0]
def EnterShipPassword(self): format = [{ 'type': 'text', 'refreshheight': 1, 'text': localization.GetByLabel('UI/Inflight/POS/EnterHarmonicPassword'), 'frame': 0 }, { 'type': 'edit', 'setvalue': '', 'label': '_hide', 'key': 'name', 'maxLength': 50, 'passwordChar': '*', 'setfocus': 1, 'frame': 0 }] retval = uix.HybridWnd( format, localization.GetByLabel('UI/Inflight/POS/ShipShieldHarmonic'), 1, None, uiconst.OKCANCEL, icon=uiconst.OKCANCEL, minW=240, minH=120, unresizeAble=True) if retval is not None: if session.stationid: eve.Message('CannotSetShieldHarmonicPassword') else: ship = moniker.GetShipAccess() ship.SetShipPassword(retval['name'])
def ship(self): if self._ship is None: self._ship = moniker.GetShipAccess() return self._ship