Commit 17e0d58d authored by Nico Josuttis's avatar Nico Josuttis

persist encryption model

parent 8dd0f8d2
......@@ -145,7 +145,12 @@ pref("extensions.enigmail.quotedPrintableWarn",0);
// use http proxy settings as set in Mozilla/Thunderbird
pref("extensions.enigmail.respectHttpProxy",true);
// selection for which keys to accept (trust-model always)
// selection for which encryption model to prefer
// 0: convenient encryption settings
// 1: manual encryption settings
pref("extensions.enigmail.encryptionModel",0);
// selection for which keys to accept
// 0: accept valid/authenticated keys
// 1: accept all keys (except disabled, ...)
pref("extensions.enigmail.acceptedKeys",0);
......
......@@ -143,6 +143,9 @@ var gUsePGPMimeOptionList = ["usePGPMimeNever",
"usePGPMimePossible",
"usePGPMimeAlways"];
var gEnigEncryptionModel = ["encryptionModelConvenient",
"encryptionModelManually"];
var gEnigAcceptedKeys = ["acceptedKeysValid",
"acceptedKeysAll"];
......
......@@ -126,8 +126,8 @@ function displayPrefs(showDefault, showPrefs, setPrefs) {
}
}
function prefOnLoad() {
function prefOnLoad()
{
GetEnigmailSvc();
displayPrefs(false, true, false);
......@@ -176,12 +176,13 @@ function prefOnLoad() {
}
EnigDisplayRadioPref("acceptedKeys", EnigGetPref("acceptedKeys"),
gEnigAcceptedKeys);
EnigDisplayRadioPref("autoSendEncrypted", EnigGetPref("autoSendEncrypted"),
gEnigAutoSendEncrypted);
EnigDisplayRadioPref("confirmBeforeSending", EnigGetPref("confirmBeforeSending"),
gEnigConfirmBeforeSending);
gEnigEncryptionModel = EnigGetPref("encryptionModel");
if (gEnigEncryptionModel == 0) { // convenient encryption
resetSendingPrefsConvenient();
}
else {
resetSendingPrefsManually();
}
EnigDisplayRadioPref("recipientsSelection", EnigGetPref("recipientsSelection"),
gEnigRecipientsSelection);
......@@ -267,12 +268,13 @@ function resetPrefs() {
EnigSetPref("configuredVersion", EnigGetVersion());
EnigDisplayRadioPref("acceptedKeys", EnigGetPref("acceptedKeys"),
gEnigAcceptedKeys);
EnigDisplayRadioPref("autoSendEncrypted", EnigGetPref("autoSendEncrypted"),
gEnigAutoSendEncrypted);
EnigDisplayRadioPref("confirmBeforeSending", EnigGetPref("confirmBeforeSending"),
gEnigConfirmBeforeSending);
gEnigEncryptionModel = EnigGetPref("encryptionModel");
if (gEnigEncryptionModel == 0) { // convenient encryption
resetSendingPrefsConvenient();
}
else {
resetSendingPrefsManually();
}
EnigDisplayRadioPref("recipientsSelection", EnigGetPref("recipientsSelection"),
gEnigRecipientsSelection);
}
......@@ -303,38 +305,35 @@ function disableManually (disable)
}
}
function resetSendingPrefsConvenient() {
gEnigAcceptedKeys = 1; // all
gEnigAutoSendEncrypted = 1; // if keys accepted
gEnigConfirmBeforeSending = 0; // never
EnigSetPref("acceptedKeys", gEnigAcceptedKeys);
EnigSetPref("autoSendEncrypted", gEnigAutoSendEncrypted);
EnigSetPref("confirmBeforeSending", gEnigConfirmBeforeSending);
function updateSendingPrefs()
{
EnigDisplayRadioPref("acceptedKeys", EnigGetPref("acceptedKeys"),
gEnigAcceptedKeys);
EnigDisplayRadioPref("autoSendEncrypted", EnigGetPref("autoSendEncrypted"),
gEnigAutoSendEncrypted);
EnigDisplayRadioPref("confirmBeforeSending", EnigGetPref("confirmBeforeSending"),
gEnigConfirmBeforeSending);
disableManually(true);
gEnigEncryptionModel = EnigGetPref("encryptionModel");
disableManually(gEnigEncryptionModel == 0);
displayPrefs(false, true, false);
}
function resetSendingPrefsManually() {
//gEnigAcceptedKeys = 0; // only valid keys
//gEnigAutoSendEncrypted = 0; // never
//gEnigConfirmBeforeSending = 1; // always
function resetSendingPrefsConvenient() {
gEnigEncryptionModel = 0; // convenient encryption settings
EnigSetPref("encryptionModel", gEnigEncryptionModel);
gEnigAcceptedKeys = 1; // all
gEnigAutoSendEncrypted = 1; // if keys accepted
gEnigConfirmBeforeSending = 0; // never
EnigSetPref("acceptedKeys", gEnigAcceptedKeys);
EnigSetPref("autoSendEncrypted", gEnigAutoSendEncrypted);
EnigSetPref("confirmBeforeSending", gEnigConfirmBeforeSending);
EnigDisplayRadioPref("acceptedKeys", EnigGetPref("acceptedKeys"),
gEnigAcceptedKeys);
EnigDisplayRadioPref("autoSendEncrypted", EnigGetPref("autoSendEncrypted"),
gEnigAutoSendEncrypted);
EnigDisplayRadioPref("confirmBeforeSending", EnigGetPref("confirmBeforeSending"),
gEnigConfirmBeforeSending);
disableManually(false);
displayPrefs(false, true, false);
updateSendingPrefs();
}
function resetSendingPrefsManually() {
gEnigEncryptionModel = 1; // manual encryption settings
EnigSetPref("encryptionModel", gEnigEncryptionModel);
updateSendingPrefs();
}
function resetRememberedValues() {
......
......@@ -267,27 +267,27 @@
<vbox id="sending" flex="1">
<description class="enigmailPrefsTitle">&enigmail.whenSending.label; ...</description>
<hbox flex="1" align="end">
<radiogroup id="enigmail_encryptionModel"
flex="1"
pref="true"
preftype="int"
prefstring="extensions.enigmail.encryptionModel">
<radio id="encryptionModelConvenient"
value="0"
label="Convenient encryption settings"
oncommand="resetSendingPrefsConvenient();"/>
<radio id="encryptionModelManual"
value="1"
label="Manual encryption settings"
oncommand="resetSendingPrefsManually();"/>
</radiogroup>
<vbox align="end">
<hbox flex="1" align="end">
<radiogroup id="enigmail_encryptionModel"
flex="1"
pref="true"
preftype="int"
prefstring="extensions.enigmail.encryptionModel">
<radio id="encryptionModelConvenient"
value="0"
label="&enigmail.encryptionModelConvenient.label;"
oncommand="resetSendingPrefsConvenient();"/>
<radio id="encryptionModelManually"
value="1"
label="&enigmail.encryptionModelManually.label;"
oncommand="resetSendingPrefsManually();"/>
</radiogroup>
<vbox align="end">
<button id="sendingPrefsHelp"
label="&enigmail.help.label;"
oncommand="EnigHelpWindow('sendingPrefs');"/>
</vbox>
</hbox>
</vbox>
</hbox>
<!-- elements for manual settings: -->
<groupbox id="enigmail_pref_sending_manually">
......
......@@ -207,6 +207,9 @@
<!ENTITY enigmail.defaultEncryptionNone.label "No default encryption">
<!ENTITY enigmail.defaultNotSignedsend.label "Do not sign messages by default">
<!ENTITY enigmail.encryptionModelConvenient.label "Convenient encryption settings">
<!ENTITY enigmail.encryptionModelManually.label "Manual encryption settings">
<!ENTITY enigmail.acceptedKeysOption.label "To send encrypted, accept">
<!ENTITY enigmail.acceptedKeysValid.label "keys signed by me or other people I trust">
<!ENTITY enigmail.acceptedKeysValid.tooltip "This option is provided to deal with the danger of faked keys using the Web-of-Trust. You only accept keys that are signed by yourself or by other people you trust. Technically, you only accept keys 'valid' for encryption.">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment