Continued porting the web browser. QtWebEngine

Sat, 05 Mar 2016 14:34:49 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 05 Mar 2016 14:34:49 +0100
branch
QtWebEngine
changeset 4805
8ef007140046
parent 4804
f794ff054d8f
child 4806
5c0745cb26ea

Continued porting the web browser.

- modified the appearance config page
- added the web browser config page

E5Gui/E5ErrorMessage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationDialog.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/WebBrowserAppearancePage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/WebBrowserAppearancePage.ui file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/WebBrowserPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/WebBrowserPage.ui file | annotate | diff | comparison | revisions
Preferences/__init__.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
eric6.e4p file | annotate | diff | comparison | revisions
--- a/E5Gui/E5ErrorMessage.py	Fri Mar 04 20:15:34 2016 +0100
+++ b/E5Gui/E5ErrorMessage.py	Sat Mar 05 14:34:49 2016 +0100
@@ -44,7 +44,8 @@
             "QFont::",
             "QCocoaMenu::removeMenuItem",
             "QCocoaMenu::insertNative",
-            ",type id:"
+            ",type id:",
+            "Remote debugging server started successfully"
         ]
     
     def __filterMessage(self, message):
--- a/Preferences/ConfigurationDialog.py	Fri Mar 04 20:15:34 2016 +0100
+++ b/Preferences/ConfigurationDialog.py	Sat Mar 05 14:34:49 2016 +0100
@@ -421,6 +421,10 @@
                 "webBrowserAppearancePage":
                 [self.tr("Appearance"), "preferences-styles.png",
                  "WebBrowserAppearancePage", None, None],
