def ApplyAttributes(self, attributes):
        uicontrols.Window.ApplyAttributes(self, attributes)
        orbitalItem = attributes.get('orbitalItem')
        if not util.IsOrbital(orbitalItem.categoryID):
            raise RuntimeError(
                'Cannot open an orbital configuration window for a non-orbital'
            )
        self.locationID = orbitalItem.locationID
        self.orbitalID = orbitalItem.itemID
        self.typeID = orbitalItem.typeID
        self.remoteOrbitalRegistry = moniker.GetPlanetOrbitalRegistry(
            self.locationID)
        self.orbitalData = self.remoteOrbitalRegistry.GetSettingsInfo(
            self.orbitalID)
        self.selectedHour, self.taxRateValues, self.standingLevel, self.allowAlliance, self.allowStandings = self.orbitalData
        self.taxRates = [
            util.KeyVal(key='corporation'),
            util.KeyVal(key='alliance'),
            util.KeyVal(key='standingHorrible',
                        standing=const.contactHorribleStanding),
            util.KeyVal(key='standingBad', standing=const.contactBadStanding),
            util.KeyVal(key='standingNeutral',
                        standing=const.contactNeutralStanding),
            util.KeyVal(key='standingGood',
                        standing=const.contactGoodStanding),
            util.KeyVal(key='standingHigh', standing=const.contactHighStanding)
        ]
        for taxRate in self.taxRates:
            taxRate.value = getattr(self.taxRateValues, taxRate.key)

        self.variance = sm.GetService('clientDogmaStaticSvc').GetTypeAttribute(
            self.typeID, const.attributeReinforcementVariance)
        self.reinforceHours = [
            ('%.2d:00 - %.2d:00' % ((x - self.variance / 3600) % 24,
                                    (x + self.variance / 3600) % 24), x)
            for x in xrange(0, 24)
        ]
        ballpark = sm.GetService('michelle').GetBallpark()
        if ballpark is not None and self.orbitalID in ballpark.slimItems:
            planetName = cfg.evelocations.Get(
                ballpark.slimItems[self.orbitalID].planetID).name
            caption = localization.GetByLabel(
                'UI/PI/Common/PlanetaryCustomsOfficeName',
                planetName=planetName)
        else:
            caption = localization.GetByLabel(
                'UI/DustLink/OrbitalConfiguration')
        self.effects = uicls.UIEffects()
        self.scope = 'inflight'
        self.SetWndIcon(self.iconNum, size=32)
        self.SetMinSize([self.WIDTH_COLLAPSED, self.HEIGHT])
        self.SetCaption(caption)
        self.MakeUnResizeable()
        self.Layout()
        self.Redraw()
Ejemplo n.º 2
0
 def DoBallRemove(self, ball, slimItem, *args, **kwargs):
     if slimItem.groupID == const.groupPlanet and slimItem.itemID in self.planets:
         self._RemovePlanet(ball, slimItem)
     elif util.IsOrbital(
             slimItem.categoryID) and slimItem.itemID in self.orbitals:
         self._RemoveOrbital(ball, slimItem)
Ejemplo n.º 3
0
 def DoBallsAdded(self, ballItems, *args, **kwargs):
     for ball, slimItem in ballItems:
         if slimItem.groupID == const.groupPlanet:
             self._AddPlanet(ball, slimItem)
         elif util.IsOrbital(slimItem.categoryID):
             self._AddOrbital(ball, slimItem)