Started to implement a few more browser options for the eric web browser.

Sun, 18 Sep 2011 20:04:24 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 18 Sep 2011 20:04:24 +0200
changeset 1337
95ceea538e4c
parent 1335
60a540cabd68
child 1338
4d0b50ef28cb

Started to implement a few more browser options for the eric web browser.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Helpviewer/HelpWindow.py file | annotate | diff | comparison | revisions
Helpviewer/OfflineStorage/OfflineStorageConfigDialog.py file | annotate | diff | comparison | revisions
Helpviewer/OfflineStorage/OfflineStorageConfigDialog.ui file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/HelpWebBrowserPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/HelpWebBrowserPage.ui file | annotate | diff | comparison | revisions
Preferences/__init__.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Helpviewer/HelpWindow.py	Sat Sep 17 16:28:41 2011 +0200
+++ b/Helpviewer/HelpWindow.py	Sun Sep 18 20:04:24 2011 +0200
@@ -316,6 +316,25 @@
             settings.setDefaultTextEncoding(
                 Preferences.getHelp("DefaultTextEncoding"))
         
+        if hasattr(QWebSettings, "SpatialNavigationEnabled"):
+            settings.setAttribute(QWebSettings.SpatialNavigationEnabled,
+                Preferences.getHelp("SpatialNavigationEnabled"))
+        if hasattr(QWebSettings, "LinksIncludedInFocusChain"):
+            settings.setAttribute(QWebSettings.LinksIncludedInFocusChain,
+                Preferences.getHelp("LinksIncludedInFocusChain"))
+        if hasattr(QWebSettings, "LocalContentCanAccessRemoteUrls"):
+            settings.setAttribute(QWebSettings.LocalContentCanAccessRemoteUrls,
+                Preferences.getHelp("LocalContentCanAccessRemoteUrls"))
+        if hasattr(QWebSettings, "LocalContentCanAccessFileUrls"):
+            settings.setAttribute(QWebSettings.LocalContentCanAccessFileUrls,
+                Preferences.getHelp("LocalContentCanAccessFileUrls"))
+        if hasattr(QWebSettings, "XSSAuditingEnabled"):
+            settings.setAttribute(QWebSettings.XSSAuditingEnabled,
+                Preferences.getHelp("XSSAuditingEnabled"))
+        if hasattr(QWebSettings, "SiteSpecificQuirksEnabled"):
+            settings.setAttribute(QWebSettings.SiteSpecificQuirksEnabled,
+                Preferences.getHelp("SiteSpecificQuirksEnabled"))
+    
     def __initActions(self):
         """
         Private method to define the user interface actions.
--- a/Helpviewer/OfflineStorage/OfflineStorageConfigDialog.py	Sat Sep 17 16:28:41 2011 +0200
+++ b/Helpviewer/OfflineStorage/OfflineStorageConfigDialog.py	Sun Sep 18 20:04:24 2011 +0200
@@ -48,6 +48,18 @@
                 Preferences.getHelp("LocalStorageEnabled"))
         else:
             self.localStorageGroup.setEnabled(False)
+        
+        if hasattr(QWebSettings, "LocalContentCanAccessRemoteUrls"):
+            self.localRemoteUrlsCheckBox.setChecked(
+                Preferences.getHelp("LocalContentCanAccessRemoteUrls"))
+        else:
+            self.localRemoteUrlsCheckBox.setVisible(False)
+        
+        if hasattr(QWebSettings, "LocalContentCanAccessFileUrls"):
+            self.localFileUrlsCheckBox.setChecked(
+                Preferences.getHelp("LocalContentCanAccessFileUrls"))
+        else:
+            self.localFileUrlsCheckBox.setVisible(False)
     
     def storeData(self):
         """
@@ -67,6 +79,12 @@
         if self.localStorageGroup.isEnabled():
             Preferences.setHelp("LocalStorageEnabled",
                 self.localStorageEnabledCheckBox.isChecked())
+            if self.localRemoteUrlsCheckBox.isVisible():
+                Preferences.setHelp("LocalContentCanAccessRemoteUrls",
+                    self.localRemoteUrlsCheckBox.isChecked())
+            if self.localFileUrlsCheckBox.isVisible():
+                Preferences.setHelp("LocalContentCanAccessFileUrls",
+                    self.localFileUrlsCheckBox.isChecked())
     
     @pyqtSlot()
     def on_showDatabasesButton_clicked(self):
