Fixing bug 117714. This fix saves and retrieves preferences in smime panel properly. Thanks to Stephane Saux for the patch he proposed. Needed to add more changes to that so that prefs are saved while user moves across items like Server Settings, Addressing, etc under a given account in the AccountManager panel. r=sspitzer, sr=mscott

This commit is contained in:
racham%netscape.com 2002-01-10 22:40:27 +00:00
parent ba6725dbc4
commit f9a7f24be9
2 changed files with 12 additions and 1 deletions

View File

@ -27,6 +27,8 @@ var gHiddenEncryptionPolicy = null;
var gEncryptionChoices = null;
var gSignCertName = null;
var gSignMessages = null;
var gEncryptAlways = null;
var gNeverEncrypt = null;
function onInit()
{
@ -36,6 +38,8 @@ function onInit()
gEncryptionChoices = document.getElementById("encryptionChoices");
gSignCertName = document.getElementById("identity.signing_cert_name");
gSignMessages = document.getElementById("identity.sign_mail");
gEncryptAlways = document.getElementById("encrypt_mail_always");
gNeverEncrypt = document.getElementById("encrypt_mail_never");
gEncryptionCertName.value = gIdentity.getUnicharAttribute("encryption_cert_name");
@ -59,6 +63,7 @@ function onInit()
if (!gEncryptionCertName.value)
{
gEncryptAlways.setAttribute("disabled", true);
gNeverEncrypt.setAttribute("disabled", true);
}
// we currently don't support encrypt if possible so keep it disabled for now...
@ -82,6 +87,11 @@ function onSave()
// find out which radio for the encryption radio group is selected and set that on our hidden encryptionChoice pref....
var newValue = gEncryptionChoices.selectedItem.value;
gHiddenEncryptionPolicy.setAttribute('value', newValue);
gIdentity.setIntAttribute("encryptionpolicy", newValue);
gIdentity.setUnicharAttribute("encryption_cert_name", gEncryptionCertName.value);
gIdentity.setBoolAttribute("sign_mail", gSignMessages.checked);
gIdentity.setUnicharAttribute("signing_cert_name", gSignCertName.value);
}
function onLockPreference()
@ -144,6 +154,7 @@ function smimeSelectCert(smime_cert)
if (smime_cert == "identity.encryption_cert_name") {
gEncryptAlways.removeAttribute("disabled");
gNeverEncrypt.removeAttribute("disabled");
} else {
gSignMessages.removeAttribute("disabled");
}

View File

@ -3,7 +3,7 @@
<!ENTITY encryptionChoiceLabel.label "Use encryption when sending messages:">
<!ENTITY neverEncrypt.label "Never">
<!ENTITY ifPossibleEncryptMessage.label "If possible (messages are sent without encryption if not all recipients have a certificate)">
<!ENTITY alwaysEncryptMessage.label "Always (disable send unless all recipients have a certificate">
<!ENTITY alwaysEncryptMessage.label "Always (disable send unless all recipients have a certificate)">
<!ENTITY encryptionCert.message "Use the following personal certificate:">
<!ENTITY encryptionCert.notselected "No certificate set">
<!ENTITY certificate.button "Select...">