Fix for bug 98476. Add safe save & redundant backup support for prefs.js. r=sfraser, sr=alecf.

This commit is contained in:
bnesse%netscape.com 2006-05-17 02:34:20 +00:00
parent 9e5c04e55a
commit 91af35dced
3 changed files with 24 additions and 1 deletions

View File

@ -254,7 +254,26 @@ nsPrefWindow.prototype =
}
}
}
this.pref.savePrefFile(null);
try
{
this.pref.savePrefFile(null);
}
catch (e)
{
try
{
var prefUtilBundle = document.getElementById("bundle_prefutilities");
var alertText = prefUtilBundle.getString("prefSaveFailedAlert");
var titleText = prefUtilBundle.getString("prefSaveFailedTitle");
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
promptService.alert(window, titleText, alertText);
}
catch (e)
{
dump(e + "\n");
}
}
},
switchPage:

View File

@ -60,6 +60,8 @@
</script>
<stringbundle id="bundle_prefutilities"
src="chrome://communicator/locale/pref/prefutilities.properties"/>
<script type="application/x-javascript" src="chrome://global/content/nsWidgetStateManager.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/pref/nsPrefWindow.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/pref/pref-help.js"/>

View File

@ -15,3 +15,5 @@ oldTheme=You have selected a theme which was designed for an earlier version of
languageAlert=Please restart %brand% to use the new preferred language or region setting.
languageTitle=Change Language
prefSaveFailedAlert=Failed to save the preferences file. Any preference changes will be lost at the end of this session.
prefSaveFailedTitle=Save Error