def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.ownerID = attributes.ownerID if self.ownerID == session.charid: self.myView = True else: self.myView = False self.quickFilterSetting = 'applicationsQuickFilter_OwnerID%s' % self.ownerID self.filteringBy = settings.char.ui.Get(self.quickFilterSetting, '') self.showingOld = settings.char.ui.Get('applicationsShowOld_%s' % self.ownerID, False) self.InitViewingStatus() self.topContainer = uiprimitives.Container(parent=self, name='topContainer', align=uiconst.TOTOP, height=20, padding=const.defaultPadding) self.quickFilter = uicls.QuickFilterEdit(parent=self.topContainer, align=uiconst.CENTERRIGHT, setvalue=self.filteringBy) self.quickFilter.ReloadFunction = self.OnSearchFieldChanged self.quickFilter.OnReturn = self.SearchByCharacterName self.statusFilter = uicls.UtilMenu(parent=self.topContainer, align=uiconst.CENTERRIGHT, padding=(1, 1, 1, 1), left=103, GetUtilMenu=self.StatusFilterMenu, texturePath='res:/ui/texture/icons/38_16_205.png', hint=localization.GetByLabel('UI/Corporations/CorpApplications/FilterByStatus')) self.inviteButton = Button(name='inviteButton', align=uiconst.CENTERLEFT, parent=self.topContainer, label=localization.GetByLabel('UI/Corporations/CorpApplications/InviteToCorp'), func=self.OpenInviteWindow) if not const.corpRolePersonnelManager & session.corprole == const.corpRolePersonnelManager: self.inviteButton.display = False if self.myView: self.topContainer.display = False self.applicationContainer = uiprimitives.Container(name='applications', parent=self, align=uiconst.TOALL, padding=const.defaultPadding) self.applicationScroll = uicontrols.BasicDynamicScroll(name='applicationsScroll', parent=self.applicationContainer, align=uiconst.TOALL) self.applicationScroll.noContentHint = localization.GetByLabel('UI/Corporations/CorpApplications/NoApplicationsFound') self.applicationScroll.multiSelect = 0
def ApplyAttributes(self, attributes): uicls.Container.ApplyAttributes(self, attributes) self.ownerID = attributes.ownerID if self.ownerID == session.charid: self.myView = True else: self.myView = False self.quickFilterSetting = 'applicationsQuickFilter_OwnerID%s' % self.ownerID self.filteringBy = settings.char.ui.Get(self.quickFilterSetting, '') self.showingOld = settings.char.ui.Get( 'applicationsShowOld_%s' % self.ownerID, False) self.InitViewingStatus() self.topContainer = uicls.Container(parent=self, name='topContainer', align=uiconst.TOTOP, height=20) self.quickFilter = uicls.QuickFilterEdit(parent=self.topContainer, align=uiconst.TOPRIGHT, padding=(1, 1, 1, 1), setvalue=self.filteringBy) self.quickFilter.ReloadFunction = self.OnSearchFieldChanged self.quickFilter.OnReturn = self.SearchByCharacterName self.statusFilter = uicls.UtilMenu( parent=self.topContainer, align=uiconst.TOPRIGHT, padding=(1, 1, 1, 1), left=100, GetUtilMenu=self.StatusFilterMenu, texturePath='res:/ui/texture/icons/38_16_205.png', hint=localization.GetByLabel( 'UI/Corporations/CorpApplications/FilterByStatus')) if self.myView: self.topContainer.display = False self.applicationContainer = uicls.Container(name='applications', parent=self, align=uiconst.TOALL) self.applicationScroll = uicls.BasicDynamicScroll( name='applicationsScroll', parent=self.applicationContainer, align=uiconst.TOALL) self.applicationScroll.noContentHint = localization.GetByLabel( 'UI/Corporations/CorpApplications/NoApplicationsFound') self.applicationScroll.multiSelect = 0
def Load(self, args): if not self.sr.Get('inited', 0): self.ourWarsScroll = None self.allWarsScroll = None self.killReportsScroll = None self.sr.inited = 1 self.maxWarID = const.maxInt self.warbatches = [] self.ourWarsCont = uiprimitives.Container(name='ourWarsCont', parent=self, align=uiconst.TOALL) toolbarContainer = uiprimitives.Container(name='toolbarContainer', align=uiconst.TOBOTTOM, parent=self.ourWarsCont, height=22) declareButton = uicontrols.ButtonGroup(btns=[[ localization.GetByLabel( 'UI/Corporations/CorporationWindow/Alliances/Rankings/DeclareWar' ), self.DeclareWar, None, None ]], parent=toolbarContainer) self.ourWarsScroll = uicontrols.Scroll( parent=self.ourWarsCont, padding=const.defaultPadding) self.allWarsCont = uiprimitives.Container(name='allWarsCont', parent=self, align=uiconst.TOALL) allWarsSettingsCont = uiprimitives.Container( name='allWarsSettingsCont', parent=self.allWarsCont, align=uiconst.TOTOP, height=18, top=2) browseCont = uiprimitives.Container( name='browseCont', parent=self.allWarsCont, align=uiconst.TOBOTTOM, height=22, padding=(const.defaultPadding, 0, const.defaultPadding, 0), state=uiconst.UI_NORMAL) self.prevBtn = uicls.BrowseButton(parent=browseCont, prev=True, state=uiconst.UI_NORMAL, func=self.BrowseAllWars) self.nextBtn = uicls.BrowseButton(parent=browseCont, prev=False, state=uiconst.UI_NORMAL, align=uiconst.TOPRIGHT, func=self.BrowseAllWars) self.showCryForHelpCb = uicontrols.Checkbox( parent=allWarsSettingsCont, align=uiconst.TOPLEFT, left=const.defaultPadding, height=14, width=300, configName='allwars_showcryforhelp', text=localization.GetByLabel( 'UI/Corporations/Wars/ShowCryForHelp'), checked=settings.user.ui.Get('allwars_showcryforhelp', 0), callback=self.CheckBoxChange) self.showCryForHelpCb.hint = localization.GetByLabel( 'UI/Corporations/Wars/NotFilterWhenSearching') self.searchButton = uicontrols.Button( parent=allWarsSettingsCont, label=localization.GetByLabel( 'UI/Corporations/CorporationWindow/Standings/Search'), align=uiconst.TOPRIGHT, pos=(const.defaultPadding, 2, 0, 0), func=self.Search, btn_default=1) self.searchEdit = uicontrols.SinglelineEdit( name='edit', parent=allWarsSettingsCont, left=self.searchButton.width + const.defaultPadding * 2, width=150, align=uiconst.TOPRIGHT, maxLength=32) self.searchEdit.OnReturn = self.Search self.allWarsScroll = uicontrols.Scroll( parent=self.allWarsCont, padding=const.defaultPadding) self.killReportsCont = uiprimitives.Container( name='killReportsCont', parent=self, align=uiconst.TOALL) killSettingsContainer = uiprimitives.Container( name='killSettingsContainer', parent=self.killReportsCont, align=uiconst.TOTOP, height=20) self.killReportQuickFilter = uicls.QuickFilterEdit( parent=killSettingsContainer, left=const.defaultPadding, align=uiconst.CENTERRIGHT, width=150) self.killReportQuickFilter.ReloadFunction = self.ReloadKillReports combatValues = ((localization.GetByLabel( 'UI/Corporations/Wars/Killmails/ShowKills'), 0), (localization.GetByLabel( 'UI/Corporations/Wars/Killmails/ShowLosses'), 1)) selectedCombatType = settings.user.ui.Get('CorpCombatLogCombo', 0) self.combatCombo = uicontrols.Combo(parent=killSettingsContainer, name='combo', select=selectedCombatType, align=uiconst.TOPLEFT, callback=self.OnCombatChange, options=combatValues, idx=0, adjustWidth=True, top=const.defaultPadding, left=const.defaultPadding) self.killReportsScroll = uicontrols.Scroll( parent=self.killReportsCont, padding=const.defaultPadding) warTabs = [ [ localization.GetByLabel( 'UI/Corporations/CorporationWindow/Wars/OurWars'), self.ourWarsCont, self, 'our' ], [ localization.GetByLabel('UI/Corporations/Wars/AllWars'), self.allWarsCont, self, 'all' ], [ localization.GetByLabel( 'UI/Corporations/Wars/Killmails/KillReports'), self.killReportsCont, self, 'killreports' ] ] btnContainer = uiprimitives.Container( name='pageBtnContainer', parent=self, align=uiconst.TOBOTTOM, idx=0, padBottom=const.defaultPadding) btn = uix.GetBigButton(size=22, where=btnContainer, left=4, top=0, align=uiconst.TORIGHT) btn.hint = localization.GetByLabel('UI/Common/ViewMore') btn.state = uiconst.UI_HIDDEN btn.sr.icon.LoadIcon('ui_23_64_2') btn = uix.GetBigButton(size=22, where=btnContainer, left=4, top=0, align=uiconst.TOLEFT) btn.hint = localization.GetByLabel('UI/Common/Previous') btn.state = uiconst.UI_HIDDEN btn.sr.icon.LoadIcon('ui_23_64_1') btnContainer.height = max( [c.height for c in btnContainer.children]) self.btnContainer = btnContainer btnContainer.state = uiconst.UI_HIDDEN tabs = uicontrols.TabGroup(name='tabparent', parent=self, idx=0) tabs.Startup(warTabs, 'corporationwars') self.tabs = tabs self.killentries = 25 sm.GetService('corpui').LoadTop( 'res:/ui/Texture/WindowIcons/wars.png', localization.GetByLabel( 'UI/Corporations/CorporationWindow/Wars/WarsTitle')) self.myWars = 1 if not hasattr(self, 'viewingOwnerID'): self.viewingOwnerID = eve.session.allianceid or eve.session.corpid if not hasattr(self, 'searchOwnerID'): self.searchOwnerID = None extrahint = '' if args != 'wars': self._HideNextPrevBtns() if args == 'all': self.ourWarsCont.display = False self.allWarsCont.display = True self.killReportsCont.display = False self.ShowAllWars() elif args == 'our': self.ourWarsCont.display = True self.allWarsCont.display = False self.killReportsCont.display = False self.ShowWars() elif args == 'killreports': self.ourWarsCont.display = False self.allWarsCont.display = False self.killReportsCont.display = True self.prevIDs = [] self.combatPageNum = 0 selectedCombatType = settings.user.ui.Get('CorpCombatLogCombo', 0) if selectedCombatType == 0: self.ShowCombatKills() else: self.ShowCombatLosses() extrahint = localization.GetByLabel( 'UI/Corporations/CorporationWindow/Wars/DelayedKillboardDetails' ) sm.GetService('corpui').LoadTop( 'res:/ui/Texture/WindowIcons/wars.png', localization.GetByLabel( 'UI/Corporations/CorporationWindow/Wars/WarsTitle'), extrahint)
def DrawStuff(self, *args): self.sr.topCont = uiprimitives.Container(name='topCont', parent=self, align=uiconst.TOTOP, pos=(0, 0, 0, 45)) self.sr.mainCont = uiprimitives.Container(name='mainCont', parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0)) inputsGrid = LayoutGrid(parent=self.sr.topCont, columns=2, top=6, left=const.defaultPadding, cellSpacing=2) self.sr.topRight = uiprimitives.Container(name='topCont', parent=self.sr.topCont, align=uiconst.TORIGHT, pos=(0, 0, 50, 0)) self.quickFilter = uicls.QuickFilterEdit(parent=inputsGrid) self.quickFilter.ReloadFunction = lambda: self.LoadContactsForm( self.contactType) if sm.GetService('addressbook').ShowLabelMenuAndManageBtn( self.formType): labelBtn = uix.GetBigButton( size=32, hint=localization.GetByLabel( 'UI/PeopleAndPlaces/LabelsManageLabels'), align=uiconst.RELATIVE) uiutil.MapIcon(labelBtn.sr.icon, 'res:/ui/Texture/WindowIcons/evemailtag.png', ignoreSize=True) labelBtn.OnClick = self.ManageLabels inputsGrid.AddCell(labelBtn, rowSpan=2) else: inputsGrid.AddCell() self.sr.onlinecheck = Checkbox( text=localization.GetByLabel('UI/PeopleAndPlaces/OnlineOnly'), parent=inputsGrid, configName='onlinebuddyonly', retval=1, checked=settings.user.ui.Get('onlinebuddyonly', 0), groupname=None, callback=self.CheckBoxChange, align=uiconst.TOPLEFT, wrapLabel=False) self.quickFilter.width = max(self.quickFilter.width, self.sr.onlinecheck.width) btn = uix.GetBigButton(24, self.sr.topRight, 32, const.defaultPadding) btn.OnClick = (self.BrowseContacts, -1) btn.hint = localization.GetByLabel('UI/Common/Previous') btn.state = uiconst.UI_HIDDEN btn.SetAlign(align=uiconst.TOPRIGHT) btn.sr.icon.LoadIcon('ui_23_64_1') self.sr.contactBackBtn = btn btn = uix.GetBigButton(24, self.sr.topRight, const.defaultPadding, const.defaultPadding) btn.OnClick = (self.BrowseContacts, 1) btn.hint = localization.GetByLabel('UI/Common/Next') btn.state = uiconst.UI_HIDDEN btn.SetAlign(uiconst.TOPRIGHT) btn.sr.icon.LoadIcon('ui_23_64_2') self.sr.contactFwdBtn = btn self.sr.pageCount = uicontrols.EveLabelMedium( text='', parent=self.sr.topRight, left=10, top=30, state=uiconst.UI_DISABLED, align=uiconst.CENTERTOP) systemStatsCont = uicontrols.DragResizeCont( name='systemStatsCont', settingsID='contactsListSplit', parent=self.sr.mainCont, align=uiconst.TOLEFT, minSize=100, maxSize=200, defaultSize=160) self.sr.leftCont = uiprimitives.Container( name='leftCont', parent=systemStatsCont.mainCont, padding=(const.defaultPadding, 0, 0, 0)) self.sr.leftScroll = uicontrols.Scroll( name='leftScroll', parent=self.sr.leftCont, padding=(0, const.defaultPadding, 0, const.defaultPadding)) self.sr.leftScroll.multiSelect = 0 self.sr.leftScroll.sr.content.OnDropData = self.OnContactDropData self.sr.rightCont = uiprimitives.Container( name='rightCont', parent=self.sr.mainCont, padding=(0, 0, const.defaultPadding, const.defaultPadding)) self.sr.rightScroll = uicontrols.Scroll(name='rightScroll', parent=self.sr.rightCont, padding=(0, const.defaultPadding, 0, 0)) self.sr.rightScroll.sr.ignoreTabTrimming = 1 self.sr.rightScroll.multiSelect = 1 self.sr.rightScroll.sr.content.OnDropData = self.OnContactDropData self.sr.rightScroll.sr.id = self.formType