structureBrowserWnd.py (4404B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\structure\structureBrowser\structureBrowserWnd.py 2 from carbonui.primitives.container import Container 3 from eve.client.script.ui.control.eveLabel import WndCaptionLabel 4 from carbonui.control.window import Window 5 from carbonui.control.tabGroup import TabGroup 6 from eve.client.script.ui.control.themeColored import SpriteThemeColored 7 from carbonui.window.header.tab_navigation import TabNavigationWindowHeader 8 from eve.client.script.ui.structure.structureBrowser.browserMyCorpStructures import BrowserMyCorpStructures 9 from eve.client.script.ui.structure.structureBrowser.browserAllStructures import BrowserAllStructures 10 from eve.common.lib import appConst 11 from eve.client.script.ui.structure.structureBrowser.browserSkyhooks import BrowserAllSkyhooks 12 from eve.common.script.sys import idCheckers 13 from localization import GetByLabel 14 import carbonui.const as uiconst 15 16 class StructureBrowserWnd(Window): 17 default_captionLabelPath = 'UI/Structures/Browser/StructureBrowser' 18 descriptionLabelPath = 'UI/Structures/Browser/StructureBrowserDescription' 19 default_name = 'Structure Browser' 20 default_windowID = 'StructureBrowser' 21 default_width = 800 22 default_height = 600 23 default_iconNum = 'res:/UI/Texture/WindowIcons/structureBrowser.png' 24 default_minSize = (600, 450) 25 26 def ApplyAttributes(self, attributes): 27 super(StructureBrowserWnd, self).ApplyAttributes(attributes) 28 self.browserMyStructures = None 29 self.tabs = None 30 self.controller = sm.GetService('structureControllers').GetStructureBrowserController() 31 self.browserCont = Container(name='browserCont', parent=self.sr.main) 32 self.browserAllStructures = BrowserAllStructures(parent=self.browserCont, structureBrowserController=self.controller, padTop=0) 33 if idCheckers.IsNPCCorporation(session.corpid): 34 self.browserAllStructures.LoadPanel() 35 else: 36 self.tabs = self.header.tab_group 37 self.tabs.AddTab(GetByLabel('UI/Structures/Browser/AllStructures'), self.browserAllStructures, tabID='allStructures', hint=GetByLabel('UI/StructureBrowser/TabAllStructures') + '\n' + GetByLabel('UI/StructureBrowser/Delayed5Minutes')) 38 if session.corprole & appConst.corpRoleStationManager: 39 self.browserMyStructures = BrowserMyCorpStructures(parent=self.browserCont, padTop=4, structureBrowserController=self.controller) 40 self.tabs = self.header.tab_group 41 self.tabs.AddTab(GetByLabel('UI/Structures/Browser/MyStructures'), self.browserMyStructures, tabID='myStructures', hint=GetByLabel('UI/StructureBrowser/TabMyStructures') + '\n' + GetByLabel('UI/StructureBrowser/Delayed5Minutes')) 42 skyhookController = sm.GetService('structureControllers').GetSkyhookBrowserController() 43 self.browserSkyhooks = BrowserAllSkyhooks(parent=self.browserCont, skyhookController=skyhookController, padTop=0) 44 self.tabs.AddTab(GetByLabel('UI/StructureBrowser/MySkyhooks'), self.browserSkyhooks, tabID='corpSkyhook', hint=GetByLabel('UI/Structures/Browser/TabMySkyhooks') + '\n' + GetByLabel('UI/StructureBrowser/Delayed5Minutes')) 45 self.tabs.AutoSelect() 46 47 def ConstructTopParent(self): 48 topParent = Container(name='topParent', parent=self.GetMainArea(), align=uiconst.TOTOP, height=52, clipChildren=True) 49 SpriteThemeColored(name='mainicon', parent=topParent, state=uiconst.UI_DISABLED, pos=(0, -8, 64, 64), texturePath=self.iconNum, colorType=uiconst.COLORTYPE_UIHILIGHTGLOW) 50 WndCaptionLabel(text=GetByLabel('UI/Structures/Browser/StructureBrowser'), subcaption=GetByLabel('UI/StructureBrowser/Delayed5Minutes'), parent=topParent) 51 52 def Prepare_Header_(self): 53 self.header = TabNavigationWindowHeader() 54 55 def ForceProfileSettingsSelected(self): 56 if self.tabs: 57 self.header.select_tab('myStructures') 58 if self.browserAllStructures: 59 self.browserMyStructures.ForceProfileSettingsSelected() 60 61 def CloseByUser(self, *args): 62 browserController = sm.GetService('structureControllers').GetStructureBrowserController() 63 if not browserController.PlayerWantsToLeaveProfile(): 64 return 65 browserController.SetProfileChangedValue(False) 66 Window.CloseByUser(self, *args)