Ejemplo n.º 1
0
 def ApplyAttributes(self, attributes):
     super(EntityMonitor, self).ApplyAttributes(attributes)
     self.SetMinSize([self.default_width, self.default_height])
     self.SetHeight(self.default_height)
     self.entityID = attributes.get('entID', 0)
     self.SetCaption('Entity Monitor for %d' % self.entityID)
     self.entityClient = sm.GetService('entityClient')
     self.sr.content.scroll = Scroll(parent=self.sr.content,
                                     top=14,
                                     padding=5)
     self.componentNodes = {}
     self.componentDataNodes = {}
     clientNodeData = {
         'decoClass': SE_ListGroupCore,
         'GetSubContent': self.GetClientNodes,
         'label': 'Client',
         'id': ('location', 'Client'),
         'showicon': 'hide',
         'showlen': False,
         'state': 'locked'
     }
     self.clientNode = ScrollEntryNode(**clientNodeData)
     serverNodeData = {
         'decoClass': SE_ListGroupCore,
         'GetSubContent': self.GetServerNodes,
         'label': 'Server',
         'id': ('location', 'Server'),
         'showicon': 'hide',
         'showlen': False,
         'state': 'locked'
     }
     self.serverNode = ScrollEntryNode(**serverNodeData)
     self.thread = uthread.new(self.LoadEntityThread)
Ejemplo n.º 2
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.SetMinSize([self.default_width, self.default_height])
     self.SetCaption('Encounter Debug Window')
     self.sr.content.padding = 5
     self.encounterSpawnServer = sm.RemoteSvc('encounterSpawnServer')
     debugContainer = Container(parent=self.sr.content)
     Button(parent=debugContainer,
            align=uiconst.TOBOTTOM,
            label='Start Encounter',
            func=self._StartSelectedEncounter,
            padding=(0, 3, 0, 0))
     Button(parent=debugContainer,
            align=uiconst.TOBOTTOM,
            label='Stop Encounter',
            func=self._StopSelectedEncounter,
            padding=(0, 5, 0, 0))
     Button(parent=debugContainer,
            align=uiconst.TOBOTTOM,
            label='Clear Results',
            func=self._ClearResults,
            padding=(0, 5, 0, 0))
     self.results = Edit(parent=debugContainer,
                         align=uiconst.TOBOTTOM,
                         padding=(0, 5, 0, 0),
                         readonly=True,
                         name='results')
     self.encounterScroll = Scroll(parent=debugContainer,
                                   name='encounterScroll',
                                   align=uiconst.TOALL)
     self.encounterScroll.LoadContent(
         contentList=self._GetAvailableEncounters())
Ejemplo n.º 3
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.SetCaption(
         localization.GetByLabel(
             'UI/Browser/BrowserHistory/BrowserHistoryCaption'))
     self.SetMinSize((400, 256))
     mainArea = self.GetMainArea()
     mainArea.clipChildren = 0
     mainArea.padding = 6
     clearHistory = Button(parent=mainArea,
                           label=localization.GetByLabel(
                               'UI/Browser/BrowserHistory/ClearHistory'),
                           func=self.ClearHistory,
                           align=uiconst.BOTTOMRIGHT)
     self.scroll = Scroll(parent=mainArea,
                          padBottom=clearHistory.height + 6)
     self.LoadHistory()
