Beispiel #1
0
    def SetHint(self, node, label):
        self.sr.node = node
        c = node.contract
        hintList = []
        boldLabel = localization.GetByLabel('UI/Contracts/ContractsService/BoldGenericLabel', labelText=label)
        hintList.append(boldLabel)
        hintLine = localization.GetByLabel('UI/Contracts/ContractEntry/ContractTypeWithType', contractType=GetContractTypeText(c.type))
        hintList.append(hintLine)
        hintLine = localization.GetByLabel('UI/Contracts/ContractEntry/ContractLocation', location=c.startSolarSystemID, numJumpsInfo=node.numJumps)
        hintList.append(hintLine)
        if c.forCorp:
            issuerID = c.issuerCorpID
        else:
            issuerID = c.issuerID
        issuer = cfg.eveowners.Get(issuerID)
        hintLine = localization.GetByLabel('UI/Contracts/ContractEntry/IssuerWithName', issuerName=issuer.name)
        hintList.append(hintLine)
        if c.type in [const.conTypeAuction, const.conTypeItemExchange] and len(node.contractItems) > 0:
            itemList = []
            itemReqList = []
            numItems = 0
            numItemsReq = 0
            for e in node.contractItems:
                if e.inCrate:
                    itemInfo = cfg.FormatConvert(TYPEIDANDQUANTITY, e.itemTypeID, max(1, e.quantity))
                    itemList.append(itemInfo)
                    numItems += 1
                else:
                    itemReqInfo = cfg.FormatConvert(TYPEIDANDQUANTITY, e.itemTypeID, max(1, e.quantity))
                    itemReqList.append(itemReqInfo)
                    numItemsReq += 1

            if len(itemList) >= 2:
                itemList.append(localization.GetByLabel('UI/Common/MoreWithTrailing'))
            if len(itemReqList) >= 2:
                itemReqList.append(localization.GetByLabel('UI/Common/MoreWithTrailing'))
            if len(itemList) == 0:
                itemList.append(localization.GetByLabel('UI/Contracts/ContractEntry/NoneParen'))
            itemsString = localizationUtil.FormatGenericList(itemList)
            strItems = localization.GetByLabel('UI/Contracts/ContractEntry/ItemsWithItemList', itemsString=itemsString)
            hintList.append(strItems)
            if len(itemReqList) > 0:
                reqItemsString = localizationUtil.FormatGenericList(itemReqList)
                itemsReq = localization.GetByLabel('UI/Contracts/ContractEntry/ItemsRequiredWithItemList', reqItemsString=reqItemsString)
                hintList.append(itemsReq)
            if len(itemList) >= 2 or len(itemReqList) >= 2:
                hintList.append(localization.GetByLabel('UI/Contracts/ContractEntry/OpenForItems'))
        if c.title != '':
            hintLine = localization.GetByLabel('UI/Contracts/ContractEntry/IssuerDescriptionWithDescription', description=c.title)
            hintList.append(hintLine)
        newHint = '<br>'.join(hintList)
        self.hint = newHint
Beispiel #2
0
def ProcessTypeAndQuantity(typeID, quantity, extra=None):
    if typeID == const.typeCredits:
        return util.FmtISK(quantity)
    elif extra is None:
        return cfg.FormatConvert(TYPEIDANDQUANTITY, typeID, quantity)
    else:
        specificItemID = extra.get('specificItemID', 0)
        blueprintInfo = extra.get('blueprintInfo', None)
        if blueprintInfo is None:
            if specificItemID:
                props = [
                    localization.GetByLabel('UI/Agents/Items/SpecificItems')
                ]
            else:
                return cfg.FormatConvert(TYPEIDANDQUANTITY, typeID, quantity)
        else:
            props = []
            if specificItemID:
                props.append(
                    localization.GetByLabel('UI/Agents/Items/SpecificItems'))
            if blueprintInfo.get('licensedProductionRunsRemaining', 0) > 1:
                runsRemaining = blueprintInfo.get(
                    'licensedProductionRunsRemaining', 0)
                props.append(
                    localization.GetByLabel(
                        'UI/Agents/Items/BlueprintInfoMultirun',
                        runsRemaining=runsRemaining))
            elif blueprintInfo.get('licensedProductionRunsRemaining', 0) == 1:
                props.append(
                    localization.GetByLabel(
                        'UI/Agents/Items/BlueprintInfoSingleRun'))
            if blueprintInfo.get('copy', 0):
                props.append(
                    localization.GetByLabel(
                        'UI/Agents/Items/BlueprintInfoCopy'))
            else:
                props.append(
                    localization.GetByLabel(
                        'UI/Agents/Items/BlueprintInfoOriginal'))
            if blueprintInfo.get('materialLevel', 0):
                props.append(
                    localization.GetByLabel(
                        'UI/Agents/Items/BlueprintInfoMaterialLevel',
                        materialLevel=blueprintInfo.get('materialLevel', 0)))
            if blueprintInfo.get('productivityLevel', 0):
                props.append(
                    localization.GetByLabel(
                        'UI/Agents/Items/ProductivityLevel',
                        productivityLevel=blueprintInfo.get(
                            'productivityLevel', 0)))
        return localization.GetByLabel(
            'UI/Agents/Items/NumItemsAndProperties',
            itemAndQuantity=cfg.FormatConvert(TYPEIDANDQUANTITY, typeID,
                                              quantity),
            propertyList=localizationUtil.FormatGenericList(props))
