20893 Cache preferences need to be hooked up

This commit is contained in:
davidm%netscape.com 2006-05-17 02:24:18 +00:00
parent aaed7c5923
commit 25744e4c4d
4 changed files with 28 additions and 3 deletions

View File

@ -1,9 +1,26 @@
function prefCacheSelectFolder()
{
dump("prefCacheSelectFolder \n");
bundle = srGetStrBundle("chrome://pref/locale/prefutilities.properties");
var folderField = document.getElementById("browserCacheDirectory");
var url = getFileOrFolderURL( bundle.GetStringFromName("cachefolder"), true );
if( url != -1 )
folderField.value = url;
}
function prefClearMemCache()
{
dump("prefClearMemCache \n");
var cache = Components.classes['component://netscape/network/cache?name=manager'].getService();
var cacheService = cache.QueryInterface( Components.interfaces.nsINetDataCacheManager);
cacheService.Clear( 2 );
}
function prefClearDiskCache()
{
dump("prefClearDiskCache \n");
var cache = Components.classes['component://netscape/network/cache?name=manager'].getService();
var cacheService = cache.QueryInterface( Components.interfaces.nsINetDataCacheManager);
cacheService.Clear( 12 );
}

View File

@ -63,7 +63,7 @@
</box>
<text value="&kbyes;"/>
<box orient="horizontal" align="right" flex="1" autostretch="never">
<titledbutton class="dialog push" name="clearm" value="&clearDiskcacheButton.label;" />
<titledbutton class="dialog push" name="cleard" value="&clearDiskcacheButton.label;" />
</box>
</box>
@ -106,7 +106,7 @@
</html:div>
<html:div>&kbyes;</html:div>
<spring flex="100%"/>
<titledbutton class="dialog push" name="clearm" value="&clearMemcacheButton.label;" />
<titledbutton class="dialog push" name="clearm" value="&clearMemcacheButton.label;" onclick="prefClearMemCache()" />
</box>
<box orient="horizontal">
<html:div>
@ -115,7 +115,7 @@
</html:div>
<html:div>&kbyes;</html:div>
<spring flex="100%"/>
<titledbutton class="dialog push" name="clearm" value="&clearDiskcacheButton.label;" />
<titledbutton class="dialog push" name="cleard" value="&clearDiskcacheButton.label;" onclick ="prefClearDiskCache()" />
</box>
<box orient="vertical" flex="100%">
<box orient="horizontal" style="padding-right: 3px;">

View File

@ -143,6 +143,13 @@
<html:label for="browserEnableCache" accesskey="n" tabindex="0">
&debugEnableMemCache.label;
</html:label>
<html:input type="checkbox" id="browserEnableDiskCache"
pref="true" preftype="bool" prefstring="browser.cache.disk.enable"/>
<html:label for="browserEnableDiskCache" accesskey="n" tabindex="0">
&debugEnableDiskCache.label;
</html:label>
</html:div>
<html:div>

View File

@ -26,5 +26,6 @@
<!ENTITY debugMiscellaneous.label "Miscellaneous">
<!ENTITY debugDisableXULCache.label "Disable XUL Cache">
<!ENTITY debugEnableMemCache.label "Enable Mem Cache">
<!ENTITY debugEnableDiskCache.label "Enable Disk Cache">
<!ENTITY debugEnableXPCOMRefcntLog.label "Enable XPCOM Refcount Log">
<!ENTITY debugShowAboutAsStupidModalWindow.label "Show 'About' as modal dialog (woohoo)">