Preferences/__init__.py

branch
QtWebEngine
changeset 4758
c973eef8fef1
parent 4753
8d2ea02ed785
child 4761
9d077d20be75
equal deleted inserted replaced
4754:1ff6d0ecb2fd 4758:c973eef8fef1
1023 "WebSearchSuggestions": True, 1023 "WebSearchSuggestions": True,
1024 "WebSearchEngine": "DuckDuckGo", 1024 "WebSearchEngine": "DuckDuckGo",
1025 "WebSearchKeywords": [], # array of two tuples (keyword, 1025 "WebSearchKeywords": [], # array of two tuples (keyword,
1026 # search engine name) 1026 # search engine name)
1027 "SearchLanguage": QLocale().language(), 1027 "SearchLanguage": QLocale().language(),
1028 "RssFeeds": [],
1028 # Flash Cookie Manager: identical to helpDefaults 1029 # Flash Cookie Manager: identical to helpDefaults
1029 # PIM: identical to helpDefaults 1030 # PIM: identical to helpDefaults
1030 # VirusTotal: identical to helpDefaults 1031 # VirusTotal: identical to helpDefaults
1031 } 1032 }
1032 1033
1052 cls.webBrowserDefaults["FixedFont"] = \ 1053 cls.webBrowserDefaults["FixedFont"] = \
1053 QFont(fontFamily, fontSize).toString() 1054 QFont(fontFamily, fontSize).toString()
1054 cls.webBrowserDefaults.update({ 1055 cls.webBrowserDefaults.update({
1055 "AutoLoadImages": webEngineSettings.testAttribute( 1056 "AutoLoadImages": webEngineSettings.testAttribute(
1056 QWebEngineSettings.AutoLoadImages), 1057 QWebEngineSettings.AutoLoadImages),
1057 "SaveUrlColor": QColor(248, 248, 210), 1058 "SaveUrlColor": QColor(184, 248, 169),
1058 ## "JavaEnabled": 1059 ## "JavaEnabled":
1059 ## websettings.testAttribute(QWebSettings.JavaEnabled), 1060 ## websettings.testAttribute(QWebSettings.JavaEnabled),
1060 "JavaScriptEnabled": webEngineSettings.testAttribute( 1061 "JavaScriptEnabled": webEngineSettings.testAttribute(
1061 QWebEngineSettings.JavascriptEnabled), 1062 QWebEngineSettings.JavascriptEnabled),
1062 "JavaScriptCanOpenWindows": webEngineSettings.testAttribute( 1063 "JavaScriptCanOpenWindows": webEngineSettings.testAttribute(
2693 ## if pageUrl is None: 2694 ## if pageUrl is None:
2694 ## pageUrl = QUrl() 2695 ## pageUrl = QUrl()
2695 ## downloads.append((url, location, done, pageUrl)) 2696 ## downloads.append((url, location, done, pageUrl))
2696 ## prefClass.settings.endArray() 2697 ## prefClass.settings.endArray()
2697 ## return downloads 2698 ## return downloads
2698 ## elif key == "RssFeeds": 2699 elif key == "RssFeeds":
2699 ## # return a list of tuples of (URL, title, icon) 2700 # return a list of tuples of (URL, title, icon)
2700 ## feeds = [] 2701 feeds = []
2701 ## length = prefClass.settings.beginReadArray("WebBrowser/" + key) 2702 length = prefClass.settings.beginReadArray("WebBrowser/" + key)
2702 ## for index in range(length): 2703 for index in range(length):
2703 ## prefClass.settings.setArrayIndex(index) 2704 prefClass.settings.setArrayIndex(index)
2704 ## url = prefClass.settings.value("URL") 2705 url = prefClass.settings.value("URL")
2705 ## title = prefClass.settings.value("Title") 2706 title = prefClass.settings.value("Title")
2706 ## icon = prefClass.settings.value("Icon") 2707 icon = prefClass.settings.value("Icon")
2707 ## feeds.append((url, title, icon)) 2708 feeds.append((url, title, icon))
2708 ## prefClass.settings.endArray() 2709 prefClass.settings.endArray()
2709 ## return feeds 2710 return feeds
2710 ## elif key in ["SyncFtpPassword", "SyncEncryptionKey"]: 2711 ## elif key in ["SyncFtpPassword", "SyncEncryptionKey"]:
2711 ## from Utilities.crypto import pwConvert 2712 ## from Utilities.crypto import pwConvert
2712 ## return pwConvert(prefClass.settings.value( 2713 ## return pwConvert(prefClass.settings.value(
2713 ## "WebBrowser/" + key, prefClass.helpDefaults[key]), encode=False) 2714 ## "WebBrowser/" + key, prefClass.helpDefaults[key]), encode=False)
2714 ## elif key == "HelpViewerType": 2715 ## elif key == "HelpViewerType":
2813 ## prefClass.settings.setValue("Location", v[1]) 2814 ## prefClass.settings.setValue("Location", v[1])
2814 ## prefClass.settings.setValue("Done", v[2]) 2815 ## prefClass.settings.setValue("Done", v[2])
2815 ## prefClass.settings.setValue("PageURL", v[3]) 2816 ## prefClass.settings.setValue("PageURL", v[3])
2816 ## index += 1 2817 ## index += 1
2817 ## prefClass.settings.endArray() 2818 ## prefClass.settings.endArray()
2818 ## elif key == "RssFeeds": 2819 elif key == "RssFeeds":
2819 ## # value is list of tuples of (URL, title, icon) 2820 # value is list of tuples of (URL, title, icon)
2820 ## prefClass.settings.remove("WebBrowser/" + key) 2821 prefClass.settings.remove("WebBrowser/" + key)
2821 ## prefClass.settings.beginWriteArray("Help/" + key, len(value)) 2822 prefClass.settings.beginWriteArray("Help/" + key, len(value))
2822 ## index = 0 2823 index = 0
2823 ## for v in value: 2824 for v in value:
2824 ## prefClass.settings.setArrayIndex(index) 2825 prefClass.settings.setArrayIndex(index)
2825 ## prefClass.settings.setValue("URL", v[0]) 2826 prefClass.settings.setValue("URL", v[0])
2826 ## prefClass.settings.setValue("Title", v[1]) 2827 prefClass.settings.setValue("Title", v[1])
2827 ## prefClass.settings.setValue("Icon", v[2]) 2828 prefClass.settings.setValue("Icon", v[2])
2828 ## index += 1 2829 index += 1
2829 ## prefClass.settings.endArray() 2830 prefClass.settings.endArray()
2830 ## elif key in ["SyncFtpPassword", "SyncEncryptionKey"]: 2831 ## elif key in ["SyncFtpPassword", "SyncEncryptionKey"]:
2831 ## from Utilities.crypto import pwConvert 2832 ## from Utilities.crypto import pwConvert
2832 ## prefClass.settings.setValue( 2833 ## prefClass.settings.setValue(
2833 ## "WebBrowser/" + key, pwConvert(value, encode=True)) 2834 ## "WebBrowser/" + key, pwConvert(value, encode=True))
2834 else: 2835 else:

eric ide

mercurial