Пример #1
0
    def Refresh(self, *args):
        self.station_inited = 0
        self.search_inited = 0
        self.filt_inited = 0
        try:
            self.scrollPosition[
                self.key] = self.sr.scroll.GetScrollProportion()
        except:
            self.scrollPosition[self.key] = 0.0

        uix.Flush(self.sr.main)
        self.sr.scroll = uicontrols.Scroll(
            parent=self.sr.main,
            padding=(const.defaultPadding, const.defaultPadding,
                     const.defaultPadding, const.defaultPadding))
        self.sr.scroll.sr.id = 'assets'
        self.sr.scroll.sr.minColumnWidth = {
            localization.GetByLabel('UI/Common/Name'): 44
        }
        self.sr.scroll.allowFilterColumns = 1
        self.sr.scroll.OnNewHeaders = self.ReloadTabs
        self.sr.scroll.sortGroups = True
        self.sr.scroll.SetColumnsHiddenByDefault(
            uix.GetInvItemDefaultHiddenHeaders())
        tabs = [
            [
                localization.GetByLabel('UI/Inventory/AssetsWindow/AllItems'),
                self.sr.scroll, self, 'allitems'
            ],
            [
                localization.GetByLabel('UI/Common/LocationTypes/Region'),
                self.sr.scroll, self, 'regitems'
            ],
            [
                localization.GetByLabel(
                    'UI/Common/LocationTypes/Constellation'), self.sr.scroll,
                self, 'conitems'
            ],
            [
                localization.GetByLabel('UI/Common/LocationTypes/SolarSystem'),
                self.sr.scroll, self, 'sysitems'
            ],
            [
                localization.GetByLabel('UI/Common/Buttons/Search'),
                self.sr.scroll, self, 'search'
            ]
        ]
        if eve.session.stationid:
            tabs.insert(4, [
                localization.GetByLabel('UI/Common/LocationTypes/Station'),
                self.sr.scroll, self, 'station'
            ])
        self.sr.maintabs = uicontrols.TabGroup(name='tabparent',
                                               parent=self.sr.main,
                                               idx=0,
                                               tabs=tabs,
                                               groupID='assetspanel',
                                               silently=True)
Пример #2
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.itemID = attributes.itemID
     self.displayName = attributes.displayName
     self.activeFilters = attributes.get('activeFilters', [])
     showControls = attributes.get('showControls', self.default_showControls)
     self.quickFilterInput = attributes.Get('quickFilterInput', None)
     self.invController = self._GetInvController(attributes)
     self.items = []
     self.cols = None
     self.droppedIconData = (None, None)
     self.iconWidth = 64
     import xtriui
     self.iconHeight = xtriui.InvItem.GetInvItemHeight()
     self.sr.resizeTimer = None
     self.scrollTimer = None
     self.tmpDropIdx = {}
     self.refreshingView = False
     self.reRefreshView = False
     self.changeViewModeThread = None
     self.hintText = None
     self.dragStart = None
     self.previouslyHighlighted = None
     self.dragContainer = None
     self.itemChangeThread = None
     self.initialized = False
     self.numFilteredItems = 0
     if showControls:
         import uicls
         self.topCont = uiprimitives.Container(parent=self, align=uiconst.TOTOP, height=22)
         uicls.InvContViewBtns(parent=self.topCont, align=uiconst.CENTERLEFT, controller=self)
         uicls.InvContQuickFilter(parent=self.topCont, align=uiconst.CENTERRIGHT, invCont=self)
     self.scroll = uicontrols.Scroll(parent=self, state=uiconst.UI_PICKCHILDREN)
     self.scroll.sr.id = 'containerWnd_%s' % self.invController.GetName()
     self.scroll.OnNewHeaders = self.OnNewHeadersSet
     self.scroll.allowFilterColumns = 1
     self.scroll.SetColumnsHiddenByDefault(uix.GetInvItemDefaultHiddenHeaders())
     self.scroll.dad = self
     self.scroll.Copy = self.Copy
     self.scroll.Cut = self.Cut
     self.scroll.Paste = self.Paste
     content = self.content = self.scroll.GetContentContainer()
     content.OnDragEnter = self.OnDragEnter
     content.OnDragExit = self.OnDragExit
     content.OnDropData = self.OnScrollContentDropData
     content.GetMenu = lambda : GetContainerMenu(self)
     content.OnMouseUp = self.scroll.OnMouseUp = self.OnScrollMouseUp
     content.OnMouseDown = self.scroll.OnMouseDown = self.OnScrollMouseDown
     self.invSvcCookie = sm.GetService('inv').Register(self)
     self.sortIconsBy, self.sortIconsDir = settings.user.ui.Get('containerSortIconsBy_%s' % self.name, ('type', 0))
     self.viewMode = settings.user.ui.Get('containerViewMode_%s' % self.name, 'icons')
     uthread.new(self.ChangeViewMode, ['icons', 'details', 'list'].index(self.viewMode))
