Started adding support for Qt 5.8 functionality to the new web browser.

Fri, 17 Feb 2017 18:34:11 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 17 Feb 2017 18:34:11 +0100
changeset 5526
11337e4fba52
parent 5525
1771a7f9065c
child 5527
4fdbb36fe794
child 5535
3296c56acdbf

Started adding support for Qt 5.8 functionality to the new web browser.

Documentation/Help/source.qch 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/Download/DownloadItem.py file | annotate | diff | comparison | revisions
WebBrowser/Network/SslErrorExceptionsDialog.py file | annotate | diff | comparison | revisions
WebBrowser/StatusBar/JavaScriptSettingsDialog.py file | annotate | diff | comparison | revisions
WebBrowser/StatusBar/JavaScriptSettingsDialog.ui file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserTabWidget.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserView.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
changelog file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Preferences/ConfigurationPages/WebBrowserPage.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/Preferences/ConfigurationPages/WebBrowserPage.py	Fri Feb 17 18:34:11 2017 +0100
@@ -76,9 +76,6 @@
         
         self.jsOpenWindowsCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
-        # TODO: Qt 5.8?
-##        self.jsCloseWindowsCheckBox.setChecked(
-##            Preferences.getWebBrowser("JavaScriptCanCloseWindows"))
         self.jsClipboardCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
         self.pluginsCheckBox.setChecked(
@@ -164,10 +161,6 @@
             Preferences.getWebBrowser("WebInspectorEnabled"))
         self.webInspectorPortSpinBox.setValue(
             Preferences.getWebBrowser("WebInspectorPort"))
-        
-        # TODO: Qt 5.8?
-        # Hide entries not yet supported
-        self.jsCloseWindowsCheckBox.hide()
     
     def save(self):
         """
@@ -206,10 +199,6 @@
         Preferences.setWebBrowser(
             "JavaScriptCanOpenWindows",
             self.jsOpenWindowsCheckBox.isChecked())
-        # TODO: Qt 5.8?
-##        Preferences.setWebBrowser(
-##            "JavaScriptCanCloseWindows",
-##            self.jsCloseWindowsCheckBox.isChecked())
         Preferences.setWebBrowser(
             "JavaScriptCanAccessClipboard",
             self.jsClipboardCheckBox.isChecked())
--- a/Preferences/ConfigurationPages/WebBrowserPage.ui	Thu Feb 16 18:58:58 2017 +0100
+++ b/Preferences/ConfigurationPages/WebBrowserPage.ui	Fri Feb 17 18:34:11 2017 +0100
@@ -264,8 +264,8 @@
         <property name="title">
          <string>JavaScript</string>
         </property>
-        <layout class="QGridLayout" name="gridLayout">
-         <item row="0" column="0">
+        <layout class="QVBoxLayout" name="verticalLayout_5">
+         <item>
           <widget class="QCheckBox" name="jsOpenWindowsCheckBox">
            <property name="toolTip">
             <string>Select to allow JavaScript to open windows</string>
@@ -275,17 +275,7 @@
            </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">
+         <item>
           <widget class="QCheckBox" name="jsClipboardCheckBox">
            <property name="toolTip">
             <string>Select to allow JavaScript to access the clipboard</string>
@@ -788,7 +778,6 @@
   <tabstop>defaultSchemeCombo</tabstop>
   <tabstop>javaScriptGroup</tabstop>
   <tabstop>jsOpenWindowsCheckBox</tabstop>
-  <tabstop>jsCloseWindowsCheckBox</tabstop>
   <tabstop>jsClipboardCheckBox</tabstop>
   <tabstop>pluginsCheckBox</tabstop>
   <tabstop>doNotTrackCheckBox</tabstop>
--- a/Preferences/__init__.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/Preferences/__init__.py	Fri Feb 17 18:34:11 2017 +0100
@@ -1135,9 +1135,6 @@
                 QWebEngineSettings.AutoLoadImages),
             "JavaScriptCanOpenWindows": webEngineSettings.testAttribute(
                 QWebEngineSettings.JavascriptCanOpenWindows),
-            # TODO: Qt 5.8?
-##            "JavaScriptCanCloseWindows": webEngineSettings.testAttribute(
-##                QWebEngineSettings.JavascriptCanCloseWindows),
             "JavaScriptCanAccessClipboard": webEngineSettings.testAttribute(
                 QWebEngineSettings.JavascriptCanAccessClipboard),
             "PluginsEnabled": webEngineSettings.testAttribute(
@@ -1176,6 +1173,11 @@
         except AttributeError:
             pass
         
+        # TODO: add these for Qt 5.8+
+        #       QWebEngineSettings.FocusOnNavigationEnabled
+        #       QWebEngineSettings.PrintElementBackgrounds
+        #       QWebEngineSettings.AllowRunningInsecureContent
+        
         cls.webEngineSettingsIntitialized = True
     
     webEngineSettingsIntitialized = False
--- a/WebBrowser/Download/DownloadItem.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/WebBrowser/Download/DownloadItem.py	Fri Feb 17 18:34:11 2017 +0100
@@ -124,6 +124,7 @@
         if self.__gettingFileName:
             return
         
+        # TODO: Qt 5.8 - add support for QWebEngineDownloadItem.DownloadType
         if qVersion() >= "5.7.0":
             savePage = self.__downloadItem.savePageFormat() != \
                 QWebEngineDownloadItem.UnknownSaveFormat
@@ -196,6 +197,7 @@
                     "")
                 self.__gettingFileName = False
         else:
+            # TODO: Qt 5.8 - maybe format selection is not neccessary
             self.__autoOpen = False
             
             filterList = [
--- a/WebBrowser/Network/SslErrorExceptionsDialog.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/WebBrowser/Network/SslErrorExceptionsDialog.py	Fri Feb 17 18:34:11 2017 +0100
@@ -77,6 +77,7 @@
         except AttributeError:
             # the value was added in Qt 5.7
             pass
+        # TODO: Qt 5.8 - add support for QWebEngineCertificateError.CertificateTransparencyRequired
         
         for host, errors in errorsDict.items():
             itm = QTreeWidgetItem(self.errorsTree, [host])
--- a/WebBrowser/StatusBar/JavaScriptSettingsDialog.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/WebBrowser/StatusBar/JavaScriptSettingsDialog.py	Fri Feb 17 18:34:11 2017 +0100
@@ -36,16 +36,9 @@
         
         self.jsOpenWindowsCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
-        # TODO: Qt 5.8?
-##        self.jsCloseWindowsCheckBox.setChecked(
-##            Preferences.getWebBrowser("JavaScriptCanCloseWindows"))
         self.jsClipboardCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
         
-        # TODO: Qt 5.8?
-        # Hide entries not yet supported
-        self.jsCloseWindowsCheckBox.hide()
-        
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
     
@@ -57,10 +50,6 @@
         Preferences.setWebBrowser(
             "JavaScriptCanOpenWindows",
             self.jsOpenWindowsCheckBox.isChecked())
-        # TODO: Qt 5.8?
-##        Preferences.setWebBrowser(
-##            "JavaScriptCanCloseWindows",
-##            self.jsCloseWindowsCheckBox.isChecked())
         Preferences.setWebBrowser(
             "JavaScriptCanAccessClipboard",
             self.jsClipboardCheckBox.isChecked())
--- a/WebBrowser/StatusBar/JavaScriptSettingsDialog.ui	Thu Feb 16 18:58:58 2017 +0100
+++ b/WebBrowser/StatusBar/JavaScriptSettingsDialog.ui	Fri Feb 17 18:34:11 2017 +0100
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>111</height>
+    <height>87</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -28,16 +28,6 @@
     </widget>
    </item>
    <item>
-    <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>
     <widget class="QCheckBox" name="jsClipboardCheckBox">
      <property name="toolTip">
       <string>Select to allow JavaScript to access the clipboard</string>
--- a/WebBrowser/WebBrowserTabWidget.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/WebBrowser/WebBrowserTabWidget.py	Fri Feb 17 18:34:11 2017 +0100
@@ -638,6 +638,7 @@
             if FilePrinter.isCupsAvailable():
                 printDialog.setOption(QAbstractPrintDialog.PrintCollateCopies)
             printDialog.setOption(QAbstractPrintDialog.PrintPageRange)
+        # TODO: Add Qt 5.8 print support
         if printDialog.exec_() == QDialog.Accepted:
             if not hasattr(browser.page(), "printToPdf"):
                 browser.render(printer)
--- a/WebBrowser/WebBrowserView.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/WebBrowser/WebBrowserView.py	Fri Feb 17 18:34:11 2017 +0100
@@ -502,6 +502,7 @@
         @param hitTest reference to the hit test object
         @type WebHitTestResult
         """
