Esempio n. 1
0
    def LoadProfileList(self):
        selectedProfileID = self.structureBrowserController.GetSelectedProfileID(
        )
        profileControllers = self.allStructuresProfileController.GetProfiles()
        scrollList = []
        for profileID, eachProfileController in profileControllers.iteritems():
            nodeData = Bunch(
                decoClass=StructureProfileEntry,
                profileController=eachProfileController,
                allStructuresProfileController=self.
                allStructuresProfileController,
                structureBrowserController=self.structureBrowserController,
                isSelected=profileID == selectedProfileID)
            sortValue = eachProfileController.GetProfileName().lower()
            scrollList.append((sortValue, nodeData))

        scrollList = SortListOfTuples(scrollList)
        anyProfileText = GetByLabel('UI/Structures/Browser/AnyProfile')
        anyProfileDesc = GetByLabel('UI/StructureProfiles/AnyProfileDesc')
        controllerForShowAll = SlimStructureAllProfilesController(
            ALL_PROFILES,
            profileData=KeyVal(name=anyProfileText,
                               description=anyProfileDesc))
        nodeData = Bunch(
            decoClass=StructureAllProfilesEntry,
            profileController=controllerForShowAll,
            allStructuresProfileController=self.allStructuresProfileController,
            structureBrowserController=self.structureBrowserController,
            isSelected=ALL_PROFILES == selectedProfileID)
        scrollList.insert(0, nodeData)
        self.scroll.Load(contentList=scrollList)
Esempio n. 2
0
    def ShowOffices(self):
        if self.selectedGroupButtonID != OFFICESPANEL:
            return
        self.LoadButtons()
        corpsWithOffices = self.controller.CorpsWithOffices()
        cfg.corptickernames.Prime([c.corporationID for c in corpsWithOffices])
        scrolllist = []
        for corp in corpsWithOffices:
            corpName = corp.corporationName
            data = KeyVal(corpName=corpName,
                          corpID=corp.corporationID,
                          corporation=corp)
            entry = GetListEntry(data=data, decoClass=OfficeEntry)
            scrolllist.append((corpName.lower(), entry))

        scrolllist = SortListOfTuples(scrolllist)
        numUnrentedOffices = self.controller.GetNumberOfUnrentedOffices()
        if numUnrentedOffices is not None:
            availOfficesLabel = GetByLabel(
                'UI/Station/Lobby/NumAvailableOffices',
                numOffices=numUnrentedOffices)
            scrolllist.insert(
                0, GetListEntry('Header', {'label': availOfficesLabel}))
        if not self.destroyed:
            self.officesScroll.Load(contentList=scrolllist)