예제 #1
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     trustUrl = attributes.trustUrl
     inputUrl = attributes.inputUrl
     self.SetCaption(localization.GetByLabel('UI/Browser/AskTrustedSites'))
     self.SetMinSize((400, 300))
     main = self.GetMainArea()
     self.ignoreAlwaysBtnPar = Container(name='ignoreAlwaysBtnPar', parent=main, align=uiconst.TOBOTTOM, height=22, top=2)
     self.ignoreBtnPar = Container(name='ignoreBtnPar', parent=main, align=uiconst.TOBOTTOM, height=22, top=2)
     self.trustBtn = Button(parent=self.ignoreBtnPar, label=localization.GetByLabel('UI/Browser/TrustPrompt/TrustSite'), align=uiconst.TOLEFT, pos=(4, 0, 0, 0), func=self.TrustSite)
     self.trustBtn.hint = localization.GetByLabel('UI/Browser/TrustPrompt/TrustButtonHint')
     self.ignoreBtn = Button(parent=self.ignoreBtnPar, label=localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreOnce'), align=uiconst.TORIGHT, pos=(4, 0, 0, 0), func=self.IgnoreThisRequest)
     self.ignoreBtn.hint = localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreOnceHint')
     self.ignoreAlwaysBtn = Button(parent=self.ignoreAlwaysBtnPar, label=localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreAlways'), align=uiconst.TORIGHT, pos=(4, 0, 0, 0), func=self.AlwaysIgnoreRequests)
     self.ignoreAlwaysBtn.hint = localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreAlwaysHint')
     self.sourcePar = Container(name='sourcePar', parent=main, align=uiconst.TOBOTTOM, height=32)
     self.sourceTxtPar = Container(name='sourceTxtPar', parent=self.sourcePar, align=uiconst.TOTOP, height=14)
     self.sourceUrlPar = Container(name='sourceUrlPar', parent=self.sourcePar, align=uiconst.TOTOP, height=16)
     self.sourceTxt = Label(text=localization.GetByLabel('UI/Browser/TrustPrompt/RequestFrom'), parent=self.sourceTxtPar, state=uiconst.UI_DISABLED, color=(0.5, 0.5, 0.5, 0.7), align=uiconst.TOALL, padLeft=8)
     self.sourceUrl = Label(text=inputUrl, parent=self.sourceUrlPar, state=uiconst.UI_NORMAL, color=(0.5, 0.5, 0.5, 0.7), align=uiconst.TOALL, padLeft=8)
     self.sourceUrl.hint = inputUrl
     Line(parent=self.sourcePar, align=uiconst.TOTOP, color=(0.4, 0.4, 0.4, 0.9))
     self.promptPar = Container(name='promptPar', parent=main, align=uiconst.TOALL, pos=(8, 2, 8, 2))
     trustDescription = localization.GetByLabel('UI/Browser/TrustPrompt/TrustDescription', trustUrl=trustUrl)
     self.promptTxt = Edit(setvalue=trustDescription, parent=self.promptPar, readonly=1, align=uiconst.TOALL)
     self.trustUrl = trustUrl
     self.inputUrl = inputUrl
예제 #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())
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.showNavigationBar = settings.user.ui.Get('browserShowNavBar', True)
     self.showStatusBar = settings.user.ui.Get('browserShowStatusBar', True)
     self.SetCaption(localization.GetByLabel('UI/Browser/BrowserSettings/BrowserSettingsCaption'))
     self.SetButtons(uiconst.OKCLOSE, okLabel=localization.GetByLabel('UI/Browser/BrowserSettings/SaveChanges'), okFunc=self.Save, okModalResult=uiconst.ID_NONE)
     main = self.GetMainArea()
     main.clipChildren = 0
     main.padding = 6
     c = Container(name='homeCont', parent=main, align=uiconst.TOTOP, height=32)
     l = Container(name='left', parent=c, align=uiconst.TOLEFT, width=100, state=uiconst.UI_PICKCHILDREN)
     r = Container(name='right', parent=c, align=uiconst.TORIGHT, width=80, state=uiconst.UI_PICKCHILDREN)
     text = Label(text=localization.GetByLabel('UI/Browser/BrowserSettings/Homepage'), align=uiconst.TOALL, state=uiconst.UI_DISABLED, parent=l, left=0, top=4, width=2)
     top = (text.textheight - 16) / 2 + 2 if text.textheight > 16 else 0
     totalTop = top
     btn = Button(parent=r, label=localization.GetByLabel('UI/Browser/BrowserSettings/ResetHomepage'), func=self.ResetHomePage, pos=(0,
      top,
      0,
      0), align=uiconst.TOPRIGHT)
     if btn.width > 80:
         r.width = btn.width
     self.homeEdit = SinglelineEdit(name='homeEdit', setvalue=settings.user.ui.Get('HomePage2', browserutil.DefaultHomepage()), align=uiconst.TOTOP, pos=(0,
      top,
      0,
      0), parent=c)
     Line(parent=main, align=uiconst.TOTOP, color=(0.5, 0.5, 0.5, 0.75))
     self.showHideContainer = Container(name='showHideContainer', parent=main, align=uiconst.TOTOP, height=35, top=0, state=uiconst.UI_PICKCHILDREN)
     self.showStatusBarCbx = Checkbox(text=localization.GetByLabel('UI/Browser/BrowserSettings/ShowStatusBar'), parent=self.showHideContainer, configName='', retval=0, checked=self.showStatusBar)
     self.showNavBarCbx = Checkbox(text=localization.GetByLabel('UI/Browser/BrowserSettings/ShowNavigationBar'), parent=self.showHideContainer, configName='', retval=0, checked=self.showNavigationBar)
     Line(parent=main, align=uiconst.TOTOP, color=(0.5, 0.5, 0.5, 0.75))
     self.cacheContainer = Container(name='cacheContainer', parent=main, align=uiconst.TOTOP, height=26, top=8, state=uiconst.UI_PICKCHILDREN)
     l = Container(name='cacheLeft', parent=self.cacheContainer, align=uiconst.TOLEFT, width=100, state=uiconst.UI_PICKCHILDREN)
     r = Container(name='cacheRight', parent=self.cacheContainer, align=uiconst.TORIGHT, width=80, state=uiconst.UI_PICKCHILDREN)
     if not blue.win32.IsTransgaming():
         text = Label(text=localization.GetByLabel('UI/Browser/BrowserSettings/CacheLocation'), align=uiconst.TOLEFT, state=uiconst.UI_DISABLED, parent=l, padding=(2, 4, 2, 4))
         top = (text.textheight - 16) / 2 + 2 if text.textheight > 16 else 0
         totalTop += top
         btn = Button(parent=r, label=localization.GetByLabel('UI/Browser/BrowserSettings/ResetCacheLocation'), func=self.ResetCacheLocation, pos=(0,
          top,
          0,
          0), align=uiconst.TOPRIGHT)
         if btn.width > r.width:
             r.width = btn.width
         if text.textwidth > l.width:
             l.width = text.textwidth + 4
         self.cacheEdit = SinglelineEdit(name='cacheEdit', setvalue=settings.public.generic.Get('BrowserCache', corebrowserutil.DefaultCachePath()), align=uiconst.TOTOP, pos=(0,
          top,
          0,
          0), parent=self.cacheContainer)
         explainContainer = Container(name='cacheExplainContainer', parent=main, align=uiconst.TOTOP, height=26)
         Label(text=localization.GetByLabel('UI/Browser/BrowserSettings/CacheCaption'), align=uiconst.TOALL, state=uiconst.UI_DISABLED, parent=explainContainer, padLeft=4, fontsize=10)
         totalTop += 26
         clearCacheContainer = Container(name='clearCacheContainer', parent=main, align=uiconst.TOTOP, height=14)
         btn = Button(parent=clearCacheContainer, label=localization.GetByLabel('UI/Browser/BrowserSettings/ClearCache'), func=self.ClearCache)
         btn.hint = (localization.GetByLabel('UI/Browser/BrowserSettings/ClearCacheHint'),)
         totalTop += 16
     else:
         totalTop -= 32
     self.SetMinSize((500, 204 + totalTop))
     sm.StartService('sites')
 def ConstructMainCont(self):
     self.spriteCont.Flush()
     self.mainItem = None
     self.mainTransform = None
     self.mainSprite = None
     self.codeEdit = None
     if self.mode is MODE_NORMAL:
         self.mainTransform = Transform(parent=self.spriteCont,
                                        align=uiconst.CENTER,
                                        pos=(0, 0, 128, 128))
         self.mainSprite = Sprite(
             parent=self.mainTransform,
             align=uiconst.CENTER,
             pos=(0, 0, 128, 128),
             texturePath='res:/UI/Texture/CorpLogoLibs/419.png',
             texturePathSecondary='res:/UI/Texture/colorgradient.dds')
     elif self.mode is MODE_CODE:
         self.codeEdit = SinglelineEdit(
             parent=self.spriteCont,
             align=uiconst.TOTOP,
             label='Code that returns a UI object:',
             heigt=15,
             padding=(10, 30, 150, 0),
             setvalue=settings.user.ui.Get('TestAnimationsWndCode',
                                           'uicore.layer.sidePanels'))
         Button(parent=self.spriteCont,
                align=uiconst.TOPLEFT,
                label='Assign result',
                top=60,
                left=5,
                func=self.OnAssignCodeBtn)
     elif self.mode is MODE_INPUT:
         self.mainItem = self.inputObj
예제 #5
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     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)
     from carbonui.primitives.gridcontainer import GridContainer
     self.optionsContainer = Container(parent=self.container,
                                       align=uiconst.TOTOP,
                                       height=40)
     self.cppCaptureChk = Checkbox(
         parent=self.optionsContainer,
         text='C++ capture',
         checked=blue.statistics.isCppCaptureEnabled,
         callback=self._OnCppCaptureChk,
         align=uiconst.TOTOP)
     self.gpuCaptureChk = Checkbox(
         parent=self.optionsContainer,
         text='GPU capture',
         checked=trinity.settings.GetValue('gpuTelemetryEnabled'),
         callback=self._OnGpuCaptureChk,
         align=uiconst.TOTOP)
     self.buttonContainer = GridContainer(parent=self.container,
                                          align=uiconst.TOALL,
                                          columns=2,
                                          rows=2)
     self.startBtn = Button(parent=self.buttonContainer,
                            align=uiconst.TOALL,
                            label='Start',
                            func=self._Start)
     self.stopBtn = Button(parent=self.buttonContainer,
                           align=uiconst.TOALL,
                           label='Stop',
                           func=self._Stop)
     self.pauseBtn = Button(parent=self.buttonContainer,
                            align=uiconst.TOALL,
                            label='Pause',
                            func=self._Pause)
     self.resumeBtn = Button(parent=self.buttonContainer,
                             align=uiconst.TOALL,
                             label='Resume',
                             func=self._Resume)
     uthread.new(self._CheckStatus)
 def ApplyAttributes(self, attributes):
     super(CameraDebugWindow, self).ApplyAttributes(attributes)
     self.SetMinSize([self.default_width, self.default_height])
     self.SetCaption('Camera Debug Window')
     self.sr.content.padding = (5, 16, 5, 5)
     self.debugSelectionClient = sm.GetService('debugSelectionClient')
     self.cameraDebugClient = sm.GetService('cameraDebugClient')
     self.cameraClient = sm.GetService('cameraClient')
     self.cameraStack = Label(parent=self.sr.content, align=uiconst.TOPLEFT, text=self.PrintCameraStack())
     buttonContainer = Container(parent=self.sr.content, align=uiconst.TOBOTTOM, height=70, padding=(150, 0, 150, 0))
     self.toggleCamera = Button(parent=buttonContainer, align=uiconst.TOBOTTOM, label='Activate Normal Camera', func=self.OnToggleDebugCamera)
     self.toggleCamUpdate = Button(parent=buttonContainer, align=uiconst.TOBOTTOM, label='Toggle Camera Update', func=self.OnToggleDebugCameraUpdate, hint='Toggle between updating the debug, and normal camera.')
     self.showCamCheckBox = Checkbox(parent=buttonContainer, aligh=uiconst.TOBOTTOM, text='Show Normal Camera', checked=False, callback=self.OnSnowNormalCameraCheckbox)
     import cameras
     self.cameraClient.AddSharedCamera('Debug Camera', cameras.DebugCamera())
     if type(self.cameraClient.GetActiveCamera()) is cameras.DebugCamera:
         self.DisableDebugCamera()
     self.EnableDebugCamera()
     sm.GetService('navigation').hasControl = False
예제 #7
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()
 def ApplyAttributes(self, attributes):
     SE_GenericCore.ApplyAttributes(self, attributes)
     self.checkbox = Checkbox(parent=self,
                              align=uiconst.CENTERLEFT,
                              pos=(45, 0, 16, 16),
                              idx=0)
     self.checkbox.data = {}
     self.checkbox.OnChange = self.CheckBoxChange
     self.btn = Button(parent=self,
                       align=uiconst.TOLEFT,
                       fixedwidth=45,
                       label='Play',
                       func=self.PlayAnimation)
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     if hasattr(self, 'SetTopparentHeight'):
         self.SetTopparentHeight(0)
     if self.sr.main is None:
         self.sr.main = Container(parent=self.sr.maincontainer)
     self.mainItem = None
     self.mainSprite = None
     self.mainTransform = None
     self.inputObj = attributes.get('animObj', None)
     self.codeEdit = None
     self.duration = 0.5
     self.loops = 1
     self.curveSet = None
     if self.inputObj:
         self.mode = MODE_INPUT
     else:
         self.mode = MODE_NORMAL
     self.topCont = Container(name='topCont',
                              parent=self.sr.main,
                              align=uiconst.TOTOP,
                              height=20)
     self.mainCont = Container(name='mainCont',
                               parent=self.sr.main,
                               align=uiconst.TOTOP,
                               height=200)
     self.topRightCont = Container(name='topRightCont',
                                   parent=self.mainCont,
                                   align=uiconst.TORIGHT,
                                   width=100)
     self.spriteCont = Container(name='spriteCont', parent=self.mainCont)
     from carbonui.primitives.gridcontainer import GridContainer
     self.buttonCont = GridContainer(name='buttonCont',
                                     parent=self.sr.main,
                                     align=uiconst.TOBOTTOM,
                                     height=30,
                                     columns=3,
                                     lines=1)
     self.bottomCont = Container(name='bottomCont', parent=self.sr.main)
     self.ConstructTopCont()
     self.ConstructTopRightCont()
     self.ConstructBottomCont()
     self.ConstructMainCont()
     btns = [('Uncheck all', self.UncheckAll, ()),
             ('Stop all', self.StopAllAnimations, ()),
             ('Play selected', self.PlaySelected, ())]
     for label, func, args in btns:
         Button(parent=Container(parent=self.buttonCont),
                label=label,
                func=func,
                align=uiconst.CENTER)
예제 #10
0
 def PrepareTabBar(self):
     mainArea = self.GetMainArea()
     self.tabBar = Container(name='tabParent',
                             parent=mainArea,
                             align=uiconst.TOTOP,
                             height=24)
     self.addTabBtn = Button(
         parent=self.tabBar,
         label=localization.uiutil.PrepareLocalizationSafeString('+'),
         align=uiconst.TOPRIGHT,
         fixedwidth=22,
         func=self.AddTabButton,
         alwaysLite=True,
         hint=localization.GetByLabel('UI/Browser/NewTab'),
         left=const.defaultPadding)
예제 #11
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()
예제 #12
0
 def SetAbortFunc(self, func):
     args = None
     if type(func) == types.TupleType:
         func, args = func
     if self.abortbtnpar is None:
         if func is None:
             return
         self.abortbtnpar = Container(parent=self.sr.main,
                                      align=uiconst.TOBOTTOM,
                                      pos=(0, 0, 0, 30),
                                      state=uiconst.UI_PICKCHILDREN)
         self.abortbtn = Button(func=func, args=args, align=uiconst.CENTER)
     if func is None:
         self.abortbtnpar.state = uiconst.UI_HIDDEN
     else:
         self.abortbtnpar.state = uiconst.UI_NORMAL
         self.abortbtn.OnClick = (func, args)
예제 #13
0
 def PrepareNavigationBar(self):
     mainArea = self.GetMainArea()
     self.navigationBar = Container(name='navBar',
                                    parent=mainArea,
                                    align=uiconst.TOTOP,
                                    height=24,
                                    padBottom=4)
     buttonParent = Container(name='buttonParent',
                              parent=self.navigationBar,
                              align=uiconst.TORIGHT,
                              padRight=const.defaultPadding)
     goBtn = Button(parent=buttonParent,
                    label=localization.GetByLabel('UI/Browser/Go'),
                    func=self.OnGoBtn,
                    align=uiconst.CENTER)
     buttonParent.width = goBtn.width
     iconContainer = Container(name='sslIndicator',
                               parent=self.navigationBar,
                               align=uiconst.TORIGHT,
                               width=20,
                               padRight=const.defaultPadding)
     Sprite(name='sslIcon',
            texturePath='res:/UI/Texture/classes/Browser/sslIcon.png',
            parent=iconContainer,
            pos=(-2, -1, 24, 24),
            hint=localization.GetByLabel('UI/Browser/SecureConnection'),
            ignoreSize=True,
            state=uiconst.UI_NORMAL)
     self.sslIconContainer = iconContainer
     self.urlInput = SinglelineEdit(name='urlInput',
                                    parent=self.navigationBar,
                                    padTop=1,
                                    padRight=const.defaultPadding,
                                    maxLength=1630,
                                    autoselect=True,
                                    align=uiconst.TOTOP)
     self.urlInput.OnReturn = self.BrowseTo
     self.urlInput.OnHistoryClick = self.OnHistoryClicked
예제 #14
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()
예제 #15
0
    def ApplyAttributes(self, attributes):
        Window.ApplyAttributes(self, attributes)
        self.SetTopparentHeight(4)
        self.collectingFpsStats = False
        self.fpsStats = []
        self.fpsLabel = Label(parent=self.sr.main,
                              left=4,
                              width=80,
                              fontsize=18)
        self.platformLabel = Label(parent=self.sr.main,
                                   left=4,
                                   top=24,
                                   width=80,
                                   fontsize=12,
                                   text=trinity.platform)
        self.fpsStat = blue.statistics.Find('FPS')
        self.frameTimeStat = blue.statistics.Find('Trinity/FrameTime')
        self.toggleDisplayResults = False
        self.legendContainer = GridContainer(parent=self.sr.main,
                                             align=uiconst.TORIGHT,
                                             width=28,
                                             columns=1,
                                             padRight=4,
                                             padBottom=4)
        self.startStatsBtn = Button(parent=self.sr.main,
                                    align=uiconst.BOTTOMLEFT,
                                    label='Start Collecting Stats',
                                    left=5,
                                    top=10,
                                    func=self.StartCollectingData)
        self.stopStatsBtn = Button(parent=self.sr.main,
                                   align=uiconst.BOTTOMLEFT,
                                   label='Stop Collecting Stats',
                                   left=5,
                                   top=10,
                                   func=self.StopCollectingData,
                                   state=uiconst.UI_HIDDEN)
        self.timeLabel = Label(parent=self.sr.main,
                               align=uiconst.BOTTOMLEFT,
                               left=142,
                               top=11,
                               width=100,
                               fontsize=12)
        self.displayResultsCheckbox = Checkbox(
            parent=self.sr.main,
            align=uiconst.BOTTOMRIGHT,
            left=10,
            top=10,
            callback=self.ToggleDisplayResults,
            width=100)
        self.labels = []
        for i in xrange(4):
            label = Label(parent=self.legendContainer,
                          align=uiconst.TOTOP,
                          width=20,
                          top=-4)
            self.labels.append(label)

        graphContainer = Container(parent=self.sr.main,
                                   align=uiconst.TOALL,
                                   padLeft=4,
                                   padRight=4,
                                   padBottom=4)
        gr = GraphRenderer(parent=graphContainer, align=uiconst.TOALL)
        self.renderer = gr.renderer
        self.renderer.scaleChangeCallback = self.ScaleChangeHandler
        if self.fpsStat:
            uthread.new(self.UpdateFpsLabel)
예제 #16
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)
예제 #17
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)