Beispiel #3
0
    def _GetList(self, fmtList, separator=None):
        results = []
        for each in fmtList:
            value2 = None
            if len(each) >= 3:
                value2 = each[2]
            results.append(self.FormatConvert(each[0], each[1], value2))

        if separator is not None:
            return separator.join(results)
        else:
            return localizationUtil.FormatGenericList(results)
Beispiel #4
0
    def GetSubContentRoleSummary(self, nodedata, *args):
        subcontent = []
        for roleToDisplay in nodedata.rolesToDisplay:
            roleName, hasRole, hasGrantableRole, hasRoleByTitle = roleToDisplay
            desc = []
            if hasRole:
                desc.append(localization.GetByLabel('UI/Corporations/Common/Role'))
            if hasRoleByTitle:
                desc.append(localization.GetByLabel('UI/Corporations/EditMemberDialog/RoleByTitle'))
            if hasGrantableRole:
                desc.append(localization.GetByLabel('UI/Corporations/EditMemberDialog/GrantableRole'))
            subcontent.append(listentry.Get('LabelText', {'label': roleName,
             'text': localizationUtil.FormatGenericList(desc),
             'textpos': 170}))

        return subcontent
Beispiel #5
0
    def CheckSkillRequirementsForType(self, typeID, errorMsgName):
        skillSvc = sm.GetService('skills')
        missingSkills = {}
        for requiredSkillTypeID, requiredSkillLevel in self.dogmaStaticMgr.GetRequiredSkills(typeID).iteritems():
            requiredSkill = skillSvc.HasSkill(requiredSkillTypeID)
            if requiredSkill is None:
                missingSkills[requiredSkillTypeID] = requiredSkillLevel
            elif self.GetAttributeValue(requiredSkill.itemID, const.attributeSkillLevel) < requiredSkillLevel:
                missingSkills[requiredSkillTypeID] = requiredSkillLevel

        if len(missingSkills) > 0:
            nameList = []
            for skillTypeID, requiredSkillLevel in missingSkills.iteritems():
                nameList.append(localization.GetByLabel('UI/SkillQueue/Skills/SkillNameAndLevel', skill=skillTypeID, amount=requiredSkillLevel))

            raise UserError(errorMsgName, {'requiredSkills': localizationUtil.FormatGenericList(nameList),
             'item': typeID,
             'skillCount': len(nameList)})
        return missingSkills