Пример #3
0
 def Load(self, key):
     sm.GetService('corpui').LoadTop('res:/ui/Texture/WindowIcons/assetscorp.png', localization.GetByLabel('UI/Corporations/Assets/CorpAssets'), localization.GetByLabel('UI/Corporations/Common/UpdateDelay'))
     if not self.sr.Get('inited', 0):
         self.sr.inited = 1
         self.sr.scroll = uicontrols.Scroll(parent=self, padding=(const.defaultPadding,
          const.defaultPadding,
          const.defaultPadding,
          const.defaultPadding))
         self.sr.scroll.adjustableColumns = 1
         self.sr.scroll.sr.id = 'CorporationAssets'
         self.sr.scroll.sr.minColumnWidth = {localization.GetByLabel('UI/Common/Name'): 44}
         self.sr.scroll.SetColumnsHiddenByDefault(uix.GetInvItemDefaultHiddenHeaders())
         self.sr.tabs = uicontrols.TabGroup(name='tabparent', parent=self, idx=0)
         tabs = [[localization.GetByLabel('UI/Corporations/Common/Offices'),
           self.sr.scroll,
           self,
           FLAGNAME_OFFICES],
          [localization.GetByLabel('UI/Corporations/Assets/Impounded'),
           self.sr.scroll,
           self,
           FLAGNAME_IMPOUNDED],
          [localization.GetByLabel('UI/Corporations/Assets/InSpace'),
           self.sr.scroll,
           self,
           FLAGNAME_PROPERTY],
          [localization.GetByLabel('UI/Corporations/Assets/Deliveries'),
           self.sr.scroll,
           self,
           FLAGNAME_DELIVERIES],
          [localization.GetByLabel('UI/Corporations/Assets/Lockdown'),
           self.sr.scroll,
           self,
           KEYNAME_LOCKDOWN],
          [localization.GetByLabel('UI/Common/Search'),
           self.sr.scroll,
           self,
           KEYNAME_SEARCH]]
         if self.IsDirector():
             self.safetyParent = uiprimitives.Container(parent=self)
             safetyTabInfo = [localization.GetByLabel('UI/Inventory/AssetSafety/Safety'),
              self.safetyParent,
              self,
              KEYNAME_SAFETY]
             tabs.insert(-1, safetyTabInfo)
         self.sr.tabs.Startup(tabs, 'corpassetstab', autoselecttab=0)
     self.sr.scroll.Load(contentList=[], headers=uix.GetInvItemDefaultHeaders())
     self.sr.scroll.OnNewHeaders = self.OnNewHeadersSet
     self.sr.scroll.allowFilterColumns = 0
     if self.sr.Get('search_cont', None):
         self.sr.search_cont.state = uiconst.UI_HIDDEN
     if key == 'accounts':
         key = FLAGNAME_OFFICES
         self.sr.tabs.AutoSelect()
         return
     if key not in (KEYNAME_SEARCH, KEYNAME_SAFETY):
         if not getattr(self, 'filt_inited', False):
             self.InitAssetFilters()
         self.sr.filt_cont.state = uiconst.UI_PICKCHILDREN
     elif self.sr.Get('filt_cont', None):
         self.sr.filt_cont.state = uiconst.UI_HIDDEN
     if key in (KEYNAME_LOCKDOWN,):
         uthread.new(self.ShowLockdown, None, None)
     elif key == KEYNAME_SEARCH:
         self.sr.scroll.OnNewHeaders = self.Search
         uthread.new(self.ShowSearch)
     elif key == KEYNAME_SAFETY:
         if self.safetyCont is None or self.safetyCont.destroyed:
             self.safetyCont = AssetSafetyCont(parent=self.safetyParent, padding=4, controller=SafetyControllerCorp())
         self.safetyCont.display = True
         self.safetyCont.Load()
     else:
         uthread.new(self.ShowAssets, key, None, None)
