eric6/Preferences/__init__.py

branch
multi_processing
changeset 7627
812ee8c0a91a
parent 7568
e8688eb98b98
parent 7598
6bb50f2a1df2
child 7646
39e3db2b4936
--- a/eric6/Preferences/__init__.py	Sun May 03 13:42:52 2020 +0200
+++ b/eric6/Preferences/__init__.py	Wed Jun 17 17:14:12 2020 +0200
@@ -954,6 +954,7 @@
         "DiskCacheEnabled": True,
         "DiskCacheSize": 50,        # 50 MB
         "SslExceptionsDB": "{}",    # empty JSON dictionary
+        "AlwaysRejectFaultyCertificates": False,
         "DoNotTrack": False,
         "RefererSendReferer": 2,        # send always
         "RefererDefaultPolicy": 3,      # don't send a referer when downgrading
@@ -1479,6 +1480,7 @@
                                         # QChart.ChartTheme otherwise
         "MpyCrossCompiler": "",         # path of the mpy-cross compiler
         "DfuUtilPath": "",              # path of the dfu-util flashing tool
+        "IgnoredUnknownDevices": "[]",  # empty list encoded as JSON
         # documentation URLs
         "MicroPythonDocuUrl":
             "https://docs.micropython.org/en/latest/",
@@ -2839,7 +2841,7 @@
                  "WebRTCPublicInterfacesOnly", "DnsPrefetchEnabled",
                  "FlashCookiesDeleteOnStartExit", "FlashCookieAutoRefresh",
                  "FlashCookieNotify", "VirusTotalEnabled", "VirusTotalSecure",
-                 "PdfViewerEnabled",
+                 "PdfViewerEnabled", "AlwaysRejectFaultyCertificates",
                  ]:
         return toBool(prefClass.settings.value(
             "WebBrowser/" + key, prefClass.webBrowserDefaults[key]))
@@ -2970,10 +2972,6 @@
         "Qt/Qt5TranslationsDir",
         prefClass.qtDefaults["Qt5TranslationsDir"])
     if s == "":
-        s = os.getenv("QTTRANSLATIONSDIR", "")
-    if s == "":
-        s = os.getenv("QT5TRANSLATIONSDIR", "")
-    if s == "":
         s = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
     if s == "" and Globals.isWindowsPlatform():
         transPath = os.path.join(Globals.getPyQt5ModulesDirectory(),
@@ -3578,6 +3576,14 @@
         return toBool(prefClass.settings.value(
             "MicroPython/" + key,
             prefClass.microPythonDefaults[key]))
+    elif key in ["IgnoredUnknownDevices"]:
+        jsonStr = prefClass.settings.value(
+            "MicroPython/" + key,
+            prefClass.microPythonDefaults[key])
+        if jsonStr:
+            return json.loads(jsonStr)
+        else:
+            return None
     else:
         return prefClass.settings.value(
             "MicroPython/" + key,
@@ -3592,7 +3598,14 @@
     @param value the value to be set
     @param prefClass preferences class used as the storage area
     """
-    prefClass.settings.setValue("MicroPython/" + key, value)
+    if key in ["IgnoredUnknownDevices"]:
+        prefClass.settings.setValue(
+            "MicroPython/" + key,
+            json.dumps(value))
+    else:
+        prefClass.settings.setValue(
+            "MicroPython/" + key,
+            value)
 
 
 def getGeometry(key, prefClass=Prefs):

eric ide

mercurial