Fixed a few issues with the eric web browser.

Sat, 06 Mar 2010 10:21:13 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 06 Mar 2010 10:21:13 +0000
changeset 134
c2dd2bf92ece
parent 133
5b6e8eb22796
child 135
c2eaec053221

Fixed a few issues with the eric web browser.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Helpviewer.AdBlock.AdBlockManager.html file | annotate | diff | comparison | revisions
Helpviewer/AdBlock/AdBlockDialog.py file | annotate | diff | comparison | revisions
Helpviewer/AdBlock/AdBlockManager.py file | annotate | diff | comparison | revisions
Helpviewer/AdBlock/AdBlockRule.py file | annotate | diff | comparison | revisions
Helpviewer/AdBlock/AdBlockSubscription.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Thu Mar 04 15:39:21 2010 +0000
+++ b/Documentation/Help/source.qhp	Sat Mar 06 10:21:13 2010 +0000
@@ -6987,6 +6987,7 @@
       <keyword name="AdBlockManager (Constructor)" id="AdBlockManager (Constructor)" ref="eric5.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.__init__" />
       <keyword name="AdBlockManager.__customSubscriptionLocation" id="AdBlockManager.__customSubscriptionLocation" ref="eric5.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.__customSubscriptionLocation" />
       <keyword name="AdBlockManager.__customSubscriptionUrl" id="AdBlockManager.__customSubscriptionUrl" ref="eric5.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.__customSubscriptionUrl" />
+      <keyword name="AdBlockManager.__loadSubscriptions" id="AdBlockManager.__loadSubscriptions" ref="eric5.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.__loadSubscriptions" />
       <keyword name="AdBlockManager.addSubscription" id="AdBlockManager.addSubscription" ref="eric5.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.addSubscription" />
       <keyword name="AdBlockManager.close" id="AdBlockManager.close" ref="eric5.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.close" />
       <keyword name="AdBlockManager.customRules" id="AdBlockManager.customRules" ref="eric5.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.customRules" />
--- a/Documentation/Source/eric5.Helpviewer.AdBlock.AdBlockManager.html	Thu Mar 04 15:39:21 2010 +0000
+++ b/Documentation/Source/eric5.Helpviewer.AdBlock.AdBlockManager.html	Sat Mar 06 10:21:13 2010 +0000
@@ -69,6 +69,9 @@
 <td><a href="#AdBlockManager.__customSubscriptionUrl">__customSubscriptionUrl</a></td>
 <td>Private method to generate the URL for custom subscriptions.</td>
 </tr><tr>
+<td><a href="#AdBlockManager.__loadSubscriptions">__loadSubscriptions</a></td>
+<td>Private method to load the set of subscriptions.</td>
+</tr><tr>
 <td><a href="#AdBlockManager.addSubscription">addSubscription</a></td>
 <td>Public method to add an AdBlock subscription.</td>
 </tr><tr>
@@ -136,7 +139,12 @@
 <dd>
 URL for custom subscriptions (QUrl)
 </dd>
-</dl><a NAME="AdBlockManager.addSubscription" ID="AdBlockManager.addSubscription"></a>
+</dl><a NAME="AdBlockManager.__loadSubscriptions" ID="AdBlockManager.__loadSubscriptions"></a>
+<h4>AdBlockManager.__loadSubscriptions</h4>
+<b>__loadSubscriptions</b>(<i></i>)
+<p>
+        Private method to load the set of subscriptions.
+</p><a NAME="AdBlockManager.addSubscription" ID="AdBlockManager.addSubscription"></a>
 <h4>AdBlockManager.addSubscription</h4>
 <b>addSubscription</b>(<i>subscription</i>)
 <p>
--- a/Helpviewer/AdBlock/AdBlockDialog.py	Thu Mar 04 15:39:21 2010 +0000
+++ b/Helpviewer/AdBlock/AdBlockDialog.py	Sat Mar 06 10:21:13 2010 +0000
@@ -53,9 +53,10 @@
         self.actionButton.setIcon(UI.PixmapCache.getIcon("adBlockAction.png"))
         self.actionButton.setPopupMode(QToolButton.InstantPopup)
         
-        subscription = manager.customRules()
-        subscriptionIndex = self.__adBlockModel.subscriptionIndex(subscription)
-        self.subscriptionsTree.expand(self.__proxyModel.mapFromSource(subscriptionIndex))
+        if self.adBlockGroup.isChecked():
+            subscription = manager.customRules()
+            subscriptionIndex = self.__adBlockModel.subscriptionIndex(subscription)
+            self.subscriptionsTree.expand(self.__proxyModel.mapFromSource(subscriptionIndex))
     
     def model(self):
         """
@@ -152,4 +153,4 @@
             idx = idx.parent()
         subscription = self.__adBlockModel.subscription(idx)
         manager = Helpviewer.HelpWindow.HelpWindow.adblockManager()
-        manager.removeSubscription(subscription)
\ No newline at end of file
+        manager.removeSubscription(subscription)
--- a/Helpviewer/AdBlock/AdBlockManager.py	Thu Mar 04 15:39:21 2010 +0000
+++ b/Helpviewer/AdBlock/AdBlockManager.py	Sat Mar 06 10:21:13 2010 +0000
@@ -214,7 +214,7 @@
         if self.__enabled:
             self.__loadSubscriptions()
     
-    def __loadSubscriptions():
+    def __loadSubscriptions(self):
         """
         Private method to load the set of subscriptions.
         """
--- a/Helpviewer/AdBlock/AdBlockRule.py	Thu Mar 04 15:39:21 2010 +0000
+++ b/Helpviewer/AdBlock/AdBlockRule.py	Sat Mar 06 10:21:13 2010 +0000
@@ -62,7 +62,10 @@
         
         options = parsedLine.find("$")
         if options >= 0:
-            self.__options = parsedLine[options + 1].split(",")
+            try:
+                self.__options = parsedLine[options + 1:].split(",")
+            except IndexError:
+                self.__options = []
             parsedLine = parsedLine[:options]
         
         self.setPattern(parsedLine, regExpRule)
--- a/Helpviewer/AdBlock/AdBlockSubscription.py	Thu Mar 04 15:39:21 2010 +0000
+++ b/Helpviewer/AdBlock/AdBlockSubscription.py	Sat Mar 06 10:21:13 2010 +0000
@@ -179,7 +179,9 @@
         if self.__location.isEmpty():
             return ""
         
-        sha1 = QCryptographicHash.hash(self.__location, QCryptographicHash.Sha1).toHex()
+        sha1 = bytes(
+            QCryptographicHash.hash(self.__location, QCryptographicHash.Sha1).toHex())\
+            .decode()
         dataDir = os.path.join(Utilities.getConfigDir(), "browser", "subscriptions")
         if not os.path.exists(dataDir):
             os.makedirs(dataDir)

eric ide

mercurial