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 Submit(self, *args):
     standingValue = self.standingLevelSelector.GetValue()
     allowAllianceValue = self.allianceCheckbox.GetValue()
     allowStandingsValue = self.standingsCheckbox.GetValue()
     reinforceValue = int(self.reinforceHourCombo.GetValue())
     taxRateValues = util.KeyVal({
         taxRate.key: self.GetTaxRateValue(taxRate.input)
         for taxRate in self.taxRates
     })
     remoteOrbitalRegistry = moniker.GetPlanetOrbitalRegistry(
         self.locationID)
     remoteOrbitalRegistry.UpdateSettings(self.orbitalID, reinforceValue,
                                          taxRateValues, standingValue,
                                          allowAllianceValue,
                                          allowStandingsValue)
     self.CloseByUser()
 def Submit(self, *args):
     """ Grab all the values out of the UI controls and call the oribital registry
     to update the values on the server. Then close the window. """
     standingValue = self.standingLevelSelector.GetValue()
     allowAllianceValue = self.allianceCheckbox.GetValue()
     allowStandingsValue = self.standingsCheckbox.GetValue()
     reinforceValue = int(self.reinforceHourCombo.GetValue())
     taxRateValues = util.KeyVal({
         taxRate.key: self.GetTaxRateValue(taxRate.input)
         for taxRate in self.taxRates
     })
     remoteOrbitalRegistry = moniker.GetPlanetOrbitalRegistry(
         self.locationID)
     remoteOrbitalRegistry.UpdateSettings(self.orbitalID, reinforceValue,
                                          taxRateValues, standingValue,
                                          allowAllianceValue,
                                          allowStandingsValue)
     self.CloseByUser()
Ejemplo n.º 4
0
 def UpdateTaxRate(self):
     self.taxRate = moniker.GetPlanetOrbitalRegistry(
         session.solarsystemid).GetTaxRate(self.id)
     self.RefreshCostText()