зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
30582a6b8a
Коммит
ea7d65f467
|
@ -27,6 +27,8 @@ var gHiddenEncryptionPolicy = null;
|
||||||
var gEncryptionChoices = null;
|
var gEncryptionChoices = null;
|
||||||
var gSignCertName = null;
|
var gSignCertName = null;
|
||||||
var gSignMessages = null;
|
var gSignMessages = null;
|
||||||
|
var gEncryptAlways = null;
|
||||||
|
var gNeverEncrypt = null;
|
||||||
|
|
||||||
function onInit()
|
function onInit()
|
||||||
{
|
{
|
||||||
|
@ -36,6 +38,8 @@ function onInit()
|
||||||
gEncryptionChoices = document.getElementById("encryptionChoices");
|
gEncryptionChoices = document.getElementById("encryptionChoices");
|
||||||
gSignCertName = document.getElementById("identity.signing_cert_name");
|
gSignCertName = document.getElementById("identity.signing_cert_name");
|
||||||
gSignMessages = document.getElementById("identity.sign_mail");
|
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");
|
gEncryptionCertName.value = gIdentity.getUnicharAttribute("encryption_cert_name");
|
||||||
|
|
||||||
|
@ -59,6 +63,7 @@ function onInit()
|
||||||
if (!gEncryptionCertName.value)
|
if (!gEncryptionCertName.value)
|
||||||
{
|
{
|
||||||
gEncryptAlways.setAttribute("disabled", true);
|
gEncryptAlways.setAttribute("disabled", true);
|
||||||
|
gNeverEncrypt.setAttribute("disabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// we currently don't support encrypt if possible so keep it disabled for now...
|
// 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....
|
// find out which radio for the encryption radio group is selected and set that on our hidden encryptionChoice pref....
|
||||||
var newValue = gEncryptionChoices.selectedItem.value;
|
var newValue = gEncryptionChoices.selectedItem.value;
|
||||||
gHiddenEncryptionPolicy.setAttribute('value', newValue);
|
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()
|
function onLockPreference()
|
||||||
|
@ -144,6 +154,7 @@ function smimeSelectCert(smime_cert)
|
||||||
|
|
||||||
if (smime_cert == "identity.encryption_cert_name") {
|
if (smime_cert == "identity.encryption_cert_name") {
|
||||||
gEncryptAlways.removeAttribute("disabled");
|
gEncryptAlways.removeAttribute("disabled");
|
||||||
|
gNeverEncrypt.removeAttribute("disabled");
|
||||||
} else {
|
} else {
|
||||||
gSignMessages.removeAttribute("disabled");
|
gSignMessages.removeAttribute("disabled");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<!ENTITY encryptionChoiceLabel.label "Use encryption when sending messages:">
|
<!ENTITY encryptionChoiceLabel.label "Use encryption when sending messages:">
|
||||||
<!ENTITY neverEncrypt.label "Never">
|
<!ENTITY neverEncrypt.label "Never">
|
||||||
<!ENTITY ifPossibleEncryptMessage.label "If possible (messages are sent without encryption if not all recipients have a certificate)">
|
<!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.message "Use the following personal certificate:">
|
||||||
<!ENTITY encryptionCert.notselected "No certificate set">
|
<!ENTITY encryptionCert.notselected "No certificate set">
|
||||||
<!ENTITY certificate.button "Select...">
|
<!ENTITY certificate.button "Select...">
|
||||||
|
|
Загрузка…
Ссылка в новой задаче