Ejemplo n.º 4
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     name = attributes.bookmarkName
     url = attributes.url
     self.SetCaption(localization.GetByLabel('UI/Browser/EditBookmarks/Caption'))
     self.SetButtons(uiconst.OKCLOSE, okLabel=localization.GetByLabel('UI/Browser/EditBookmarks/Remove', selectedItems=0), okFunc=self.Remove, okModalResult=uiconst.ID_NONE)
     self.SetMinSize((256, 256))
     main = self.GetMainArea()
     main.clipChildren = 0
     Container(name='errorParent', parent=main, align=uiconst.TOBOTTOM, height=16, state=uiconst.UI_HIDDEN)
     toppar = Container(name='toppar', align=uiconst.TOTOP, height=66, parent=main, idx=0, padding=(const.defaultPadding,
      const.defaultPadding,
      const.defaultPadding,
      const.defaultPadding))
     c = Container(name='namecont', parent=toppar, align=uiconst.TOTOP, height=20, padBottom=5)
     label = Label(text=localization.GetByLabel('UI/Browser/EditBookmarks/Name'), fontsize=9, letterspace=2, state=uiconst.UI_DISABLED, parent=c, align=uiconst.CENTERLEFT, left=4)
     edit = SinglelineEdit(name='nameEdit', parent=c, align=uiconst.CENTERLEFT, width=150)
     edit.OnReturn = self.OnEnter
     self.nameEdit = edit
     c = Container(name='urlcont', parent=toppar, align=uiconst.TOTOP, height=20, padBottom=5)
     label2 = Label(text=localization.GetByLabel('UI/Browser/EditBookmarks/URL'), fontsize=9, letterspace=2, state=uiconst.UI_DISABLED, parent=c, align=uiconst.CENTERLEFT, left=4, uppercase=True)
     edit = SinglelineEdit(name='urlEdit', parent=c, align=uiconst.CENTERLEFT, width=150)
     edit.OnReturn = self.OnEnter
     self.urlEdit = edit
     self.nameEdit.left = self.urlEdit.left = max(35, label.textwidth + 6, label2.textwidth + 6)
     b = Button(parent=toppar, label=localization.GetByLabel('UI/Browser/EditBookmarks/Add'), func=self.OnEnter, align=uiconst.BOTTOMRIGHT)
     editBtn = Button(parent=toppar, label=localization.GetByLabel('UI/Browser/EditBookmarks/Edit'), pos=(b.width + const.defaultPadding,
      0,
      0,
      0), func=self.OnEdit, align=uiconst.BOTTOMRIGHT)
     editBtn.state = uiconst.UI_HIDDEN
     self.editBtn = editBtn
     name = StripTags(name).strip()
     if name:
         self.nameEdit.SetValue(name)
     if url:
         self.urlEdit.SetValue(url)
     self.scroll = Scroll(parent=main, padding=(const.defaultPadding,
      const.defaultPadding,
      const.defaultPadding,
      const.defaultPadding))
     sm.GetService('sites')
     self.RefreshSites()
Ejemplo n.º 5
0
 def ApplyAttributes(self, attributes):
     self._ready = False
     Window.ApplyAttributes(self, attributes)
     self.graphs = GraphManager()
     self.graphs.SetEnabled(True)
     if hasattr(self, 'SetTopparentHeight'):
         self.SetTopparentHeight(0)
         self.container = Container(parent=self.sr.main,
                                    align=uiconst.TOALL)
     else:
         self.container = Container(parent=self.sr.content,
                                    align=uiconst.TOALL)
     self.settingsContainer = Container(parent=self.container,
                                        align=uiconst.TOTOP,
                                        height=30)
     self.showTimersChk = Checkbox(parent=self.settingsContainer,
                                   align=uiconst.TOLEFT,
                                   text='Timers',
                                   checked=True,
                                   width=120,
                                   height=30,
                                   callback=self.PopulateScroll)
     self.showMemoryChk = Checkbox(parent=self.settingsContainer,
                                   align=uiconst.TOLEFT,
                                   text='Memory counters',
                                   checked=True,
                                   width=120,
                                   height=30,
                                   callback=self.PopulateScroll)
     self.showLowCountersChk = Checkbox(parent=self.settingsContainer,
                                        align=uiconst.TOLEFT,
                                        text='Low counters',
                                        checked=True,
                                        width=120,
                                        height=30,
                                        callback=self.PopulateScroll)
     self.showHighCountersChk = Checkbox(parent=self.settingsContainer,
                                         align=uiconst.TOLEFT,
                                         text='High counters',
                                         checked=True,
                                         width=120,
                                         height=30,
                                         callback=self.PopulateScroll)
     self.resetBtn = Button(parent=self.settingsContainer,
                            align=uiconst.TORIGHT,
                            label='Reset peaks',
                            width=120,
                            height=30,
                            func=self.PopulateScroll)
     self.refreshBtn = Button(parent=self.settingsContainer,
                              align=uiconst.TORIGHT,
                              label='Refresh',
                              width=120,
                              height=30,
                              func=self.PopulateScroll)
     self.scroll = Scroll(parent=self.container,
                          id='blueGraphsScroll',
                          align=uiconst.TOTOP,
                          height=200)
     self.graphsContainer = Container(parent=self.container,
                                      align=uiconst.TOALL)
     self._ready = True
     self.PopulateScroll()
