def AppGetBrowserCachePath(self):
     """
         This method retrieves the path at which the browser should store
         its cache files; two directories will be created by ccpBrowser.exe
         under this directory: Files and Images.
     
         The return value must be a valid path; if the path does not exist 
         and cannot be created, then ccpBrowser.exe will be configured to
         only use in-memory caching.
         
         ARGUMENTS
             None
     
         RETURNS
             A string containing a filesystem path. 
     """
     return corebrowserutil.DefaultCachePath()
Esempio n. 2
0
 def AppGetBrowserCachePath(self):
     return settings.public.generic.Get('BrowserCache',
                                        corebrowserutil.DefaultCachePath())
 def ResetCacheLocation(self, *args):
     settings.public.generic.Set('BrowserCache', corebrowserutil.DefaultCachePath())
     self.cacheEdit.SetValue(corebrowserutil.DefaultCachePath())
Esempio n. 4
0
 def AppGetBrowserCachePath(self):
     return corebrowserutil.DefaultCachePath()
 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')