Пример #4
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     items = attributes.get('items', [])
     outputOwner = attributes.outputOwner
     outputFlag = attributes.outputFlag
     self.items = {}
     self.quotes = {}
     self.invCookie = None
     self.invReady = 0
     self.crits = {}
     self.closing = False
     self.outputOwnerAndFlag = [None, None]
     self.inputOwnerAndFlag = [None, None]
     self.selectedItemIDs = {}
     self.comboLocationOutput = None
     self.comboLocationInput = None
     self.reprocessing = 0
     self.scrollWidth = MINSCROLLWIDTH
     office = sm.GetService('corp').GetOffice()
     if office is None and (outputOwner is not None
                            or outputFlag is not None):
         outputOwner = eve.session.charid
         outputFlag = const.flagHangar
     self.outputOwnerAndFlag = [outputOwner, outputFlag]
     self.SetScope('station')
     self.Confirm = self.ValidateOK
     self._OnClose = self.OnCloseReprocessing
     self.SetCaption(
         localization.GetByLabel(
             'UI/Reprocessing/ReprocessingWindow/WindowLabel'))
     self.SetWndIcon('ui_17_128_1')
     self.SetMinSize([385, 270])
     if self is None or self.destroyed:
         return
     self.sr.msgparent = uicls.EveLabelSmall(parent=self.sr.topParent,
                                             left=6,
                                             width=164,
                                             tabs=[110, 164],
                                             idx=0,
                                             align=uiconst.CENTERRIGHT,
                                             state=uiconst.UI_NORMAL)
     self.SetTopparentHeight(64)
     self.sr.textContainer = uicls.Container(name='textContainer',
                                             align=uiconst.TOBOTTOM,
                                             parent=self.sr.main,
                                             height=14,
                                             left=const.defaultPadding,
                                             top=const.defaultPadding,
                                             state=uiconst.UI_HIDDEN)
     self.sr.statusText = uicls.EveLabelMedium(text=localization.GetByLabel(
         'UI/Reprocessing/ReprocessingWindow/InProgressMessage'),
                                               parent=self.sr.textContainer,
                                               state=uiconst.UI_DISABLED,
                                               align=uiconst.CENTERTOP)
     self.sr.mainContainer = uicls.Container(
         name='mainContainer',
         align=uiconst.TOALL,
         parent=self.sr.main,
         pos=(const.defaultPadding, const.defaultPadding,
              const.defaultPadding, const.defaultPadding))
     self.sr.firstContainer = uicls.Container(name='firstContainer',
                                              parent=self.sr.mainContainer,
                                              align=uiconst.TOLEFT,
                                              width=286)
     divider = xtriui.Divider(name='divider',
                              align=uiconst.TOLEFT,
                              width=const.defaultPadding,
                              parent=self.sr.mainContainer,
                              state=uiconst.UI_NORMAL)
     divider.Startup(self.sr.firstContainer, 'width', 'x', MINSCROLLWIDTH,
                     self.scrollWidth)
     divider.OnSizeChanged = self.OnVerticalDividerSizeChanged
     self.sr.divider = divider
     self.sr.itemscroll = uicls.Scroll(name='itemscroll',
                                       parent=self.sr.firstContainer)
     self.sr.itemscroll.sr.id = 'reprocess'
     self.sr.itemscroll.Load(contentList=[])
     self.sr.itemscroll.multiSelect = 0
     self.sr.itemscroll.sr.minColumnWidth = {
         localization.GetByLabel('UI/Common/Name'): 66
     }
     self.sr.itemscroll.OnNewHeaders = self.OnNewHeadersSet
     self.sr.itemscroll.allowFilterColumns = 1
     self.sr.itemscroll.SetColumnsHiddenByDefault(
         uix.GetInvItemDefaultHiddenHeaders())
     self.sr.quotescroll = uicls.Scroll(name='quotescroll',
                                        parent=self.sr.mainContainer)
     self.sr.quotescroll.sr.id = 'reprocessing_quotes'
     self.sr.quotescroll.Load(contentList=[])
     self.sr.standardBtns = uicls.ButtonGroup(btns=[
         [
             'reprocessingServiceGetQuotesBtn',
             localization.GetByLabel(
                 'UI/Reprocessing/ReprocessingWindow/GetQuoteButton'),
             self.OnGetQoutes, (), 81
         ],
         [
             'reprocessingServiceReprocessBtn',
             localization.GetByLabel(
                 'UI/Reprocessing/ReprocessingWindow/ReprocessButton'),
             self.OnOK, (), 81
         ],
         [
             'reprocessingServiceCancelBtn',
             localization.GetByLabel('UI/Common/Buttons/Cancel'),
             self.OnCancel, (), 81
         ]
     ],
                                              forcedButtonNames=True,
                                              parent=self.sr.main,
                                              idx=0)
     self.sr.reprocessBtn = uiutil.GetChild(
         self.sr.standardBtns, 'reprocessingServiceReprocessBtn')
     self.sr.quotesBtn = uiutil.GetChild(self.sr.standardBtns,
                                         'reprocessingServiceGetQuotesBtn')
     items = self.DoSelectItems(items)
     self.showAllItems = False
     if len(items) == 0:
         self.showAllItems = True
     items = self.DrawLocationSelector(items, outputOwner, outputFlag,
                                       office)
     self.Register()
     self.LoadItems(items)
     self._OnResize()
     self.isready = 1
     self.reprocessingInfo = None
     self.UpdateButtons()
     uthread.new(self.OnGetQoutes)