Ejemplo n.º 6
0
 def ApplyAttributes(self, attributes):
     super(EntityBrowserCore, self).ApplyAttributes(attributes)
     self.SetHeight(self.default_height)
     self.SetCaption('Entity Browser')
     if not session.role & service.ROLE_QA:
         Label(
             text=
             'Viewing the entity window is restricted to users with QA privileges',
             align=uiconst.TOTOP,
             parent=self.sr.content)
         return
     self.entityClient = sm.GetService('entityClient')
     self.sr.content.padding = 5
     self.sr.content.searchEntryLabel = Label(parent=self.sr.content,
                                              align=uiconst.TOPLEFT,
                                              top=14,
                                              text='Entity ID:  ')
     self.sr.content.searchEntry = SinglelineEdit(
         parent=self.sr.content,
         align=uiconst.TOPLEFT,
         top=14,
         left=self.sr.content.searchEntryLabel.width + 10,
         width=200)
     self.sr.content.searchButton = Button(
         parent=self.sr.content,
         align=uiconst.TOPLEFT,
         top=14,
         left=self.sr.content.searchEntry.left +
         self.sr.content.searchEntry.width + 20,
         label='View Entity',
         func=self.ViewEntityButtonFunc)
     self.sr.content.filterEntryLabel = Label(
         parent=self.sr.content,
         align=uiconst.TOPLEFT,
         top=self.sr.content.searchButton.top +
         self.sr.content.searchButton.height + 2,
         text='Component Filters:  ')
     self.sr.content.filterEntry = SinglelineEdit(
         parent=self.sr.content,
         align=uiconst.TOPLEFT,
         hinttext='Comma separated component names',
         OnReturn=self.FilterEntitiesFunc,
         left=self.sr.content.filterEntryLabel.width + 10,
         top=self.sr.content.searchButton.top +
         self.sr.content.searchButton.height + 2,
         width=300)
     filterButton = Button(parent=self.sr.content,
                           align=uiconst.TOPLEFT,
                           left=self.sr.content.filterEntry.left +
                           self.sr.content.filterEntry.width + 20,
                           top=self.sr.content.searchButton.top +
                           self.sr.content.searchButton.height + 2,
                           label='Filter Entities',
                           func=self.FilterEntitiesFunc)
     self.SetMinSize(
         [filterButton.left + filterButton.width + 10, self.default_height])
     self.sceneNodes = {}
     self.sceneDataNodes = {}
     self.componentFilters = []
     self.sr.content.scroll = Scroll(parent=self.sr.content,
                                     padTop=filterButton.top +
                                     filterButton.height + 2)
     self.thread = uthread.new(self.LoadScenesThread)
 def ConstructBottomCont(self):
     self.scroll = Scroll(parent=self.bottomCont, multiselect=True)
     self.LoadScroll()
