confirmWnd.py (2923B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\sov\sovHub\skyhooksCleanup\confirmWnd.py 2 from eve.client.script.ui import eveColor 3 import evetypes 4 import mathext 5 from carbonui import TextColor, Align 6 from carbonui.text.styles import TextBody 7 from carbonui.control.scrollContainer import ScrollContainer 8 from carbonui.primitives.layoutGrid import LayoutGrid 9 from eve.client.script.ui.eveThemeColor import THEME_FOCUS 10 from localization import GetByLabel 11 PADDING_8 = 8 12 13 class ConfirmSkyhookSovManagement(ScrollContainer): 14 default_align = Align.TOALL 15 setWidth = True 16 17 def ApplyAttributes(self, attributes): 18 self._contentWidth = 0 19 self._contentHeight = 0 20 controller = attributes.messageData['controller'] 21 aclName = attributes.messageData['aclName'] 22 attributes.align = Align.TOALL 23 super(ConfirmSkyhookSovManagement, self).ApplyAttributes(attributes) 24 content = self.GetContent(controller, aclName) 25 self._contentWidth, self._contentHeight = content.GetAbsoluteSize() 26 27 def GetContent(self, controller, aclName): 28 layoutGrid = LayoutGrid(parent=self, columns=1, cellSpacing=(PADDING_8, 0)) 29 price = controller.GetTotalPrice() 30 t = TextBody(parent=layoutGrid, text=GetByLabel('UI/Sovereignty/SovHub/SystemCleanup/OperationCost', cost=price)) 31 skyhookControllers = controller.GetEntryControllers() 32 skyhooksToAquire = controller.GetSkyhooksToAcquire() 33 skyhooksToDestroy = controller.GetSkyhooksToDestroy() 34 for skyhookIDs, headerText in [(skyhooksToAquire, GetByLabel('UI/Sovereignty/SovHub/SystemCleanup/ConfirmConvertedSkyhooks', color=THEME_FOCUS.hex_argb)), (skyhooksToDestroy, GetByLabel('UI/Sovereignty/SovHub/SystemCleanup/ConfirmDestroyedSkyhooks', color=eveColor.CHERRY_RED_HEX))]: 35 if skyhookIDs: 36 t = TextBody(parent=layoutGrid, text=headerText, top=PADDING_8) 37 for sID in skyhookIDs: 38 c = skyhookControllers[sID] 39 name = GetByLabel('UI/Sovereignty/SovHub/SystemCleanup/SkyhookLine', skyhookName=evetypes.GetName(c.typeID), locationName=c.locationText, ownerName=c.ownerText) 40 TextBody(parent=layoutGrid, text=u'\u2022 %s' % name, color=TextColor.SECONDARY, left=PADDING_8) 41 42 if skyhooksToAquire: 43 if aclName: 44 t = TextBody(text=GetByLabel('UI/Sovereignty/SovHub/SystemCleanup/SelectedACL', aclName=aclName), top=PADDING_8) 45 else: 46 t = TextBody(text=GetByLabel('UI/Sovereignty/SovHub/SystemCleanup/AccessListReset'), top=PADDING_8) 47 layoutGrid.AddCell(t) 48 return layoutGrid 49 50 def GetContentHeight(self): 51 return mathext.clamp(self._contentHeight + 60, 100, 600) 52 53 def GetContentWidth(self): 54 return mathext.clamp(self._contentWidth, 300, 600)