Пример #5
0
 def Load(self, key):
     sm.GetService('corpui').LoadTop('ui_7_64_13', localization.GetByLabel('UI/Corporations/Assets/CorpAssets'), localization.GetByLabel('UI/Corporations/Common/UpdateDelay'))
     if not self.sr.Get('inited', 0):
         self.sr.inited = 1
         self.sr.scroll = uicls.Scroll(parent=self, padding=(const.defaultPadding,
          const.defaultPadding,
          const.defaultPadding,
          const.defaultPadding))
         self.sr.scroll.adjustableColumns = 1
         self.sr.scroll.sr.id = 'CorporationAssets'
         self.sr.scroll.sr.minColumnWidth = {localization.GetByLabel('UI/Common/Name'): 44}
         self.sr.scroll.SetColumnsHiddenByDefault(uix.GetInvItemDefaultHiddenHeaders())
         self.sr.tabs = uicls.TabGroup(name='tabparent', parent=self, idx=0)
         self.sr.tabs.Startup([[localization.GetByLabel('UI/Corporations/Common/Offices'),
           self.sr.scroll,
           self,
           'offices'],
          [localization.GetByLabel('UI/Corporations/Assets/Impounded'),
           self.sr.scroll,
           self,
           'impounded'],
          [localization.GetByLabel('UI/Corporations/Assets/InSpace'),
           self.sr.scroll,
           self,
           'property'],
          [localization.GetByLabel('UI/Corporations/Assets/Deliveries'),
           self.sr.scroll,
           self,
           'deliveries'],
          [localization.GetByLabel('UI/Corporations/Assets/Lockdown'),
           self.sr.scroll,
           self,
           'lockdown'],
          [localization.GetByLabel('UI/Common/Search'),
           self.sr.scroll,
           self,
           'search']], 'corpassetstab', autoselecttab=0)
     self.sr.scroll.Load(contentList=[], headers=uix.GetInvItemDefaultHeaders())
     self.sr.scroll.OnNewHeaders = self.OnNewHeadersSet
     self.sr.scroll.allowFilterColumns = 0
     if self.sr.Get('search_cont', None):
         self.sr.search_cont.state = uiconst.UI_HIDDEN
     if key == 'accounts':
         key = 'offices'
         self.sr.tabs.AutoSelect()
         return
     if key != 'search':
         if not getattr(self, 'filt_inited', False):
             sortKey = settings.char.ui.Get('corpAssetsSortKey', None)
             self.sr.filt_cont = uicls.Container(align=uiconst.TOTOP, height=37, parent=self, top=2, idx=1)
             sortoptions = [(localization.GetByLabel('UI/Common/Name'), 0), (localization.GetByLabel('UI/Common/NumberOfJumps'), 1)]
             self.sr.sortcombo = uicls.Combo(label=localization.GetByLabel('UI/Common/SortBy'), parent=self.sr.filt_cont, options=sortoptions, name='sortcombo', select=sortKey, callback=self.Filter, width=100, pos=(5, 16, 0, 0))
             l = self.sr.sortcombo.width + self.sr.sortcombo.left + const.defaultPadding
             self.sr.filtcombo = uicls.Combo(label=localization.GetByLabel('UI/Common/View'), parent=self.sr.filt_cont, options=[], name='filtcombo', select=None, callback=self.Filter, width=100, pos=(l,
              16,
              0,
              0))
             self.sr.filt_cont.height = self.sr.filtcombo.top + self.sr.filtcombo.height
             self.filt_inited = 1
         self.sr.filt_cont.state = uiconst.UI_PICKCHILDREN
     elif self.sr.Get('filt_cont', None):
         self.sr.filt_cont.state = uiconst.UI_HIDDEN
     if key in 'lockdown':
         uthread.new(self.ShowLockdown, None, None)
     elif key == 'search':
         self.sr.scroll.OnNewHeaders = self.Search
         uthread.new(self.ShowSearch)
     else:
         uthread.new(self.ShowAssets, key, None, None)