eric6/Preferences/__init__.py

branch
without_py2_and_pyqt4
changeset 7198
684261ef2165
parent 7196
ab0a91b82b37
child 7229
53054eb5b15a
--- a/eric6/Preferences/__init__.py	Sun Sep 01 17:44:33 2019 +0200
+++ b/eric6/Preferences/__init__.py	Sun Sep 01 19:40:53 2019 +0200
@@ -775,6 +775,7 @@
     
     # defaults for the project browser flags settings
     projectBrowserFlagsDefaults = {
+        # deprecated
         "Qt4": (
             SourcesBrowserFlag |
             FormsBrowserFlag |
@@ -783,6 +784,7 @@
             InterfacesBrowserFlag |
             OthersBrowserFlag |
             ProtocolsBrowserFlag),
+        # deprecated
         "Qt4C": (
             SourcesBrowserFlag |
             ResourcesBrowserFlag |
@@ -880,90 +882,6 @@
         "PySide2DocDir": "",
         "EricDocDir": "",
     }
-##    
-##    @classmethod
-##    def initWebSettingsDefaults(cls):
-##        """
-##        Class method to initialize the web settings related defaults.
-##        """
-##        if QWebSettings is None:
-##            return
-##        
-##        websettings = QWebSettings.globalSettings()
-##        fontFamily = websettings.fontFamily(QWebSettings.StandardFont)
-##        fontSize = websettings.fontSize(QWebSettings.DefaultFontSize)
-##        cls.helpDefaults["StandardFont"] = \
-##            QFont(fontFamily, fontSize).toString()
-##        fontFamily = websettings.fontFamily(QWebSettings.FixedFont)
-##        fontSize = websettings.fontSize(QWebSettings.DefaultFixedFontSize)
-##        cls.helpDefaults["FixedFont"] = QFont(fontFamily, fontSize).toString()
-##        cls.helpDefaults.update({
-##            "AutoLoadImages":
-##            websettings.testAttribute(QWebSettings.AutoLoadImages),
-##            "UserStyleSheet": "",
-##            "SaveUrlColor": QColor(248, 248, 210),
-##            "JavaEnabled":
-##            websettings.testAttribute(QWebSettings.JavaEnabled),
-##            "JavaScriptEnabled":
-##            websettings.testAttribute(QWebSettings.JavascriptEnabled),
-##            "JavaScriptCanOpenWindows":
-##            websettings.testAttribute(
-##                QWebSettings.JavascriptCanOpenWindows),
-##            "JavaScriptCanCloseWindows":
-##            websettings.testAttribute(
-##                QWebSettings.JavascriptCanCloseWindows),
-##            "JavaScriptCanAccessClipboard":
-##            websettings.testAttribute(
-##                QWebSettings.JavascriptCanAccessClipboard),
-##            "PluginsEnabled":
-##            websettings.testAttribute(QWebSettings.PluginsEnabled),
-##            "OfflineStorageDatabaseEnabled":
-##            websettings.testAttribute(
-##                QWebSettings.OfflineStorageDatabaseEnabled),
-##        })
-##        if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"):
-##            cls.helpDefaults.update({
-##                "OfflineWebApplicationCacheEnabled":
-##                websettings.testAttribute(
-##                    QWebSettings.OfflineWebApplicationCacheEnabled),
-##                "OfflineWebApplicationCacheQuota": 50,     # 50 MB
-##            })
-##        if hasattr(QWebSettings, "LocalStorageEnabled"):
-##            cls.helpDefaults["LocalStorageEnabled"] = \
-##                websettings.testAttribute(QWebSettings.LocalStorageEnabled)
-##        if hasattr(QWebSettings, "DnsPrefetchEnabled"):
-##            cls.helpDefaults["DnsPrefetchEnabled"] = \
-##                websettings.testAttribute(QWebSettings.DnsPrefetchEnabled)
-##        if hasattr(QWebSettings, "defaultTextEncoding"):
-##            cls.helpDefaults["DefaultTextEncoding"] = \
-##                websettings.defaultTextEncoding()
-##        if hasattr(QWebSettings, "SpatialNavigationEnabled"):
-##            cls.helpDefaults["SpatialNavigationEnabled"] = \
-##                websettings.testAttribute(
-##                    QWebSettings.SpatialNavigationEnabled)
-##        if hasattr(QWebSettings, "LinksIncludedInFocusChain"):
-##            cls.helpDefaults["LinksIncludedInFocusChain"] = \
-##                websettings.testAttribute(
-##                    QWebSettings.LinksIncludedInFocusChain)
-##        if hasattr(QWebSettings, "LocalContentCanAccessRemoteUrls"):
-##            cls.helpDefaults["LocalContentCanAccessRemoteUrls"] = \
-##                websettings.testAttribute(
-##                    QWebSettings.LocalContentCanAccessRemoteUrls)
-##        if hasattr(QWebSettings, "LocalContentCanAccessFileUrls"):
-##            cls.helpDefaults["LocalContentCanAccessFileUrls"] = \
-##                websettings.testAttribute(
-##                    QWebSettings.LocalContentCanAccessFileUrls)
-##        if hasattr(QWebSettings, "XSSAuditingEnabled"):
-##            cls.helpDefaults["XSSAuditingEnabled"] = \
-##                websettings.testAttribute(QWebSettings.XSSAuditingEnabled)
-##        if hasattr(QWebSettings, "SiteSpecificQuirksEnabled"):
-##            cls.helpDefaults["SiteSpecificQuirksEnabled"] = \
-##                websettings.testAttribute(
-##                    QWebSettings.SiteSpecificQuirksEnabled)
-##        
-##        cls.webSettingsIntitialized = True
-##    
-##    webSettingsIntitialized = False
     
     # defaults for the web browser settings
     webBrowserDefaults = {
@@ -1269,11 +1187,10 @@
 
     # defaults for Qt related stuff
     qtDefaults = {
-        "Qt4TranslationsDir": "",
         "Qt5TranslationsDir": "",
         "QtToolsDir": "",
-        "QtToolsPrefix4": "",
-        "QtToolsPostfix4": "",
+        "QtToolsPrefix": "",
+        "QtToolsPostfix": "",
         "PyuicIndent": 4,
         "PyuicFromImports": False,
         "PyQtToolsDir": "",
@@ -2664,7 +2581,7 @@
     Module function to retrieve the Qt5DocDir setting.
     
     @param prefClass preferences class used as the storage area
-    @return the requested Qt4DocDir setting (string)
+    @return the requested Qt5DocDir setting (string)
     """
     s = prefClass.settings.value(
         "Help/Qt5DocDir", prefClass.helpDefaults["Qt5DocDir"])
@@ -2955,27 +2872,19 @@
 
 def getQtTranslationsDir(prefClass=Prefs):
     """
-    Module function to retrieve the Qt4TranslationsDir or Qt5TranslationsDir
+    Module function to retrieve the Qt5TranslationsDir
     setting depending on the current Qt version.
     
     @param prefClass preferences class used as the storage area
     @return the requested setting (string)
     """
-    if Globals.qVersionTuple() < (5, 0, 0):
-        s = prefClass.settings.value(
-            "Qt/Qt4TranslationsDir",
-            prefClass.qtDefaults["Qt4TranslationsDir"])
-    else:
-        s = prefClass.settings.value(
-            "Qt/Qt5TranslationsDir",
-            prefClass.qtDefaults["Qt5TranslationsDir"])
+    s = prefClass.settings.value(
+        "Qt/Qt5TranslationsDir",
+        prefClass.qtDefaults["Qt5TranslationsDir"])
     if s == "":
         s = os.getenv("QTTRANSLATIONSDIR", "")
     if s == "":
-        if Globals.qVersionTuple() < (5, 0, 0):
-            s = os.getenv("QT4TRANSLATIONSDIR", "")
-        else:
-            s = os.getenv("QT5TRANSLATIONSDIR", "")
+        s = os.getenv("QT5TRANSLATIONSDIR", "")
     if s == "":
         s = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
     if s == "" and Globals.isWindowsPlatform():
@@ -2994,7 +2903,7 @@
     @param prefClass preferences class used as the storage area
     @return the requested Qt setting
     """
-    if key in ["Qt4TranslationsDir", "Qt5TranslationsDir"]:
+    if key in ["Qt5TranslationsDir"]:
         return getQtTranslationsDir(prefClass)
     elif key in ["PyuicIndent"]:
         return int(prefClass.settings.value(

eric ide

mercurial