Beispiel #6
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     path = attributes.path
     fileExtensions = attributes.fileExtensions
     multiSelect = attributes.multiSelect or self.default_multiSelect
     selectionType = attributes.selectionType or self.default_selectionType
     self.SetWndIcon(None)
     self.SetTopparentHeight(0)
     self.MakeUnResizeable()
     if not multiSelect:
         caption = {
             uix.SEL_FILES:
             localization.GetByLabel('UI/Control/FileDialog/SelectFile'),
             uix.SEL_FOLDERS:
             localization.GetByLabel('UI/Control/FileDialog/SelectFolder'),
             uix.SEL_BOTH:
             localization.GetByLabel(
                 'UI/Control/FileDialog/SelectFileOrfolder')
         }.get(selectionType)
     else:
         caption = {
             uix.SEL_FILES:
             localization.GetByLabel('UI/Control/FileDialog/SelectFiles'),
             uix.SEL_FOLDERS:
             localization.GetByLabel('UI/Control/FileDialog/SelectFolders'),
             uix.SEL_BOTH:
             localization.GetByLabel(
                 'UI/Control/FileDialog/SelectFilesOrFolders')
         }.get(selectionType)
     if fileExtensions:
         caption = localization.GetByLabel(
             'UI/Control/FileDialog/CaptionWithFileExtensions',
             caption=caption,
             fileExtensions=localizationUtil.FormatGenericList(
                 fileExtensions))
     self.SetCaption(caption)
     self.selectionType = selectionType
     if fileExtensions:
         self.fileExtensions = [
             f.replace('.', '').lower() for f in fileExtensions
         ]
     else:
         self.fileExtensions = None
     topCont = uicls.Container(name='topCont',
                               parent=self.sr.main,
                               align=uiconst.TOTOP,
                               pos=(0, 0, 0, 40),
                               padding=(0, 20, 0, 0))
     icon = uicls.Icon(icon='ui_22_32_29',
                       parent=self.sr.main,
                       pos=(3, 16, 28, 28),
                       ignoreSize=1)
     self.sr.pathEdit = uicls.SinglelineEdit(
         name='currentLocationEdit',
         parent=topCont,
         pos=(38, 0, 290, 0),
         label=localization.GetByLabel('UI/Common/Location'))
     self.sr.pathEdit.OnReturn = self.OnPathEnteredIntoEdit
     options = self.GetAvailableDrives()
     self.sr.driveSelectCombo = uicls.Combo(
         parent=self.sr.main,
         label=localization.GetByLabel('UI/Control/FileDialog/Drive'),
         options=options,
         name='driveSelectCombo',
         select=None,
         callback=self.OnDriveSelected,
         pos=(340, 22, 0, 0),
         width=50,
         align=uiconst.TOPLEFT)
     if not options:
         self.sr.driveSelectCombo.state = uiconst.UI_HIDDEN
     btns = [[
         localization.GetByLabel('UI/Common/Buttons/OK'), self.OnOK, (), 81
     ],
             [
                 localization.GetByLabel('UI/Common/Buttons/Cancel'),
                 self.OnCancel, (), 81
             ]]
     self.sr.standardBtns = uicls.ButtonGroup(btns=btns,
                                              parent=self.sr.main)
     self.SetOKButtonState(enabled=self.selectionType != uix.SEL_FILES)
     scrollCont = uicls.Container(name='scrollCont',
                                  parent=self.sr.main,
                                  align=uiconst.TOALL,
                                  pos=(0, 0, 0, 0),
                                  padding=(0, 0, 6, 6))
     self.sr.scroll = uicls.Scroll(parent=scrollCont,
                                   name='fileFolderScroll',
                                   padLeft=5)
     self.sr.scroll.multiSelect = multiSelect
     self.sr.scroll.OnSelectionChange = self.VerifySelectedEnties
     self.sr.scroll.Sort = lambda *args, **kw: None
     if path is None or not os.path.isdir(path):
         path = settings.user.ui.Get('fileDialogLastPath',
                                     blue.paths.ResolvePath(u'app:/'))
     self.LoadDirToScroll(path)