--- a/Helpviewer/OfflineStorage/OfflineStorageConfigDialog.ui	Sat Sep 17 16:28:41 2011 +0200
+++ b/Helpviewer/OfflineStorage/OfflineStorageConfigDialog.ui	Sun Sep 18 20:04:24 2011 +0200
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>487</width>
-    <height>337</height>
+    <height>386</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -16,7 +16,7 @@
   <property name="sizeGripEnabled">
    <bool>true</bool>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
+  <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QLabel" name="headerLabel">
      <property name="text">
@@ -168,8 +168,8 @@
      <property name="title">
       <string>Local Web Storage</string>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <item>
+     <layout class="QGridLayout" name="gridLayout_3">
+      <item row="0" column="0" colspan="2">
        <widget class="QCheckBox" name="localStorageEnabledCheckBox">
         <property name="toolTip">
          <string>Select to enable Local Web Storage</string>
@@ -179,6 +179,51 @@
         </property>
        </widget>
       </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string notr="true">   </string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QCheckBox" name="localRemoteUrlsCheckBox">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select to allow local content to access remote URLs</string>
+        </property>
+        <property name="text">
+         <string>Local Content can access Remote URLs</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="QCheckBox" name="localFileUrlsCheckBox">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="toolTip">
+         <string>Select to allow local content to access local files</string>
+        </property>
+        <property name="text">
+         <string>Local Content can access Local Files</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
@@ -201,6 +246,8 @@
   <tabstop>applicationCacheEnabledCheckBox</tabstop>
   <tabstop>applicationCacheQuotaSpinBox</tabstop>
   <tabstop>localStorageEnabledCheckBox</tabstop>
+  <tabstop>localRemoteUrlsCheckBox</tabstop>
+  <tabstop>localFileUrlsCheckBox</tabstop>
   <tabstop>buttonBox</tabstop>
  </tabstops>
  <resources/>
@@ -212,8 +259,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>278</x>
-     <y>364</y>
+     <x>203</x>
+     <y>495</y>
     </hint>
     <hint type="destinationlabel">
      <x>157</x>
@@ -228,8 +275,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>346</x>
-     <y>370</y>
+     <x>203</x>
+     <y>495</y>
     </hint>
     <hint type="destinationlabel">
      <x>286</x>
@@ -237,5 +284,37 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>localStorageEnabledCheckBox</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>localRemoteUrlsCheckBox</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>66</x>
+     <y>275</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>65</x>
+     <y>290</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>localStorageEnabledCheckBox</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>localFileUrlsCheckBox</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>86</x>
+     <y>274</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>86</x>
+     <y>315</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>
--- a/Preferences/ConfigurationPages/HelpWebBrowserPage.py	Sat Sep 17 16:28:41 2011 +0200
+++ b/Preferences/ConfigurationPages/HelpWebBrowserPage.py	Sun Sep 18 20:04:24 2011 +0200
@@ -9,6 +9,7 @@
 
 from PyQt4.QtCore import pyqtSlot, QLocale
 from PyQt4.QtNetwork import QNetworkRequest
+from PyQt4.QtWebKit import QWebSettings
 
 from .ConfigurationPageBase import ConfigurationPageBase
 from .Ui_HelpWebBrowserPage import Ui_HelpWebBrowserPage
@@ -121,6 +122,17 @@
         index = self.languageCombo.findData(Preferences.getHelp("SearchLanguage"))
         if index > -1:
             self.languageCombo.setCurrentIndex(index)
