Preferences/__init__.py

changeset 5443
3ef014765648
parent 5420
53ca6ddb4acf
child 5519
ab19452732df
child 5531
e7fff6f1ff19
--- a/Preferences/__init__.py	Wed Jan 25 11:17:04 2017 +0100
+++ b/Preferences/__init__.py	Wed Jan 25 12:48:42 2017 +0100
@@ -1222,7 +1222,7 @@
         "MailServerAuthentication": False,
         "MailServerUser": "",
         "MailServerPassword": "",
-        "MailServerUseTLS": False,
+        "MailServerEncryption": "No",   # valid values: No, SSL, TLS
         "MailServerPort": 25,
         "UseSystemEmailClient": False,
         "MasterPassword": "",           # stores the password hash
@@ -3077,11 +3077,19 @@
     elif key in ["MailServerPort"]:
         return int(prefClass.settings.value(
             "User/" + key, prefClass.userDefaults[key]))
-    elif key in ["MailServerAuthentication", "MailServerUseTLS",
-                 "UseSystemEmailClient", "UseMasterPassword",
-                 "SavePasswords"]:
+    elif key in ["MailServerAuthentication", "UseSystemEmailClient",
+                 "UseMasterPassword", "SavePasswords"]:
         return toBool(prefClass.settings.value(
             "User/" + key, prefClass.userDefaults[key]))
+    elif key == "MailServerEncryption":
+        # convert from old key 'MailServerUseTLS'
+        val = prefClass.settings.value("User/" + key)
+        if val is None:
+            if toBool(prefClass.settings.value("User/MailServerUseTLS")):
+                val = "TLS"
+            else:
+                val = prefClass.userDefaults[key]
+        return val
     else:
         return prefClass.settings.value(
             "User/" + key, prefClass.userDefaults[key])

eric ide

mercurial