Beispiel #7
0
    def Load(self, node):
        self.sr.node = node
        c = node.contract
        self.sr.node.contractID = c.contractID
        self.sr.node.solarSystemID = c.startSolarSystemID
        items = node.contractItems
        issuerID = [c.issuerID, c.issuerCorpID][not not c.forCorp]
        fromName = cfg.eveowners.Get(issuerID).ownerName
        if c.acceptorID:
            toID = c.acceptorID
        else:
            toID = c.assigneeID
        if toID == 0:
            toName = localization.GetByLabel('UI/Contracts/ContractEntry/NoneParen')
        else:
            toName = cfg.eveowners.Get(toID).ownerName
        name = GetContractTitle(c, items)
        if not node.Get('callerdefined', False):
            node.label = '%s<t>%s<t>%s<t>%s%s' % (name,
             GetContractTypeText(c.type),
             fromName,
             toName,
             node.Get('additionalColumns', ''))
        self.sr.label.text = self.sr.node.label = node.label
        self.OnSelectCallback = node.Get('callback', None)
        self.sr.selection.state = [uiconst.UI_HIDDEN, uiconst.UI_DISABLED][node.Get('selected', 0)]
        self.state = uiconst.UI_NORMAL
        self.sr.claiming = 0
        self.sr.node.name = name
        self.hint = ''
        loc = ''
        jmps = None
        hintList = []
        if c.startSolarSystemID > 0:
            n = int(sm.GetService('pathfinder').GetJumpCountFromCurrent(c.startSolarSystemID))
            if c.startStationID == eve.session.stationid:
                jmps = localization.GetByLabel('UI/Generic/CurrentStation')
            elif c.startSolarSystemID == eve.session.solarsystemid2:
                jmps = localization.GetByLabel('UI/Generic/CurrentSystem')
            elif n == 1:
                jmps = localization.GetByLabel('UI/Contracts/OneJumpAway')
            else:
                jmps = localization.GetByLabel('UI/Contracts/ContractEntry/NumJumpsAway', numJumps=n)
        hintLine = localization.GetByLabel('UI/Contracts/ContractEntry/ContractTypeWithType', contractType=GetContractTypeText(c.type))
        hintList.append(hintLine)
        if c.title != '':
            hintLine = localization.GetByLabel('UI/Contracts/ContractEntry/IssuerDescriptionWithDescription', description=c.title)
            hintList.append(hintLine)
        if jmps:
            hintLine = localization.GetByLabel('UI/Contracts/ContractEntry/ContractLocation', location=c.startSolarSystemID, numJumpsInfo=jmps)
        else:
            labelText = localization.GetByLabel('UI/Contracts/ContractEntry/MenuLocation')
            hintLine = localization.GetByLabel('UI/Contracts/ContractsService/BoldGenericLabel', labelText=labelText)
        hintList.append(hintLine)
        if c.type in [const.conTypeAuction, const.conTypeItemExchange] and len(items) > 0:
            itemList = []
            itemReqList = []
            numItems = 0
            numItemsReq = 0
            for e in items:
                if e.inCrate:
                    itemInfo = cfg.FormatConvert(TYPEIDANDQUANTITY, e.itemTypeID, max(1, e.quantity))
                    itemList.append(itemInfo)
                    numItems += 1
                else:
                    itemReqInfo = cfg.FormatConvert(TYPEIDANDQUANTITY, e.itemTypeID, max(1, e.quantity))
                    itemReqList.append(itemReqInfo)
                    numItemsReq += 1

            if len(itemList) >= 2:
                itemList.append(localization.GetByLabel('UI/Common/MoreWithTrailing'))
            if len(itemReqList) >= 2:
                itemReqList.append(localization.GetByLabel('UI/Common/MoreWithTrailing'))
            if len(itemList) == 0:
                itemList.append(localization.GetByLabel('UI/Contracts/ContractEntry/NoneParen'))
            itemsString = localizationUtil.FormatGenericList(itemList)
            strItems = localization.GetByLabel('UI/Contracts/ContractEntry/ItemsWithItemList', itemsString=itemsString)
            hintList.append(strItems)
            if len(itemReqList) > 0:
                reqItemsString = localizationUtil.FormatGenericList(itemReqList)
                itemsReq = localization.GetByLabel('UI/Contracts/ContractEntry/ItemsRequiredWithItemList', reqItemsString=reqItemsString)
                hintList.append(itemsReq)
            if len(itemList) >= 2 or len(itemReqList) >= 2:
                hintList.append(localization.GetByLabel('UI/Contracts/ContractEntry/OpenForItems'))
            if c.assigneeID > 0:
                labelText = localization.GetByLabel('UI/Contracts/ContractEntry/PrivateContract')
                string = localization.GetByLabel('UI/Contracts/ContractsService/BoldGenericLabel', labelText=labelText)
                hintList.append(string)
        newHint = '<br>'.join(hintList)
        self.hint = newHint
