mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-03 23:01:31 +00:00
Bug 98476. Gracefully handle error returned from saving of preferences file. r=sfraser, sr=alecf.
This commit is contained in:
parent
a116d5b3bc
commit
8e95c79c7c
@ -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:
|
||||
|
@ -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"/>
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user