+        # TODO: Qt 5.8 - add support for spell checking
         if not hitTest.linkUrl().isEmpty() and \
                 hitTest.linkUrl().scheme() != "javascript":
             self.__createLinkContextMenu(menu, hitTest)
@@ -1339,6 +1340,7 @@
         """
         # find the render widget receiving events for the web page
         if obj is self and evt.type() == QEvent.ChildAdded:
+            # TODO: Qt 5.8 - check, if this still works on 5.8 (see Qupzilla)
             child = evt.child()
             if child and child.inherits(
                     "QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget"):
@@ -1613,6 +1615,7 @@
         if url.isEmpty():
             return
         
+        # TODO: Qt 5.8 - use QWebEnginePage.save()
         self.triggerPageAction(QWebEnginePage.SavePage)
     
     ###########################################################################
--- a/WebBrowser/WebBrowserWindow.py	Thu Feb 16 18:58:58 2017 +0100
+++ b/WebBrowser/WebBrowserWindow.py	Fri Feb 17 18:34:11 2017 +0100
@@ -62,6 +62,7 @@
 from eric6config import getConfig
 
 
+# TODO: Qt 5.8 - support spell checking through out
 class WebBrowserWindow(E5MainWindow):
     """
     Class implementing the web browser main window.
--- a/changelog	Thu Feb 16 18:58:58 2017 +0100
+++ b/changelog	Fri Feb 17 18:34:11 2017 +0100
@@ -11,7 +11,7 @@
 - Project
   -- added capability to remember previously used entries in the project
      debugger properties dialog
-  
+
 Version 17.02.1:
 - bug fixes
 

eric ide

mercurial