Helpviewer/OfflineStorage/OfflineStorageConfigDialog.py

changeset 355
c29c8b8dadf1
parent 353
c548890dff9b
child 791
9ec2ac20e54e
--- a/Helpviewer/OfflineStorage/OfflineStorageConfigDialog.py	Sat Jun 19 17:02:53 2010 +0200
+++ b/Helpviewer/OfflineStorage/OfflineStorageConfigDialog.py	Sat Jun 19 18:30:21 2010 +0200
@@ -9,6 +9,7 @@
 
 from PyQt4.QtCore import pyqtSlot
 from PyQt4.QtGui import QDialog
+from PyQt4.QtWebKit import QWebSettings
 
 from .WebDatabasesDialog import WebDatabasesDialog
 from .Ui_OfflineStorageConfigDialog import Ui_OfflineStorageConfigDialog
@@ -32,6 +33,20 @@
             Preferences.getHelp("OfflineStorageDatabaseEnabled"))
         self.databaseQuotaSpinBox.setValue(
             Preferences.getHelp("OfflineStorageDatabaseQuota"))
+        
+        if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"):
+            self.applicationCacheEnabledCheckBox.setChecked(
+                Preferences.getHelp("OfflineWebApplicationCacheEnabled"))
+            self.applicationCacheQuotaSpinBox.setValue(
+                Preferences.getHelp("OfflineWebApplicationCacheQuota"))
+        else:
+            self.applicationCacheGroup.setEnabled(False)
+        
+        if hasattr(QWebSettings, "LocalStorageEnabled"):
+            self.localStorageEnabledCheckBox.setChecked(
+                Preferences.getHelp("LocalStorageEnabled"))
+        else:
+            self.localStorageGroup.setEnabled(False)
     
     def storeData(self):
         """
@@ -41,6 +56,16 @@
             self.databaseEnabledCheckBox.isChecked())
         Preferences.setHelp("OfflineStorageDatabaseQuota", 
             self.databaseQuotaSpinBox.value())
+        
+        if self.applicationCacheGroup.isEnabled():
+            Preferences.setHelp("OfflineWebApplicationCacheEnabled", 
+                self.applicationCacheEnabledCheckBox.isChecked())
+            Preferences.setHelp("OfflineWebApplicationCacheQuota", 
+                self.applicationCacheQuotaSpinBox.value())
+        
+        if self.localStorageGroup.isEnabled():
+            Preferences.setHelp("LocalStorageEnabled", 
+                self.localStorageEnabledCheckBox.isChecked())
     
     @pyqtSlot()
     def on_showDatabasesButton_clicked(self):

eric ide

mercurial