+                "webBrowserPage":
+                [self.tr("eric6 Web Browser"), "ericWeb.png",
+                 "WebBrowserPage", None, None],
+                
                 "helpFlashCookieManagerPage":
                 [self.tr("Flash Cookie Manager"),
                  "flashCookie16.png",
--- a/Preferences/ConfigurationPages/WebBrowserAppearancePage.py	Fri Mar 04 20:15:34 2016 +0100
+++ b/Preferences/ConfigurationPages/WebBrowserAppearancePage.py	Sat Mar 05 14:34:49 2016 +0100
@@ -9,7 +9,7 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import pyqtSlot
+from PyQt5.QtGui import QFont
 from PyQt5.QtWidgets import QFontDialog
 
 from E5Gui.E5PathPicker import E5PathPickerModes
@@ -45,17 +45,33 @@
         self.__displayMode = None
         
         # set initial values
-        self.standardFont = Preferences.getWebBrowser("StandardFont")
-        self.standardFontSample.setFont(self.standardFont)
-        self.standardFontSample.setText(
-            "{0} {1}".format(self.standardFont.family(),
-                             self.standardFont.pointSize()))
+        defaultFontSize = Preferences.getWebBrowser("DefaultFontSize")
+        fixedFontSize = Preferences.getWebBrowser("DefaultFixedFontSize")
+        self.defaultSizeSpinBox.setValue(defaultFontSize)
+        self.fixedSizeSpinBox.setValue(fixedFontSize)
+        self.minSizeSpinBox.setValue(
+            Preferences.getWebBrowser("MinimumFontSize"))
+        self.minLogicalSizeSpinBox.setValue(
+            Preferences.getWebBrowser("MinimumLogicalFontSize"))
         
-        self.fixedFont = Preferences.getWebBrowser("FixedFont")
-        self.fixedFontSample.setFont(self.fixedFont)
-        self.fixedFontSample.setText(
-            "{0} {1}".format(self.fixedFont.family(),
-                             self.fixedFont.pointSize()))
+        self.standardFontCombo.setCurrentFont(
+            QFont(Preferences.getWebBrowser("StandardFontFamily"),
+                  defaultFontSize, QFont.Normal, False))
+        self.fixedFontCombo.setCurrentFont(
+            QFont(Preferences.getWebBrowser("FixedFontFamily"),
+                  fixedFontSize, QFont.Normal, False))
+        self.serifFontCombo.setCurrentFont(
+            QFont(Preferences.getWebBrowser("SerifFontFamily"),
+                  defaultFontSize, QFont.Normal, False))
+        self.sansSerifFontCombo.setCurrentFont(
+            QFont(Preferences.getWebBrowser("SansSerifFontFamily"),
+                  defaultFontSize, QFont.Normal, False))
+        self.cursiveFontCombo.setCurrentFont(
+            QFont(Preferences.getWebBrowser("CursiveFontFamily"),
+                  defaultFontSize, QFont.Normal, True))
+        self.fantasyFontCombo.setCurrentFont(
+            QFont(Preferences.getWebBrowser("FantasyFontFamily"),
+                  defaultFontSize, QFont.Normal, False))
         
         self.initColour("SaveUrlColor", self.secureURLsColourButton,
                         Preferences.getWebBrowser)
@@ -94,8 +110,37 @@
         """
         Public slot to save the Help Viewers configuration.
         """
-        Preferences.setWebBrowser("StandardFont", self.standardFont)
-        Preferences.setWebBrowser("FixedFont", self.fixedFont)
+        Preferences.setWebBrowser(
+            "StandardFontFamily",
+            self.standardFontCombo.currentFont().family())
+        Preferences.setWebBrowser(
+            "FixedFontFamily",
+            self.fixedFontCombo.currentFont().family())
+        Preferences.setWebBrowser(
+            "SerifFontFamily",
+            self.serifFontCombo.currentFont().family())
+        Preferences.setWebBrowser(
+            "SansSerifFontFamily",
+            self.sansSerifFontCombo.currentFont().family())
+        Preferences.setWebBrowser(
+            "CursiveFontFamily",
+            self.cursiveFontCombo.currentFont().family())
+        Preferences.setWebBrowser(
+            "FantasyFontFamily",
+            self.fantasyFontCombo.currentFont().family())
+        
+        Preferences.setWebBrowser(
+            "DefaultFontSize",
+            self.defaultSizeSpinBox.value())
+        Preferences.setWebBrowser(
+            "DefaultFixedFontSize",
+            self.fixedSizeSpinBox.value())
+        Preferences.setWebBrowser(
+            "MinimumFontSize",
+            self.minSizeSpinBox.value())
+        Preferences.setWebBrowser(
+            "MinimumLogicalFontSize",
+            self.minLogicalSizeSpinBox.value())
         
         Preferences.setWebBrowser(
             "AutoLoadImages",
@@ -117,23 +162,6 @@
             "WarnOnMultipleClose",
             self.warnOnMultipleCloseCheckBox.isChecked())
     
-    @pyqtSlot()
-    def on_standardFontButton_clicked(self):
-        """
-        Private method used to select the standard font.
-        """
-        self.standardFont = \
-            self.selectFont(self.standardFontSample, self.standardFont, True)
-    
-    @pyqtSlot()
-    def on_fixedFontButton_clicked(self):
-        """
-        Private method used to select the fixed-width font.
-        """
-        self.fixedFont = self.selectFont(
-            self.fixedFontSample, self.fixedFont, True,
-            options=MonospacedFontsOption)
-    
 
 def create(dlg):
     """
--- a/Preferences/ConfigurationPages/WebBrowserAppearancePage.ui	Fri Mar 04 20:15:34 2016 +0100
+++ b/Preferences/ConfigurationPages/WebBrowserAppearancePage.ui	Sat Mar 05 14:34:49 2016 +0100
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>499</width>
-    <height>547</height>
+    <height>782</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_3">
@@ -32,63 +32,224 @@
     </widget>
    </item>
    <item>
-    <widget class="QGroupBox" name="groupBox_5">
+    <widget class="QGroupBox" name="groupBox_4">
      <property name="title">
       <string>Fonts</string>
      </property>
-     <layout class="QGridLayout" name="gridLayout">
+     <layout class="QGridLayout" name="gridLayout_3">
       <item row="0" column="0">
-       <widget class="QPushButton" name="standardFontButton">
-        <property name="toolTip">
-         <string>Press to select the standard font</string>
-        </property>
+       <widget class="QLabel" name="label_2">
         <property name="text">
-         <string>Standard Font</string>
+         <string>Standard Font:</string>
         </property>
        </widget>
       </item>
       <item row="0" column="1">
-       <widget class="QLineEdit" name="standardFontSample">
-        <property name="focusPolicy">
-         <enum>Qt::NoFocus</enum>
+       <widget class="QFontComboBox" name="standardFontCombo">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
         </property>
-        <property name="text">
-         <string>Times 16</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignHCenter</set>
-        </property>
-        <property name="readOnly">
-         <bool>true</bool>
+        <property name="toolTip">
+         <string>Select the standard font</string>
         </property>
        </widget>
       </item>
       <item row="1" column="0">
-       <widget class="QPushButton" name="fixedFontButton">
-        <property name="toolTip">
-         <string>Press to select the fixed-width font</string>
-        </property>
+       <widget class="QLabel" name="label_3">
         <property name="text">
-         <string>Fixed-Width Font</string>
+         <string>Fixed Width Font</string>
         </property>
        </widget>
       </item>
       <item row="1" column="1">
-       <widget class="QLineEdit" name="fixedFontSample">
-        <property name="focusPolicy">
-         <enum>Qt::NoFocus</enum>
+       <widget class="QFontComboBox" name="fixedFontCombo">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select the fixed width font</string>
+        </property>
+        <property name="fontFilters">
+         <set>QFontComboBox::MonospacedFonts</set>
         </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_4">
+        <property name="text">
+         <string>Serif Font:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="QFontComboBox" name="serifFontCombo">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select the serif font</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="0">
+       <widget class="QLabel" name="label_5">
         <property name="text">
-         <string>Courier 13</string>
+         <string>Sans Serif Font:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="1">
+       <widget class="QFontComboBox" name="sansSerifFontCombo">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select the sans serif font</string>
         </property>
-        <property name="alignment">
-         <set>Qt::AlignHCenter</set>
+       </widget>
+      </item>
+      <item row="4" column="0">
+       <widget class="QLabel" name="label_6">
+        <property name="text">
+         <string>Cursive Font:</string>
         </property>
-        <property name="readOnly">
-         <bool>true</bool>
+       </widget>
+      </item>
+      <item row="4" column="1">
+       <widget class="QFontComboBox" name="cursiveFontCombo">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select the cursive font</string>
+        </property>
+       </widget>
+      </item>
+      <item row="5" column="0">
+       <widget class="QLabel" name="label_7">
+        <property name="text">
+         <string>Fantasy Font:</string>
         </property>
        </widget>
       </item>
+      <item row="5" column="1">
+       <widget class="QFontComboBox" name="fantasyFontCombo">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select the fantasy font</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_6">
+     <property name="title">
+      <string>Font Sizes</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_4">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_8">
+        <property name="text">
+         <string>Default Font Size:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QSpinBox" name="defaultSizeSpinBox">
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="minimum">
+         <number>1</number>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_9">
+        <property name="text">
+         <string>Fixed Font Size:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QSpinBox" name="fixedSizeSpinBox">
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="minimum">
+         <number>1</number>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_10">
+        <property name="text">
+         <string>Minimum Font Size:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="QSpinBox" name="minSizeSpinBox">
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="minimum">
+         <number>1</number>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="0">
+       <widget class="QLabel" name="label_11">
+        <property name="text">
+         <string>Minimum Logical Font Size:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="1">
+       <widget class="QSpinBox" name="minLogicalSizeSpinBox">
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="minimum">
+         <number>1</number>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="2">
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>230</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
      </layout>
     </widget>
    </item>
@@ -238,8 +399,6 @@
   </customwidget>
  </customwidgets>
  <tabstops>
-  <tabstop>standardFontButton</tabstop>
-  <tabstop>fixedFontButton</tabstop>
   <tabstop>secureURLsColourButton</tabstop>
   <tabstop>autoLoadImagesCheckBox</tabstop>
   <tabstop>styleSheetPicker</tabstop>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Preferences/ConfigurationPages/WebBrowserPage.py	Sat Mar 05 14:34:49 2016 +0100
@@ -0,0 +1,329 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2016 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing the  Web Browser configuration page.
+"""
+
+from PyQt5.QtCore import pyqtSlot, QLocale
+
+from .ConfigurationPageBase import ConfigurationPageBase
+from .Ui_WebBrowserPage import Ui_WebBrowserPage
+
+import Preferences
+import UI.PixmapCache
+
+
+class WebBrowserPage(ConfigurationPageBase, Ui_WebBrowserPage):
+    """
+    Class documentation goes here.
+    """
+    def __init__(self, configDialog):
+        """
+        Constructor
+        
+        @param configDialog reference to the configuration dialog
+            (ConfigurationDialog)
+        """
+        super(WebBrowserPage, self).__init__()
+        self.setupUi(self)
+        self.setObjectName("WebBrowserPage")
+        
+        self.__configDlg = configDialog
+        mw = configDialog.parent().parent()
+        if hasattr(mw, "helpWindow") and mw.helpWindow is not None:
+            # IDE
+            self.__browserWindow = mw.helpWindow
+        elif hasattr(mw, "currentBrowser"):
+            # Web Browser
+            self.__browserWindow = mw
+        else:
+            self.__browserWindow = None
+        self.setCurrentPageButton.setEnabled(self.__browserWindow is not None)
+        
+        defaultSchemes = ["file://", "http://", "https://"]
+        self.defaultSchemeCombo.addItems(defaultSchemes)
+        
+        # TODO: Click2Flash
+##        self.clickToFlashCheckBox.setIcon(
+##            UI.PixmapCache.getIcon("flashBlock.png"))
+        
+        # set initial values
+        self.singleHelpWindowCheckBox.setChecked(
+            Preferences.getWebBrowser("SingleWebBrowserWindow"))
+        self.saveGeometryCheckBox.setChecked(
+            Preferences.getWebBrowser("SaveGeometry"))
+        self.webSuggestionsCheckBox.setChecked(
+            Preferences.getWebBrowser("WebSearchSuggestions"))
+        self.showTabPreviews.setChecked(
+            Preferences.getWebBrowser("ShowPreview"))
+        self.errorPageCheckBox.setChecked(
+            Preferences.getWebBrowser("ErrorPageEnabled"))
+        self.scrollingCheckBox.setChecked(
+            Preferences.getWebBrowser("ScrollAnimatorEnabled"))
+        
+        self.javaScriptGroup.setChecked(
+            Preferences.getWebBrowser("JavaScriptEnabled"))
+        self.jsOpenWindowsCheckBox.setChecked(
+            Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
+        # TODO: Qt 5.6
+##        self.jsCloseWindowsCheckBox.setChecked(
+##            Preferences.getWebBrowser("JavaScriptCanCloseWindows"))
+        self.jsClipboardCheckBox.setChecked(
+            Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
+##        self.pluginsGroup.setChecked(
+##            Preferences.getWebBrowser("PluginsEnabled"))
+        # TODO: Click2Flash
+##        self.clickToFlashCheckBox.setChecked(
+##            Preferences.getWebBrowser("ClickToFlashEnabled"))
+        # TODO: Qt 5.6
+##        self.doNotTrackCheckBox.setChecked(
+##            Preferences.getWebBrowser("DoNotTrack"))
+##        self.sendRefererCheckBox.setChecked(
+##            Preferences.getWebBrowser("SendReferer"))
+        
+        # TODO: Cache
+##        self.diskCacheCheckBox.setChecked(
+##            Preferences.getWebBrowser("DiskCacheEnabled"))
+##        self.cacheSizeSpinBox.setValue(
+##            Preferences.getWebBrowser("DiskCacheSize"))
+        
+        self.startupCombo.setCurrentIndex(
+            Preferences.getWebBrowser("StartupBehavior"))
+        self.homePageEdit.setText(
+            Preferences.getWebBrowser("HomePage"))
+        
+        self.defaultSchemeCombo.setCurrentIndex(
+            self.defaultSchemeCombo.findText(
+                Preferences.getWebBrowser("DefaultScheme")))
+        
+        historyLimit = Preferences.getWebBrowser("HistoryLimit")
+        idx = 0
+        if historyLimit == 1:
+            idx = 0
+        elif historyLimit == 7:
+            idx = 1
+        elif historyLimit == 14:
+            idx = 2
+        elif historyLimit == 30:
+            idx = 3
+        elif historyLimit == 365:
+            idx = 4
+        elif historyLimit == -1:
+            idx = 5
+        elif historyLimit == -2:
+            idx = 6
+        else:
+            idx = 5
+        self.expireHistory.setCurrentIndex(idx)
+        
+        for language in range(2, QLocale.LastLanguage + 1):
+            countries = [l.country() for l in QLocale.matchingLocales(
+                language, QLocale.AnyScript, QLocale.AnyCountry)]
+            if len(countries) > 0:
+                self.languageCombo.addItem(
+                    QLocale.languageToString(language), language)
+        self.languageCombo.model().sort(0)
+        self.languageCombo.insertSeparator(0)
+        self.languageCombo.insertItem(0, QLocale.languageToString(0), 0)
+        index = self.languageCombo.findData(
+            Preferences.getWebBrowser("SearchLanguage"))
+        if index > -1:
+            self.languageCombo.setCurrentIndex(index)
+        
+        self.spatialCheckBox.setChecked(
+            Preferences.getWebBrowser("SpatialNavigationEnabled"))
+        self.linksInFocusChainCheckBox.setChecked(
+            Preferences.getWebBrowser("LinksIncludedInFocusChain"))
+        self.xssAuditingCheckBox.setChecked(
+            Preferences.getWebBrowser("XSSAuditingEnabled"))
+        
+        self.webInspectorGroup.setChecked(
+            Preferences.getWebBrowser("WebInspectorEnabled"))
+        self.webInspectorPortSpinBox.setValue(
+            Preferences.getWebBrowser("WebInspectorPort"))
+        
+        # TODO: Configuration: finish these with Qt 5.6
+        # Hide entries not yet supported
+        self.accessKeysCheckBox.hide()
+        self.jsCloseWindowsCheckBox.hide()
+        self.pluginsGroup.hide()
+        self.doNotTrackCheckBox.hide()
+        self.sendRefererCheckBox.hide()
+        self.refererWhitelistButton.hide()
+        self.noCacheHostsButton.hide()
+    
+    def save(self):
+        """
+        Public slot to save the Help Viewers configuration.
+        """
+        Preferences.setWebBrowser(
+            "SingleWebBrowserWindow",
+            self.singleHelpWindowCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "SaveGeometry",
+            self.saveGeometryCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "WebSearchSuggestions",
+            self.webSuggestionsCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "ShowPreview",
+            self.showTabPreviews.isChecked())
+        Preferences.setWebBrowser(
+            "ErrorPageEnabled",
+            self.errorPageCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "ScrollAnimatorEnabled",
+            self.scrollingCheckBox.isChecked())
+        
+        Preferences.setWebBrowser(
+            "JavaScriptEnabled",
+            self.javaScriptGroup.isChecked())
+        Preferences.setWebBrowser(
+            "JavaScriptCanOpenWindows",
+            self.jsOpenWindowsCheckBox.isChecked())
+        # TODO: Qt 5.6
+##        Preferences.setWebBrowser(
+##            "JavaScriptCanCloseWindows",
+##            self.jsCloseWindowsCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "JavaScriptCanAccessClipboard",
+            self.jsClipboardCheckBox.isChecked())
+        # TODO: Qt 5.6
+##        Preferences.setWebBrowser(
+##            "PluginsEnabled",
+##            self.pluginsGroup.isChecked())
+        # TODO: Click2Flash
+##        Preferences.setWebBrowser(
+##            "ClickToFlashEnabled",
+##            self.clickToFlashCheckBox.isChecked())
+        # TODO: Qt 5.6
+##        Preferences.setWebBrowser(
+##            "DoNotTrack",
+##            self.doNotTrackCheckBox.isChecked())
+##        Preferences.setWebBrowser(
+##            "SendReferer",
+##            self.sendRefererCheckBox.isChecked())
+        
+        # TODO: Cache
+##        Preferences.setWebBrowser(
+##            "DiskCacheEnabled",
+##            self.diskCacheCheckBox.isChecked())
+##        Preferences.setWebBrowser(
+##            "DiskCacheSize",
+##            self.cacheSizeSpinBox.value())
+        
+        Preferences.setWebBrowser(
+            "StartupBehavior",
+            self.startupCombo.currentIndex())
+        Preferences.setWebBrowser(
+            "HomePage",
+            self.homePageEdit.text())
+        
+        Preferences.setWebBrowser(
+            "DefaultScheme",
+            self.defaultSchemeCombo.currentText())
+        
+        idx = self.expireHistory.currentIndex()
+        if idx == 0:
+            historyLimit = 1
+        elif idx == 1:
+            historyLimit = 7
+        elif idx == 2:
+            historyLimit = 14
+        elif idx == 3:
+            historyLimit = 30
+        elif idx == 4:
+            historyLimit = 365
+        elif idx == 5:
+            historyLimit = -1
+        elif idx == 6:
+            historyLimit = -2
+        Preferences.setWebBrowser("HistoryLimit", historyLimit)
+        
+        languageIndex = self.languageCombo.currentIndex()
+        if languageIndex > -1:
+            language = self.languageCombo.itemData(languageIndex)
+        else:
+            # fall back to system default
+            language = QLocale.system().language()
+        Preferences.setWebBrowser("SearchLanguage", language)
+        
+        Preferences.setWebBrowser(
+            "SpatialNavigationEnabled",
+            self.spatialCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "LinksIncludedInFocusChain",
+            self.linksInFocusChainCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "XSSAuditingEnabled",
+            self.xssAuditingCheckBox.isChecked())
+        
+        Preferences.setWebBrowser(
+            "WebInspectorEnabled",
+            self.webInspectorGroup.isChecked())
+        Preferences.setWebBrowser(
+            "WebInspectorPort",
+            self.webInspectorPortSpinBox.value())
+    
+    @pyqtSlot()
+    def on_setCurrentPageButton_clicked(self):
+        """
+        Private slot to set the current page as the home page.
+        """
+        url = self.__browserWindow.currentBrowser().url()
+        self.homePageEdit.setText(bytes(url.toEncoded()).decode())
+    
+    @pyqtSlot()
+    def on_defaultHomeButton_clicked(self):
+        """
+        Private slot to set the default home page.
+        """
+        self.homePageEdit.setText(Preferences.Prefs.helpDefaults["HomePage"])
+    
+    @pyqtSlot(int)
+    def on_startupCombo_currentIndexChanged(self, index):
+        """
+        Private slot to enable elements depending on the selected startup
+        entry.
+        
+        @param index index of the selected entry (integer)
+        """
+        enable = index == 0
+        self.homePageLabel.setEnabled(enable)
+        self.homePageEdit.setEnabled(enable)
+        self.defaultHomeButton.setEnabled(enable)
+        self.setCurrentPageButton.setEnabled(enable)
+    
+    # TODO: Referer
+##    @pyqtSlot()
+##    def on_refererWhitelistButton_clicked(self):
+##        """
+##        Private slot to edit the referer whitelist.
+##        """
+##        from Helpviewer.Network.SendRefererWhitelistDialog import \
+##            SendRefererWhitelistDialog
+##        SendRefererWhitelistDialog(self).exec_()
+    
+    # TODO: Cache
+##    @pyqtSlot()
+##    def on_noCacheHostsButton_clicked(self):
+##        """
+##        Private slot to edit the list of hosts exempted from caching.
+##        """
+##        from Helpviewer.Network.NoCacheHostsDialog import \
+##            NoCacheHostsDialog
+##        NoCacheHostsDialog(self).exec_()
+
+
+def create(dlg):
+    """
+    Module function to create the configuration page.
+    
+    @param dlg reference to the configuration dialog
+    @return reference to the instantiated page (ConfigurationPageBase)
+    """
+    page = WebBrowserPage(dlg)
+    return page
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Preferences/ConfigurationPages/WebBrowserPage.ui	Sat Mar 05 14:34:49 2016 +0100
@@ -0,0 +1,737 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WebBrowserPage</class>
+ <widget class="QWidget" name="WebBrowserPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>616</width>
+    <height>1329</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QLabel" name="headerLabel">
+     <property name="text">
+      <string>&lt;b&gt;Configure Web Browser&lt;/b&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="Line" name="line17">
+     <property name="frameShape">
+      <enum>QFrame::HLine</enum>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Sunken</enum>
+     </property>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_4">
+     <property name="title">
+      <string>General</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_5">
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="singleHelpWindowCheckBox">
+        <property name="toolTip">
+         <string>Select to use a single web browser window only</string>
+        </property>
+        <property name="text">
+         <string>Use single web browser window</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QCheckBox" name="webSuggestionsCheckBox">
+        <property name="toolTip">
+         <string>Select to enable suggestions for web searches</string>
+        </property>
+        <property name="text">
+         <string>Show suggestions for web searches</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QCheckBox" name="saveGeometryCheckBox">
+        <property name="toolTip">
+         <string>Select to save the window size and position</string>
+        </property>
+        <property name="text">
+         <string>Save size and position upon exit</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QCheckBox" name="showTabPreviews">
+        <property name="toolTip">
+         <string>Select to show a page preview when the mouse hovers over the tab</string>
+        </property>
+        <property name="text">
+         <string>Show preview when hovering tab</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QCheckBox" name="errorPageCheckBox">
+        <property name="toolTip">
+         <string>Select to enable displaying the built-in Chromium error pages.</string>
+        </property>
+        <property name="text">
+         <string>Use built-in Chromium error page</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="QCheckBox" name="scrollingCheckBox">
+        <property name="toolTip">
+         <string>Select to activate animated scrolling</string>
+        </property>
+        <property name="text">
+         <string>Enable animated scrolling</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="startupGroupBox">
+     <property name="title">
+      <string>Startup</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_3">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>On startup:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1" colspan="3">
+       <widget class="QComboBox" name="startupCombo">
+        <property name="toolTip">
+         <string>Select the startup behavior</string>
+        </property>
+        <item>
+         <property name="text">
+          <string>Show Home Page</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Show Speed Dial</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Show Empty Page</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="homePageLabel">
+        <property name="text">
+         <string>Home Page:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" colspan="3">
+       <widget class="QLineEdit" name="homePageEdit">
+        <property name="toolTip">
+         <string>Enter the desired home page</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="QPushButton" name="setCurrentPageButton">
+        <property name="toolTip">
+         <string>Press to set the current page as the home page</string>
+        </property>
+        <property name="text">
+         <string>Set to current page</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="2">
+       <widget class="QPushButton" name="defaultHomeButton">
+        <property name="toolTip">
+         <string>Press to set the default home page</string>
+        </property>
+        <property name="text">
+         <string>Set to default home page</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="3">
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>160</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Scheme</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_4">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>Default Scheme:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QComboBox" name="defaultSchemeCombo">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select the default scheme</string>
+        </property>
+        <property name="whatsThis">
+         <string>&lt;b&gt;Default Scheme&lt;/b&gt;&lt;p&gt;Select the default scheme. This scheme is prepended to URLs, that don't contain one.&lt;/p&gt;</string>
+        </property>
+        <property name="editable">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="privacyGroup">
+     <property name="title">
+      <string>Privacy</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_4">
+      <item>
+       <widget class="QGroupBox" name="javaScriptGroup">
+        <property name="toolTip">
+         <string>Select to enable JavaScript</string>
+        </property>
+        <property name="title">
+         <string>Enable JavaScript</string>
+        </property>
+        <property name="checkable">
+         <bool>true</bool>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+        <layout class="QGridLayout" name="gridLayout">
+         <item row="0" column="0">
+          <widget class="QCheckBox" name="jsOpenWindowsCheckBox">
+           <property name="toolTip">
+            <string>Select to allow JavaScript to open windows</string>
+           </property>
+           <property name="text">
+            <string>JavaScript can open windows</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QCheckBox" name="jsCloseWindowsCheckBox">
+           <property name="toolTip">
+            <string>Select to allow JavaScript to close windows</string>
+           </property>
+           <property name="text">
+            <string>JavaScript can close windows</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QCheckBox" name="jsClipboardCheckBox">
+           <property name="toolTip">
+            <string>Select to allow JavaScript to access the clipboard</string>
+           </property>
+           <property name="text">
+            <string>JavaScript can access clipboard</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QGroupBox" name="pluginsGroup">
+        <property name="toolTip">
+         <string>Select to enable plugins in web pages</string>
+        </property>
+        <property name="title">
+         <string>Enable Plug-ins</string>
+        </property>
+        <property name="checkable">
+         <bool>true</bool>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+        <layout class="QGridLayout" name="gridLayout_7">
+         <item row="0" column="0">
+          <widget class="QCheckBox" name="clickToFlashCheckBox">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+             <horstretch>8</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="toolTip">
+            <string>Select to activate the Flash blocker</string>
+           </property>
+           <property name="text">
+            <string>Use ClickToFlash on Flash plugins</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="Line" name="line">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="doNotTrackCheckBox">
+        <property name="toolTip">
+         <string>Select to enabled the &quot;Do Not Track&quot; feature</string>
+        </property>
+        <property name="text">
+         <string>Tell web sites I do not want to be tracked</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_4">
+        <item>
+         <widget class="QCheckBox" name="sendRefererCheckBox">
+          <property name="toolTip">
+           <string>Select to send referer headers to the server</string>
+          </property>
+          <property name="text">
+           <string>Send Referer header to servers</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_6">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QPushButton" name="refererWhitelistButton">
+          <property name="toolTip">
+           <string>Press to edit the list of whitelisted hosts</string>
+          </property>
+          <property name="text">
+           <string>Edit Referer Whitelist ...</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_6">
+     <property name="title">
+      <string>Security</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <widget class="QCheckBox" name="xssAuditingCheckBox">
+        <property name="toolTip">
+         <string>Select to enable XSS auditing</string>
+        </property>
+        <property name="whatsThis">
+         <string>&lt;b&gt;Enable XSS Auditing&lt;/b&gt;
+&lt;p&gt;This selects whether load requests should be monitored for cross-site scripting attempts. Suspicious scripts will be blocked. These will be reported in the JavaScript console. Enabling this feature might have an impact on performance.&lt;/p&gt;</string>
+        </property>
+        <property name="text">
+         <string>Enable XSS Auditing</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>History</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QLabel" name="label_4">
+        <property name="text">
+         <string>Remove history items:</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="expireHistory">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select the period for expiration of history entries</string>
+        </property>
+        <item>
+         <property name="text">
+          <string>After one day</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>After one week</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>After two weeks</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>After one month</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>After one year</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Manually</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>On application exit</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="cacheGroup">
+     <property name="title">
+      <string>Browser Cache</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="0" column="0" colspan="3">
+       <layout class="QHBoxLayout" name="horizontalLayout_5">
+        <item>
+         <widget class="QCheckBox" name="diskCacheCheckBox">
+          <property name="text">
+           <string>Enable disk cache</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_7">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QPushButton" name="noCacheHostsButton">
+          <property name="toolTip">
+           <string>Press to edit the list of hosts exempted from caching</string>
+          </property>
+          <property name="text">
+           <string>Edit Exempted Hosts ...</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_7">
+        <property name="text">
+         <string>Cache size:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QSpinBox" name="cacheSizeSpinBox">
+        <property name="toolTip">
+         <string>Enter the maximum size of the disk cache</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="suffix">
+         <string> MB</string>
+        </property>
+        <property name="minimum">
+         <number>1</number>
+        </property>
+        <property name="maximum">
+         <number>999</number>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="2">
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>410</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_5">
+     <property name="title">
+      <string>Web Search</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <item>
+       <widget class="QLabel" name="label_5">
+        <property name="text">
+         <string>Language:</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="languageCombo">
+        <property name="toolTip">
+         <string>Select the language to be used for web searches</string>
+        </property>
+        <property name="sizeAdjustPolicy">
+         <enum>QComboBox::AdjustToContents</enum>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_3">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>450</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>Navigation</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_6">
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="spatialCheckBox">
+        <property name="toolTip">
+         <string>Select to enable the spatial navigation feature</string>
+        </property>
+        <property name="whatsThis">
+         <string>&lt;b&gt;Enable Spatial Navigation&lt;/b&gt;
+&lt;p&gt;This enables or disables the Spatial Navigation feature, which consists in the ability to navigate between focusable elements in a Web page, such as hyperlinks and form controls, by using Left, Right, Up and Down arrow keys. For example, if a user presses the Right key, heuristics determine whether there is an element he might be trying to reach towards the right and which element he probably wants.&lt;/p&gt;</string>
+        </property>
+        <property name="text">
+         <string>Enable Spatial Navigation</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QCheckBox" name="linksInFocusChainCheckBox">
+        <property name="toolTip">
+         <string>Select to include links in focus chain</string>
+        </property>
+        <property name="whatsThis">
+         <string>&lt;b&gt;Include Links in Focus Chain&lt;/b&gt;
+&lt;p&gt;This selects whether hyperlinks should be included in the keyboard focus chain.&lt;/p&gt;</string>
+        </property>
+        <property name="text">
+         <string>Include Links in Focus Chain</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QCheckBox" name="accessKeysCheckBox">
+        <property name="toolTip">
+         <string>Select to enable support for access keys</string>
+        </property>
+        <property name="text">
+         <string>Enable access keys</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="webInspectorGroup">
+     <property name="toolTip">
+      <string>Select to enable the Web Inspector tool</string>
+     </property>
+     <property name="title">
+      <string>Enable Web Development (Web Inspector)</string>
+     </property>
+     <property name="checkable">
+      <bool>true</bool>
+     </property>
+     <property name="checked">
+      <bool>false</bool>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_8">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_2">
+        <property name="text">
+         <string>Web Inspector Port:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QSpinBox" name="webInspectorPortSpinBox">
+        <property name="toolTip">
+         <string>Enter the port to be used by the web inspector</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="minimum">
+         <number>1025</number>
+        </property>
+        <property name="maximum">
+         <number>65535</number>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <spacer name="horizontalSpacer_4">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>372</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="1" column="0" colspan="3">
+       <widget class="QLabel" name="label_6">
+        <property name="text">
+         <string>&lt;font color=&quot;red&quot;&gt;&lt;b&gt;Note:&lt;/b&gt; Web Inspector settings are activated after a restart of the application.&lt;/font&gt;</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>479</width>
+       <height>121</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <tabstops>
+  <tabstop>singleHelpWindowCheckBox</tabstop>
+  <tabstop>webSuggestionsCheckBox</tabstop>
+  <tabstop>saveGeometryCheckBox</tabstop>
+  <tabstop>showTabPreviews</tabstop>
+  <tabstop>errorPageCheckBox</tabstop>
+  <tabstop>scrollingCheckBox</tabstop>
+  <tabstop>startupCombo</tabstop>
+  <tabstop>homePageEdit</tabstop>
+  <tabstop>setCurrentPageButton</tabstop>
+  <tabstop>defaultHomeButton</tabstop>
+  <tabstop>defaultSchemeCombo</tabstop>
+  <tabstop>javaScriptGroup</tabstop>
+  <tabstop>jsOpenWindowsCheckBox</tabstop>
+  <tabstop>jsCloseWindowsCheckBox</tabstop>
+  <tabstop>jsClipboardCheckBox</tabstop>
+  <tabstop>pluginsGroup</tabstop>
+  <tabstop>clickToFlashCheckBox</tabstop>
+  <tabstop>doNotTrackCheckBox</tabstop>
+  <tabstop>sendRefererCheckBox</tabstop>
+  <tabstop>refererWhitelistButton</tabstop>
+  <tabstop>xssAuditingCheckBox</tabstop>
+  <tabstop>expireHistory</tabstop>
+  <tabstop>diskCacheCheckBox</tabstop>
+  <tabstop>noCacheHostsButton</tabstop>
+  <tabstop>cacheSizeSpinBox</tabstop>
+  <tabstop>languageCombo</tabstop>
+  <tabstop>spatialCheckBox</tabstop>
+  <tabstop>linksInFocusChainCheckBox</tabstop>
+  <tabstop>accessKeysCheckBox</tabstop>
+  <tabstop>webInspectorGroup</tabstop>
+  <tabstop>webInspectorPortSpinBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
--- a/Preferences/__init__.py	Fri Mar 04 20:15:34 2016 +0100
+++ b/Preferences/__init__.py	Sat Mar 05 14:34:49 2016 +0100
@@ -1070,24 +1070,43 @@
             return
         
         webEngineSettings = QWebEngineSettings.globalSettings()
-        fontFamily = webEngineSettings.fontFamily(
-            QWebEngineSettings.StandardFont)
-        fontSize = webEngineSettings.fontSize(
-            QWebEngineSettings.DefaultFontSize)
-        cls.webBrowserDefaults["StandardFont"] = \
-            QFont(fontFamily, fontSize).toString()
-        fontFamily = webEngineSettings.fontFamily(
-            QWebEngineSettings.FixedFont)
-        fontSize = webEngineSettings.fontSize(
-            QWebEngineSettings.DefaultFixedFontSize)
-        cls.webBrowserDefaults["FixedFont"] = \
-            QFont(fontFamily, fontSize).toString()
+##        fontFamily = webEngineSettings.fontFamily(
+##            QWebEngineSettings.StandardFont)
+##        fontSize = webEngineSettings.fontSize(
+##            QWebEngineSettings.DefaultFontSize)
+##        cls.webBrowserDefaults["StandardFont"] = \
+##            QFont(fontFamily, fontSize).toString()
+##        fontFamily = webEngineSettings.fontFamily(
+##            QWebEngineSettings.FixedFont)
+##        fontSize = webEngineSettings.fontSize(
+##            QWebEngineSettings.DefaultFixedFontSize)
+##        cls.webBrowserDefaults["FixedFont"] = \
+##            QFont(fontFamily, fontSize).toString()
         cls.webBrowserDefaults.update({
+            "StandardFontFamily": webEngineSettings.fontFamily(
+                QWebEngineSettings.StandardFont),
+            "FixedFontFamily": webEngineSettings.fontFamily(
+                QWebEngineSettings.FixedFont),
+            "SerifFontFamily": webEngineSettings.fontFamily(
+                QWebEngineSettings.StandardFont),
+            "SansSerifFontFamily": webEngineSettings.fontFamily(
+                QWebEngineSettings.SansSerifFont),
+            "CursiveFontFamily": webEngineSettings.fontFamily(
+                QWebEngineSettings.CursiveFont),
+            "FantasyFontFamily": webEngineSettings.fontFamily(
+                QWebEngineSettings.FantasyFont),
+            "DefaultFontSize": webEngineSettings.fontSize(
+                QWebEngineSettings.DefaultFontSize),
+            "DefaultFixedFontSize": webEngineSettings.fontSize(
+                QWebEngineSettings.DefaultFixedFontSize),
+            "MinimumFontSize": webEngineSettings.fontSize(
+                QWebEngineSettings.MinimumFontSize),
+            "MinimumLogicalFontSize": webEngineSettings.fontSize(
+                QWebEngineSettings.MinimumLogicalFontSize),
+            
             "AutoLoadImages": webEngineSettings.testAttribute(
                 QWebEngineSettings.AutoLoadImages),
             "SaveUrlColor": QColor(184, 248, 169),
-##            "JavaEnabled":
-##            websettings.testAttribute(QWebSettings.JavaEnabled),
             "JavaScriptEnabled": webEngineSettings.testAttribute(
                 QWebEngineSettings.JavascriptEnabled),
             "JavaScriptCanOpenWindows": webEngineSettings.testAttribute(
@@ -1118,10 +1137,6 @@
                 QWebEngineSettings.ScrollAnimatorEnabled),
             "ErrorPageEnabled": webEngineSettings.testAttribute(
                 QWebEngineSettings.ErrorPageEnabled),
-            "MinimumFontSize": webEngineSettings.fontSize(
-                QWebEngineSettings.MinimumFontSize),
-            "MinimumLogicalFontSize": webEngineSettings.fontSize(
-                QWebEngineSettings.MinimumLogicalFontSize),
         })
         
         cls.webEngineSettingsIntitialized = True
@@ -2766,11 +2781,13 @@
 ##                 "OfflineWebApplicationCacheQuota", "CachePolicy",
 ##                 "AdBlockUpdatePeriod",
 ##                  ]:
-    elif key in ["StartupBehavior", "MinimumFontSize",
-                 "MinimumLogicalFontSize", "HistoryLimit",
+    elif key in ["StartupBehavior", "HistoryLimit",
                  "DownloadManagerRemovePolicy","SyncType", "SyncFtpPort",
                  "SyncFtpIdleTimeout", "SyncEncryptionKeyLength",
-                 "SearchLanguage", "WebInspectorPort"]:
+                 "SearchLanguage", "WebInspectorPort",
+                 "DefaultFontSize", "DefaultFixedFontSize",
+                 "MinimumFontSize", "MinimumLogicalFontSize",
+                 ]:
         return int(prefClass.settings.value(
             "WebBrowser/" + key, prefClass.webBrowserDefaults[key]))
 ##    elif key in ["DiskCacheEnabled", "FilterTrackingCookies",
@@ -2785,7 +2802,7 @@
 ##                 "SiteSpecificQuirksEnabled",
 ##                 "ClickToFlashEnabled",
 ##                 ]:
-    elif key in ["SingleHelpWindow", "SaveGeometry", "JavaScriptEnabled",
+    elif key in ["SingleWebBrowserWindow", "SaveGeometry", "JavaScriptEnabled",
                  "JavaScriptCanOpenWindows", "JavaScriptCanAccessClipboard",
                  "AutoLoadImages", "LocalStorageEnabled",
                  "SpatialNavigationEnabled", "LinksIncludedInFocusChain",
--- a/WebBrowser/WebBrowserWindow.py	Fri Mar 04 20:15:34 2016 +0100
+++ b/WebBrowser/WebBrowserWindow.py	Sat Mar 05 14:34:49 2016 +0100
@@ -72,7 +72,6 @@
     @signal zoomTextOnlyChanged(bool) emitted after the zoom text only setting
         was changed
     """
-##    zoomTextOnlyChanged = pyqtSignal(bool)
     webBrowserClosed = pyqtSignal()
     
     BrowserWindows = []
@@ -379,21 +378,33 @@
         """
         Private method to set the global web settings.
         """
-        standardFont = Preferences.getWebBrowser("StandardFont")
-        fixedFont = Preferences.getWebBrowser("FixedFont")
-        # TODO: Fonts: add support for other font types
-
         settings = QWebEngineSettings.globalSettings()
-##        settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
-        
-        settings.setFontFamily(QWebEngineSettings.StandardFont,
-                               standardFont.family())
-        settings.setFontSize(QWebEngineSettings.DefaultFontSize,
-                             standardFont.pointSize())
-        settings.setFontFamily(QWebEngineSettings.FixedFont,
-                               fixedFont.family())
-        settings.setFontSize(QWebEngineSettings.DefaultFixedFontSize,
-                             fixedFont.pointSize())
+        
+        settings.setFontFamily(
+            QWebEngineSettings.StandardFont,
+            Preferences.getWebBrowser("StandardFontFamily"))
+        settings.setFontFamily(
+            QWebEngineSettings.FixedFont,
+            Preferences.getWebBrowser("FixedFontFamily"))
+        settings.setFontFamily(
+            QWebEngineSettings.SerifFont,
+            Preferences.getWebBrowser("SerifFontFamily"))
+        settings.setFontFamily(
+            QWebEngineSettings.SansSerifFont,
+            Preferences.getWebBrowser("SansSerifFontFamily"))
+        settings.setFontFamily(
+            QWebEngineSettings.CursiveFont,
+            Preferences.getWebBrowser("CursiveFontFamily"))
+        settings.setFontFamily(
+            QWebEngineSettings.FantasyFont,
+            Preferences.getWebBrowser("FantasyFontFamily"))
+        
+        settings.setFontSize(
+            QWebEngineSettings.DefaultFontSize,
+            Preferences.getWebBrowser("DefaultFontSize"))
+        settings.setFontSize(
+            QWebEngineSettings.DefaultFixedFontSize,
+            Preferences.getWebBrowser("DefaultFixedFontSize"))
         settings.setFontSize(
             QWebEngineSettings.MinimumFontSize,
             Preferences.getWebBrowser("MinimumFontSize"))
@@ -407,6 +418,7 @@
         settings.setAttribute(
             QWebEngineSettings.AutoLoadImages,
             Preferences.getWebBrowser("AutoLoadImages"))
+        # TODO: Qt 5.6
 ##        settings.setAttribute(
 ##            QWebSettings.JavaEnabled,
 ##            Preferences.getWebBrowser("JavaEnabled"))
@@ -419,6 +431,7 @@
         settings.setAttribute(
             QWebEngineSettings.JavascriptCanAccessClipboard,
             Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
+        # TODO: Qt 5.6
 ##        settings.setAttribute(
 ##            QWebSettings.PluginsEnabled,
 ##            Preferences.getWebBrowser("PluginsEnabled"))
@@ -490,10 +503,6 @@
         settings.setAttribute(
             QWebEngineSettings.XSSAuditingEnabled,
             Preferences.getWebBrowser("XSSAuditingEnabled"))
-##        if hasattr(QWebSettings, "SiteSpecificQuirksEnabled"):
-##            settings.setAttribute(
-##                QWebSettings.SiteSpecificQuirksEnabled,
-##                Preferences.getWebBrowser("SiteSpecificQuirksEnabled"))
 ##        
 ##        QWebSecurityOrigin.addLocalScheme("eric")
         settings.setAttribute(
@@ -1154,25 +1163,6 @@
             self.zoomResetAct.triggered.connect(self.__zoomReset)
         self.__actions.append(self.zoomResetAct)
         
-##        if hasattr(QWebSettings, 'ZoomTextOnly'):
-##            self.zoomTextOnlyAct = E5Action(
-##                self.tr('Zoom text only'),
-##                self.tr('Zoom &text only'),
-##                0, 0, self, 'webbrowser_view_zoom_text_only')
-##            self.zoomTextOnlyAct.setCheckable(True)
-##            self.zoomTextOnlyAct.setStatusTip(self.tr(
-##                'Zoom text only; pictures remain constant'))
-##            self.zoomTextOnlyAct.setWhatsThis(self.tr(
-##                """<b>Zoom text only</b>"""
-##                """<p>Zoom text only; pictures remain constant.</p>"""
-##            ))
-##            if not self.__initShortcutsOnly:
-##                self.zoomTextOnlyAct.triggered[bool].connect(
-##                    self.__zoomTextOnly)
-##            self.__actions.append(self.zoomTextOnlyAct)
-##        else:
-##            self.zoomTextOnlyAct = None
-        
         self.pageSourceAct = E5Action(
             self.tr('Show page source'),
             self.tr('Show page source'),
@@ -1792,8 +1782,6 @@
         menu.addAction(self.zoomInAct)
         menu.addAction(self.zoomResetAct)
         menu.addAction(self.zoomOutAct)
-##        if self.zoomTextOnlyAct is not None:
-##            menu.addAction(self.zoomTextOnlyAct)
         menu.addSeparator()
         menu.addAction(self.pageSourceAct)
         menu.addAction(self.fullScreenAct)
@@ -1893,6 +1881,7 @@
         menu.addAction(self.siteInfoAct)
         menu.addSeparator()
         menu.addAction(self.synchronizationAct)
+        # TODO: Network Monitor
 ##        menu.addSeparator()
 ##        menu.addAction(self.toolsMonitorAct)
         
@@ -2483,8 +2472,10 @@
         
         self.downloadManager().shutdown()
         
+        # TODO: Network Monitor
 ##        self.__closeNetworkMonitor()
 ##        
+        # TODO: Cookies
 ##        self.cookieJar().close()
 ##        
         self.bookmarksToolBar.setModel(None)
@@ -2494,10 +2485,13 @@
         
         self.passwordManager().close()
         
+        # TODO: AdBlock
 ##        self.adBlockManager().close()
 ##        
+        # TODO: UserAgents
 ##        self.userAgentsManager().close()
 ##        
+        # TODO: SpeedDial
 ##        self.speedDial().close()
         
         self.syncManager().close()
@@ -2569,7 +2563,6 @@
         """
         Private slot called to handle the reload action.
         """
-##        self.currentBrowser().reload()
         self.currentBrowser().reloadBypassingCache()
     
     def __stopLoading(self):
@@ -2607,16 +2600,6 @@
         self.currentBrowser().zoomReset()
         self.__zoomWidget.setValue(self.currentBrowser().zoomValue())
     
-##    def __zoomTextOnly(self, textOnly):
-##        """
-##        Private slot called to handle the zoom text only action.
-##        
-##        @param textOnly flag indicating to zoom text only (boolean)
-##        """
-##        QWebSettings.globalSettings().setAttribute(
-##            QWebSettings.ZoomTextOnly, textOnly)
-##        self.zoomTextOnlyChanged.emit(textOnly)
-##    
     def __viewFullScreen(self):
         """
         Private slot called to toggle fullscreen mode.
@@ -2771,6 +2754,10 @@
         
         self.searchEdit.preferencesChanged()
         
+        if not self.isPrivate():
+            # TODO: Cache settings
+            pass
+            
         self.__virusTotal.preferencesChanged()
         if not Preferences.getWebBrowser("VirusTotalEnabled") or \
            Preferences.getWebBrowser("VirusTotalServiceKey") == "":
@@ -2805,6 +2792,7 @@
         dlg.exec_()
         self.networkManager().languagesChanged()
     
+    # TODO: Cookies
 ##    def __showCookiesConfiguration(self):
 ##        """
 ##        Private slot to configure the cookies handling.
@@ -2872,7 +2860,8 @@
             cls._networkManager = NetworkManager()
         
         return cls._networkManager
-        
+    
+    # TODO: Cookies
 ##    @classmethod
 ##    def cookieJar(cls):
 ##        """
@@ -2899,10 +2888,6 @@
         """
         if not self.__activating:
             self.__activating = True
-##            req = QNetworkRequest(url)
-##            req.setRawHeader(b"X-Eric6-UserLoadAction", b"1")
-##            self.currentBrowser().setSource(
-##                None, (req, QNetworkAccessManager.GetOperation, b""))
             self.currentBrowser().setUrl(url)
             self.__activating = False
         
@@ -3039,7 +3024,8 @@
         @return dictionary with tab id as key and host/namespace as value
         """
         return self.__tabWidget.getSourceFileList()
-        
+    
+    # TODO: QtHelp
 ##    def __manageQtHelpFilters(self):
 ##        """
 ##        Private slot to manage the QtHelp filters.
@@ -3319,7 +3305,8 @@
         
         dlg = PasswordsDialog(self)
         dlg.exec_()
-        
+    
+    # TODO: Certificates
 ##    def __showCertificatesDialog(self):
 ##        """
 ##        Private slot to show the certificates management dialog.
@@ -3329,12 +3316,14 @@
 ##        dlg = E5SslCertificatesDialog(self)
 ##        dlg.exec_()
 ##        
+    # TODO: AdBlock
 ##    def __showAdBlockDialog(self):
 ##        """
 ##        Private slot to show the AdBlock configuration dialog.
 ##        """
 ##        self.adBlockManager().showDialog()
 ##        
+    # TODO: Click2Flash
 ##    def __showClickToFlashDialog(self):
 ##        """
 ##        Private slot to open the ClickToFlash whitelist configuration dialog.
@@ -3368,7 +3357,8 @@
         
         dlg = ZoomValuesDialog(self)
         dlg.exec_()
-        
+    
+    # TODO: Network Monitor
 ##    def __showNetworkMonitor(self):
 ##        """
 ##        Private slot to show the network monitor dialog.
@@ -3383,6 +3373,7 @@
         """
         self.downloadManager().show()
         
+    # TODO: Network Monitor
 ##    def __closeNetworkMonitor(self):
 ##        """
 ##        Private slot to close the network monitor dialog.
@@ -3448,9 +3439,6 @@
         @param url URL to be opened (QUrl)
         @param title title of the bookmark (string)
         """
-##        req = QNetworkRequest(url)
-##        req.setRawHeader(b"X-Eric6-UserLoadAction", b"1")
-##        self.newTab(None, (req, QNetworkAccessManager.GetOperation, b""))
         self.newTab(url)
     
     @classmethod
@@ -3478,7 +3466,8 @@
             cls._passwordManager = PasswordManager()
         
         return cls._passwordManager
-        
+    
+    # TODO: AdBlock
 ##    @classmethod
 ##    def adBlockManager(cls):
 ##        """
@@ -4080,6 +4069,8 @@
             cls._webProfile.downloadRequested.connect(
                 cls.downloadRequested)
             
+            # TODO: Cache settings
+            
             # Setup QWebChannel user script
             script = QWebEngineScript()
             script.setName("_eric_webchannel")
--- a/eric6.e4p	Fri Mar 04 20:15:34 2016 +0100
+++ b/eric6.e4p	Sat Mar 05 14:34:49 2016 +0100
@@ -823,6 +823,7 @@
     <Source>Preferences/ConfigurationPages/VcsPage.py</Source>
     <Source>Preferences/ConfigurationPages/ViewmanagerPage.py</Source>
     <Source>Preferences/ConfigurationPages/WebBrowserAppearancePage.py</Source>
+    <Source>Preferences/ConfigurationPages/WebBrowserPage.py</Source>
     <Source>Preferences/ConfigurationPages/__init__.py</Source>
     <Source>Preferences/MouseClickDialog.py</Source>
     <Source>Preferences/PreferencesLexer.py</Source>
@@ -1753,6 +1754,7 @@
     <Form>Preferences/ConfigurationPages/VcsPage.ui</Form>
     <Form>Preferences/ConfigurationPages/ViewmanagerPage.ui</Form>
     <Form>Preferences/ConfigurationPages/WebBrowserAppearancePage.ui</Form>
+    <Form>Preferences/ConfigurationPages/WebBrowserPage.ui</Form>
     <Form>Preferences/MouseClickDialog.ui</Form>
     <Form>Preferences/ProgramsDialog.ui</Form>
     <Form>Preferences/ShortcutDialog.ui</Form>

eric ide

mercurial