+        
+        if hasattr(QWebSettings, "SpatialNavigationEnabled"):
+            self.spatialCheckBox.setChecked(
+                Preferences.getHelp("SpatialNavigationEnabled"))
+        else:
+            self.spatialCheckBox.setEnabled(False)
+        if hasattr(QWebSettings, "LinksIncludedInFocusChain"):
+            self.linksInFocusChainCheckBox.setChecked(
+                Preferences.getHelp("LinksIncludedInFocusChain"))
+        else:
+            self.linksInFocusChainCheckBox.setEnabled(False)
     
     def save(self):
         """
@@ -199,6 +211,13 @@
             # fall back to system default
             language = QLocale.system().language()
         Preferences.setHelp("SearchLanguage", language)
+        
+        if hasattr(QWebSettings, "SpatialNavigationEnabled"):
+            Preferences.setHelp("SpatialNavigationEnabled",
+                self.spatialCheckBox.isChecked())
+        if hasattr(QWebSettings, "LinksIncludedInFocusChain"):
+            Preferences.setHelp("LinksIncludedInFocusChain",
+                self.linksInFocusChainCheckBox.isChecked())
     
     @pyqtSlot()
     def on_setCurrentPageButton_clicked(self):
--- a/Preferences/ConfigurationPages/HelpWebBrowserPage.ui	Sat Sep 17 16:28:41 2011 +0200
+++ b/Preferences/ConfigurationPages/HelpWebBrowserPage.ui	Sun Sep 18 20:04:24 2011 +0200
@@ -73,16 +73,6 @@
        </property>
       </widget>
      </item>
-     <item row="2" 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>
    </item>
    <item>
@@ -493,6 +483,53 @@
     </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>
     <spacer>
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -512,7 +549,6 @@
   <tabstop>webSuggestionsCheckBox</tabstop>
   <tabstop>saveGeometryCheckBox</tabstop>
   <tabstop>showTabPreviews</tabstop>
-  <tabstop>accessKeysCheckBox</tabstop>
   <tabstop>startupCombo</tabstop>
   <tabstop>homePageEdit</tabstop>
   <tabstop>setCurrentPageButton</tabstop>
@@ -532,6 +568,9 @@
   <tabstop>cacheSizeSpinBox</tabstop>
   <tabstop>languageCombo</tabstop>
   <tabstop>printBackgroundsCheckBox</tabstop>
+  <tabstop>spatialCheckBox</tabstop>
+  <tabstop>linksInFocusChainCheckBox</tabstop>
+  <tabstop>accessKeysCheckBox</tabstop>
  </tabstops>
  <resources/>
  <connections/>
--- a/Preferences/__init__.py	Sat Sep 17 16:28:41 2011 +0200
+++ b/Preferences/__init__.py	Sun Sep 18 20:04:24 2011 +0200
@@ -681,6 +681,24 @@
     if hasattr(QWebSettings, "defaultTextEncoding"):
         helpDefaults["DefaultTextEncoding"] = \
             websettings.defaultTextEncoding()
+    if hasattr(QWebSettings, "SpatialNavigationEnabled"):
+        helpDefaults["SpatialNavigationEnabled"] = \
+            websettings.testAttribute(QWebSettings.SpatialNavigationEnabled)
+    if hasattr(QWebSettings, "LinksIncludedInFocusChain"):
+        helpDefaults["LinksIncludedInFocusChain"] = \
+            websettings.testAttribute(QWebSettings.LinksIncludedInFocusChain)
+    if hasattr(QWebSettings, "LocalContentCanAccessRemoteUrls"):
+        helpDefaults["LocalContentCanAccessRemoteUrls"] = \
+            websettings.testAttribute(QWebSettings.LocalContentCanAccessRemoteUrls)
+    if hasattr(QWebSettings, "LocalContentCanAccessFileUrls"):
+        helpDefaults["LocalContentCanAccessFileUrls"] = \
+            websettings.testAttribute(QWebSettings.LocalContentCanAccessFileUrls)
+    if hasattr(QWebSettings, "XSSAuditingEnabled"):
+        helpDefaults["XSSAuditingEnabled"] = \
+            websettings.testAttribute(QWebSettings.XSSAuditingEnabled)
+    if hasattr(QWebSettings, "SiteSpecificQuirksEnabled"):
+        helpDefaults["SiteSpecificQuirksEnabled"] = \
+            websettings.testAttribute(QWebSettings.SiteSpecificQuirksEnabled)
 
     # defaults for system settings
     sysDefaults = {
@@ -1976,7 +1994,10 @@
                  "JavaScriptCanAccessClipboard", "PluginsEnabled", "DnsPrefetchEnabled",
                  "OfflineStorageDatabaseEnabled", "OfflineWebApplicationCacheEnabled",
                  "LocalStorageEnabled", "ShowPreview", "AccessKeysEnabled",
-                 "VirusTotalEnabled", "VirusTotalSecure", "DoNotTrack"]:
+                 "VirusTotalEnabled", "VirusTotalSecure", "DoNotTrack", 
+                 "SpatialNavigationEnabled", "LinksIncludedInFocusChain",
+                 "LocalContentCanAccessRemoteUrls", "LocalContentCanAccessFileUrls",
+                 "XSSAuditingEnabled", "SiteSpecificQuirksEnabled"]:
         return toBool(prefClass.settings.value("Help/" + key,
             prefClass.helpDefaults[key]))
     elif key in ["AdBlockSubscriptions"]:

eric ide

mercurial