Ejemplo n.º 8
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     initialUrl = attributes.initialUrl
     self.SetCaption(localization.GetByLabel('UI/Browser/TrustedSites'))
     self.SetMinSize((368, 300))
     mainArea = self.GetMainArea()
     mainArea.top = 2
     self.inputContainer = Container(name='inputContainer',
                                     parent=mainArea,
                                     align=uiconst.TOTOP,
                                     height=50)
     self.bodyContainer = Container(name='bodyContainer',
                                    parent=mainArea,
                                    align=uiconst.TOALL,
                                    pos=(0, 0, 0, 0))
     self.trustContainer = Container(name='trustContainer',
                                     parent=self.bodyContainer,
                                     align=uiconst.TOTOP,
                                     height=76)
     self.ignoreContainer = Container(name='ignoreContainer',
                                      parent=self.bodyContainer,
                                      align=uiconst.TOBOTTOM,
                                      height=76)
     urlInputContainer = Container(name='urlInputContainer',
                                   parent=self.inputContainer,
                                   align=uiconst.TOTOP,
                                   height=22,
                                   top=3)
     inputButtonContainer = Container(name='urlInputButtonContainer',
                                      parent=self.inputContainer,
                                      align=uiconst.TOBOTTOM,
                                      height=20,
                                      padRight=4)
     self.urlText = Label(
         text=localization.GetByLabel('UI/Browser/EditBookmarks/URL'),
         parent=urlInputContainer,
         align=uiconst.TOLEFT,
         padLeft=6,
         state=uiconst.UI_DISABLED,
         uppercase=1,
         fontsize=10,
         letterspace=1)
     self.urlInput = SinglelineEdit(name='urlInput',
                                    parent=urlInputContainer,
                                    align=uiconst.TOTOP,
                                    padRight=const.defaultPadding,
                                    padLeft=const.defaultPadding)
     self.trustBtn = Button(
         parent=inputButtonContainer,
         label=localization.GetByLabel('UI/Browser/TrustSite'),
         align=uiconst.TORIGHT,
         padLeft=4,
         padBottom=3,
         func=self.TrustSite)
     self.trustBtn.hint = localization.GetByLabel(
         'UI/Browser/TrustManagementTrustHint')
     self.ignoreBtn = Button(
         parent=inputButtonContainer,
         label=localization.GetByLabel('UI/Browser/IgnoreSite'),
         align=uiconst.TORIGHT,
         padLeft=4,
         padBottom=3,
         func=self.IgnoreSite)
     self.ignoreBtn.hint = localization.GetByLabel(
         'UI/Browser/TrustManagementIgnoreHint')
     trustBtnContainer = Container(name='trustBtnContainer',
                                   parent=self.trustContainer,
                                   align=uiconst.TOBOTTOM,
                                   height=22,
                                   padRight=4)
     trustRemoveBtn = Button(
         parent=trustBtnContainer,
         label=localization.GetByLabel('UI/Commands/Remove'),
         align=uiconst.TORIGHT,
         padLeft=4,
         padBottom=3,
         func=self.RemoveTrustedSite)
     trustRemoveBtn.hint = localization.GetByLabel(
         'UI/Browser/TrustManagementRemoveTrustHint')
     trustTextContainer = Container(name='trustTextContainer',
                                    parent=self.trustContainer,
                                    align=uiconst.TOTOP,
                                    height=14)
     Label(text=localization.GetByLabel('UI/Browser/TrustedSites'),
           parent=trustTextContainer,
           state=uiconst.UI_DISABLED,
           fontsize=10,
           left=10,
           top=3)
     trustScrollContainer = Container(name='trustScrollContainer',
                                      parent=self.trustContainer,
                                      align=uiconst.TOALL)
     self.trustScroll = Scroll(
         parent=trustScrollContainer,
         padding=(const.defaultPadding, const.defaultPadding,
                  const.defaultPadding, const.defaultPadding))
     ignoreBtnContainer = Container(name='ignoreBtnContainer',
                                    parent=self.ignoreContainer,
                                    align=uiconst.TOBOTTOM,
                                    height=22,
                                    padRight=4)
     ignoreRemoveBtn = Button(
         parent=ignoreBtnContainer,
         label=localization.GetByLabel('UI/Commands/Remove'),
         align=uiconst.TORIGHT,
         padLeft=4,
         padBottom=3,
         func=self.RemoveIgnoredSite)
     ignoreRemoveBtn.hint = localization.GetByLabel(
         'UI/Browser/TrustManagementRemoveIgnoredHint')
     ignoreTextContainer = Container(name='ignoreTextContainer',
                                     parent=self.ignoreContainer,
                                     align=uiconst.TOTOP,
                                     height=14)
     Label(text=localization.GetByLabel('UI/Browser/IgnoredSites'),
           parent=ignoreTextContainer,
           state=uiconst.UI_DISABLED,
           fontsize=10,
           left=10,
           top=3)
     ignoreScrollContainer = Container(name='ignoreScrollContainer',
                                       parent=self.ignoreContainer,
                                       align=uiconst.TOALL)
     self.ignoreScroll = Scroll(
         parent=ignoreScrollContainer,
         padding=(const.defaultPadding, const.defaultPadding,
                  const.defaultPadding, const.defaultPadding))
     self.inited = 1
     self.sitesSvc = sm.GetService('sites')
     self.RefreshSites()
     if initialUrl is not None:
         self.urlInput.SetValue(initialUrl)