Beispiel #8
0
 def UpdateInfo(self):
     if self.destroyed:
         return
     self.sr.hint = ''
     if uicore.uilib.mouseOver != self:
         self.sr.accuracyTimer = None
         return
     infoList = [
         localization.GetByLabel('UI/Common/TypeLabel',
                                 typeID=self.sr.typeID)
     ]
     statusList = []
     defEff = self.GetDefaultEffect()
     if defEff:
         if defEff.isActive:
             statusList.append(
                 localization.GetByLabel('UI/Inflight/StatusActive'))
         else:
             statusList.append(
                 localization.GetByLabel('UI/Inflight/StatusInactive'))
     if self.goingOnline:
         statusList.append(
             localization.GetByLabel('UI/Inflight/GoingOnline'))
     if self.waitingForActiveTarget:
         statusList.append(
             localization.GetByLabel('UI/Inflight/WaitingForActiveTarget'))
     if statusList:
         infoList.append(
             localization.GetByLabel(
                 'UI/Inflight/StatusLabel',
                 statusList=localizationUtil.FormatGenericList(statusList)))
     if cfg.IsChargeCompatible(self.sr.moduleInfo):
         if self.charge and self.charge.typeID:
             infoList.append(
                 localization.GetByLabel('UI/Inflight/ChargeQuantity',
                                         quantity=self.quantity,
                                         typeID=self.charge.typeID))
         else:
             infoList.append(
                 localization.GetByLabel('UI/Inflight/ChargeNoCharge'))
     accuracy = self.GetAccuracy()
     acc = ''
     if accuracy is not None:
         infoList.append(
             localization.GetByLabel('UI/Inflight/AccuracyLabel',
                                     accuracy=accuracy[0]))
     if self.charge:
         godmaInfo = sm.GetService('godma').GetItem(self.charge.itemID)
         if godmaInfo and godmaInfo.crystalsGetDamaged:
             infoList.append(
                 localization.GetByLabel('UI/Inflight/DamageLabel',
                                         damage=godmaInfo.damage))
     t = self.sr.Get('targetID', None)
     if t:
         slimItem = sm.GetService('michelle').GetBallpark().GetInvItem(t)
         infoList.append(
             localization.GetByLabel(
                 'UI/Inflight/TargetLabel',
                 itemName=uix.GetSlimItemName(slimItem)))
     pos = uicore.layer.shipui.GetPosFromFlag(self.sr.moduleInfo.itemID)
     if pos:
         slotno = pos[1] + 1
         cmd = uicore.cmd
         combo = cmd.GetShortcutByFuncName(
             'CmdActivateHighPowerSlot%i' % slotno, True)
         if not combo:
             combo = localization.GetByLabel('UI/Common/None')
         infoList.append(
             localization.GetByLabel('UI/Inflight/ShortcutLabel',
                                     keyCombo=combo))
     if self and getattr(self, 'sr', None):
         self.sr.hint = '<br>'.join(infoList)
    def ShowJournal(self, browse=None):
        if self.sr.notext:
            self.sr.scroll.ShowHint(None)
        if eve.session.corprole & const.corpRoleAuditor != const.corpRoleAuditor:
            self.sr.notext = 1
            self.sr.scroll.Load(contentList=[])
            self.sr.scroll.ShowHint(
                localization.GetByLabel(
                    'UI/Corporations/CorporationWindow/Members/Auditing/AuditorRoleRequired',
                    auditorMessageID=self.auditorMessageID))
            return
        memberID = None
        memberIDs = sm.GetService('corp').GetMemberIDs()
        if len(memberIDs) < 24:
            memberID = self.sr.Member.GetValue()
        else:
            string = self.sr.searchMember.GetValue()
            if not string:
                eve.Message(
                    'CustomInfo', {
                        'info':
                        localization.GetByLabel(
                            'UI/Corporations/CorporationWindow/Members/Auditing/HaveToFindMember'
                        )
                    })
                uicore.registry.SetFocus(self.sr.searchMember)
                return
            memberID = uix.Search(
                string.lower(),
                const.groupCharacter,
                filterCorpID=eve.session.corpid,
                searchWndName='corpMemberAuditingJournalSearch')
            if memberID:
                self.sr.searchMember.SetValue(cfg.eveowners.Get(memberID).name)
        if memberID is None:
            eve.Message(
                'CustomInfo', {
                    'info':
                    localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/HaveToFindMember'
                    )
                })
            return
        sm.GetService('loading').Cycle('Loading')
        fromDate = self.sr.fromDate.GetValue()
        toDate = self.sr.toDate.GetValue()
        if fromDate == toDate:
            toDate = toDate + DAY
        if browse is not None:
            interval = toDate - fromDate
            if browse == 1:
                toDate = toDate + interval
                fromDate = fromDate + interval
            else:
                toDate = toDate - interval
                fromDate = fromDate - interval
        year, month, wd, day, hour, min, sec, ms = util.GetTimeParts(fromDate)
        self.sr.fromDate.ycombo.SetValue(year)
        self.sr.fromDate.mcombo.SetValue(month)
        self.sr.fromDate.dcombo.SetValue(day)
        year, month, wd, day, hour, min, sec, ms = util.GetTimeParts(toDate)
        self.sr.toDate.ycombo.SetValue(year)
        self.sr.toDate.mcombo.SetValue(month)
        self.sr.toDate.dcombo.SetValue(day)
        scrolllist = []
        rowsPerPage = 10
        logItemEventRows, crpRoleHistroyRows = sm.RemoteSvc(
            'corpmgr').AuditMember(memberID, fromDate, toDate, rowsPerPage)
        logItems = []
        for row in logItemEventRows:
            logItems.append(row)

        roleItems = []
        for row in crpRoleHistroyRows:
            roleItems.append(row)

        logItems.sort(lambda x, y: cmp(y.eventDateTime, x.eventDateTime))
        roleItems.sort(lambda x, y: cmp(y.changeTime, x.changeTime))
        roleRows = sm.GetService('corp').GetRoles()
        roles = {}
        for role in roleRows:
            roles[role.roleID] = role.shortDescription

        self.sr.mostRecentItem = None
        self.sr.oldestItem = None
        ix = 0
        if 0 == len(logItems) and 0 == len(roleItems):
            self.sr.mostRecentItem = toDate
            self.sr.oldestItem = fromDate
        while len(logItems) or len(roleItems):
            ix += 1
            if ix > rowsPerPage:
                break
            logItem = None
            roleItem = None
            if len(logItems):
                logItem = logItems[0]
            if len(roleItems):
                roleItem = roleItems[0]
            if logItem is not None and roleItem is not None:
                if logItem.eventDateTime > roleItem.changeTime:
                    roleItem = None
                else:
                    logItem = None
            time = ''
            action = ''
            if logItem is not None:
                del logItems[0]
                time = util.FmtDate(logItem.eventDateTime, 'ss')
                if self.sr.mostRecentItem is None:
                    self.sr.mostRecentItem = logItem.eventDateTime
                if self.sr.oldestItem is None:
                    self.sr.oldestItem = logItem.eventDateTime
                if self.sr.oldestItem > logItem.eventDateTime:
                    self.sr.oldestItem = logItem.eventDateTime
                if self.sr.mostRecentItem < logItem.eventDateTime:
                    self.sr.mostRecentItem = logItem.eventDateTime
                corpName = cfg.eveowners.Get(
                    logItem.corporationID
                ).name if logItem.corporationID else ''
                if logItem.eventTypeID == 12:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/CreatedCorporation',
                        corpName=corpName)
                elif logItem.eventTypeID == 13:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/DeletedCorporation',
                        corpName=corpName)
                elif logItem.eventTypeID == 14:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/LeftCorporation',
                        corpName=corpName)
                elif logItem.eventTypeID == 15:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/AppliedForMembershipOfCorporation',
                        corpName=corpName)
                elif logItem.eventTypeID == 16:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/BecameCEOOfCorporation',
                        corpName=corpName)
                elif logItem.eventTypeID == 17:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/LeftCEOPositionOfCorporation',
                        corpName=corpName)
                elif logItem.eventTypeID == 44:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/JoinedCorporation',
                        corpName=corpName)
                else:
                    action = ` logItem `
            if roleItem is not None:
                del roleItems[0]
                time = util.FmtDate(roleItem.changeTime, 'ss')
                if self.sr.mostRecentItem is None:
                    self.sr.mostRecentItem = roleItem.changeTime
                if self.sr.oldestItem is None:
                    self.sr.oldestItem = roleItem.changeTime
                if self.sr.oldestItem > roleItem.changeTime:
                    self.sr.oldestItem = roleItem.changeTime
                if self.sr.mostRecentItem < roleItem.changeTime:
                    self.sr.mostRecentItem = roleItem.changeTime
                rolesBefore = []
                rolesAfter = []
                for roleID in roles.iterkeys():
                    if roleItem.oldRoles & roleID == roleID:
                        rolesBefore.append(roleID)
                    if roleItem.newRoles & roleID == roleID:
                        rolesAfter.append(roleID)

                added = []
                removed = []
                kept = []
                for roleID in roles.iterkeys():
                    if roleID in rolesBefore:
                        if roleID in rolesAfter:
                            kept.append(roleID)
                        else:
                            removed.append(roleID)
                    elif roleID in rolesAfter:
                        added.append(roleID)

                issuerID = roleItem.issuerID
                if issuerID == -1:
                    issuerID = const.ownerCONCORD
                actionOwner = cfg.eveowners.GetIfExists(issuerID)
                addedRoleNames = [roles[roleID] for roleID in added]
                removedRoleNames = [roles[roleID] for roleID in removed]
                keptRoleNames = [roles[roleID] for roleID in kept]
                cerberizedAddedRoleNames = localizationUtil.FormatGenericList(
                    addedRoleNames)
                cerberizedRemovedRoleNames = localizationUtil.FormatGenericList(
                    removedRoleNames)
                cerberizedKeptRoleNames = localizationUtil.FormatGenericList(
                    keptRoleNames)
                rolesAddedLabel = ''
                rolesRemovedLabel = ''
                rolesKeptLabel = ''
                if len(addedRoleNames) > 0:
                    rolesAddedLabel = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/RolesAdded',
                        listOfAddedRoles=cerberizedAddedRoleNames)
                if len(removedRoleNames) > 0:
                    rolesRemovedLabel = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/RolesRemoved',
                        listOfRemovedRoles=cerberizedRemovedRoleNames)
                if len(keptRoleNames) > 0:
                    rolesKeptLabel = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/RolesKept',
                        listOfKeptRoles=cerberizedKeptRoleNames)
                summaryLabel = localization.GetByLabel(
                    'UI/Corporations/CorporationWindow/Members/Auditing/SummaryOfChanges',
                    firstListMessage=rolesAddedLabel,
                    secondListMessage=rolesRemovedLabel,
                    thirdListMessage=rolesKeptLabel)
                unknownIssuer = localization.GetByLabel('UI/Common/Unknown')
                corpName = cfg.eveowners.Get(roleItem.corporationID).name
                if actionOwner is None:
                    if roleItem.grantable:
                        action = localization.GetByLabel(
                            'UI/Corporations/CorporationWindow/Members/Auditing/UnknownCharChangedGrantableRoles',
                            charName=unknownIssuer,
                            changedChar=roleItem.charID,
                            corpName=corpName,
                            whatChanged=summaryLabel)
                    else:
                        action = localization.GetByLabel(
                            'UI/Corporations/CorporationWindow/Members/Auditing/UnknownCharChangedRoles',
                            charName=unknownIssuer,
                            changedChar=roleItem.charID,
                            corpName=corpName,
                            whatChanged=summaryLabel)
                elif roleItem.grantable:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/KnownCharChangedGrantableRoles',
                        changingChar=issuerID,
                        changedChar=roleItem.charID,
                        corpName=corpName,
                        whatChanged=summaryLabel)
                else:
                    action = localization.GetByLabel(
                        'UI/Corporations/CorporationWindow/Members/Auditing/KnownCharChangedRoles',
                        changingChar=issuerID,
                        changedChar=roleItem.charID,
                        corpName=corpName,
                        whatChanged=summaryLabel)
            text = '%s<t>%s' % (time, action)
            scrolllist.append(
                listentry.Get('Text', {
                    'text': text,
                    'line': 1,
                    'canOpen': 'Action'
                }))

        if 0 == len(scrolllist):
            scrolllist.append(
                listentry.Get(
                    'Text', {
                        'text':
                        localization.GetByLabel('UI/Common/NoDataAvailable'),
                        'line':
                        1
                    }))
        self.sr.scroll.Load(contentList=scrolllist,
                            headers=[
                                localization.GetByLabel('UI/Common/Date'),
                                localization.GetByLabel('UI/Common/Action')
                            ])
        if not len(scrolllist):
            self.sr.notext = 1
            self.sr.scroll.ShowHint(
                localization.GetByLabel(
                    'UI/Corporations/CorporationWindow/Members/Auditing/NoAuditingRecordsFound'
                ))
        else:
            self.sr.notext = 0
        self.sr.fwdBtn.state = uiconst.UI_NORMAL
        self.sr.backBtn.state = uiconst.UI_NORMAL
        sm.GetService('loading').StopCycle()