nameAndDescriptionWnd.py (2404B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\structure\structureBrowser\nameAndDescriptionWnd.py 2 from eve.client.script.ui.structure.nameAndDescriptionBaseWnd import NameAndDescBaseWnd 3 from eve.client.script.ui.structure.structureSettings.controllers.structureProfileController import StructureProfileController 4 from localization import GetByLabel 5 6 class CreateProfileWnd(NameAndDescBaseWnd): 7 default_captionLabelPath = 'UI/StructureProfiles/CreateProfile' 8 confirmLabelPath = 'UI/StructureProfiles/CreateProfileBtn' 9 nameLabelPath = 'UI/StructureProfiles/ProfileName' 10 descriptionLabelPath = 'UI/StructureProfiles/ProfileDescription' 11 12 def Confirm(self, name, desc): 13 slimProfileController = self.controller.GetNewProfileController(name, desc) 14 profileID = slimProfileController.GetProfileID() 15 windowID = 'structureProfiler_%s' % profileID 16 fullProfileController = StructureProfileController(profileID, profileInfo=slimProfileController.GetProfileInfo()) 17 profileID = fullProfileController.GetProfileID() 18 self.controller.OnProfileSaved(profileID) 19 browserController = sm.GetService('structureControllers').GetStructureBrowserController() 20 browserController.SelectProfile(profileID) 21 22 23 class EditProfileNameAndDescriptionWnd(NameAndDescBaseWnd): 24 default_captionLabelPath = 'UI/StructureProfiles/EditProfileName' 25 confirmLabelPath = 'UI/StructureProfiles/EditProfileNameBtn' 26 nameLabelPath = 'UI/StructureProfiles/ProfileName' 27 descriptionLabelPath = 'UI/StructureProfiles/ProfileDescription' 28 29 def ApplyAttributes(self, attributes): 30 NameAndDescBaseWnd.ApplyAttributes(self, attributes) 31 32 def PostApplyAttributes(self, attributes): 33 NameAndDescBaseWnd.PostApplyAttributes(self, attributes) 34 oldName = self.controller.GetProfileName() 35 caption = GetByLabel(self.default_captionLabelPath, oldGroupName=oldName) 36 self.SetCaption(caption) 37 38 def PopulateFields(self): 39 oldName = self.controller.GetProfileName() 40 self.groupNameField.SetText(oldName) 41 oldDesc = self.controller.GetProfileDescription() 42 self.groupDescField.SetText(oldDesc) 43 44 def Confirm(self, newName, newDesc): 45 profileID = self.controller.GetProfileID() 46 self.controller.UpdateProfile(profileID, newName, newDesc)