Did a few browser related corrections. 5_2_x

Sat, 25 Feb 2012 16:26:01 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 25 Feb 2012 16:26:01 +0100
branch
5_2_x
changeset 1669
0df81d254c64
parent 1668
215353ac1a0c
child 1675
8f2f17380d38

Did a few browser related corrections.

Helpviewer/HelpBrowserWV.py file | annotate | diff | comparison | revisions
Helpviewer/HelpTabWidget.py file | annotate | diff | comparison | revisions
Helpviewer/History/HistoryManager.py file | annotate | diff | comparison | revisions
Helpviewer/UrlBar/UrlBar.py file | annotate | diff | comparison | revisions
--- a/Helpviewer/HelpBrowserWV.py	Fri Feb 24 11:15:28 2012 +0100
+++ b/Helpviewer/HelpBrowserWV.py	Sat Feb 25 16:26:01 2012 +0100
@@ -263,8 +263,7 @@
                 html = notFoundPage_html
                 title = self.trUtf8("Error loading page: {0}").format(urlString)
                 pixmap = qApp.style()\
-                         .standardIcon(QStyle.SP_MessageBoxWarning, None, self.parent())\
-                         .pixmap(32, 32)
+                         .standardIcon(QStyle.SP_MessageBoxWarning).pixmap(32, 32)
                 imageBuffer = QBuffer()
                 imageBuffer.open(QIODevice.ReadWrite)
                 if pixmap.save(imageBuffer, "PNG"):
@@ -1398,8 +1397,7 @@
         urlString = bytes(replyUrl.toEncoded()).decode()
         title = self.trUtf8("Error loading page: {0}").format(urlString)
         pixmap = qApp.style()\
-                 .standardIcon(QStyle.SP_MessageBoxWarning, None, self)\
-                 .pixmap(32, 32)
+                 .standardIcon(QStyle.SP_MessageBoxWarning).pixmap(32, 32)
         imageBuffer = QBuffer()
         imageBuffer.open(QIODevice.ReadWrite)
         if pixmap.save(imageBuffer, "PNG"):
--- a/Helpviewer/HelpTabWidget.py	Fri Feb 24 11:15:28 2012 +0100
+++ b/Helpviewer/HelpTabWidget.py	Sat Feb 25 16:26:01 2012 +0100
@@ -356,6 +356,8 @@
         del urlbar
         
         browser = self.widget(index)
+        if browser is None:
+            return
         browser.home()
         self.removeTab(index)
         self.browserClosed.emit(browser)
@@ -618,6 +620,8 @@
         @param ok flag indicating the result (boolean)
         """
         browser = self.sender()
+        if not isinstance(browser, HelpBrowser):
+            return
         
         if browser is not None:
             index = self.indexOf(browser)
--- a/Helpviewer/History/HistoryManager.py	Fri Feb 24 11:15:28 2012 +0100
+++ b/Helpviewer/History/HistoryManager.py	Sat Feb 25 16:26:01 2012 +0100
@@ -208,7 +208,7 @@
         """
         cleanurl = QUrl(url)
         cleanurl.setPassword("")
-        if cleanurl.host() is not None:
+        if cleanurl.host():
             cleanurl.setHost(cleanurl.host().lower())
         itm = HistoryEntry(cleanurl.toString(), QDateTime.currentDateTime())
         self._addHistoryEntry(itm)
--- a/Helpviewer/UrlBar/UrlBar.py	Fri Feb 24 11:15:28 2012 +0100
+++ b/Helpviewer/UrlBar/UrlBar.py	Sat Feb 25 16:26:01 2012 +0100
@@ -122,7 +122,12 @@
         
         @param url new URL of the browser (QUrl)
         """
-        self.setText(str(url.toEncoded(), encoding="utf-8"))
+        strUrl = url.toString()
+        if strUrl in ["pyrc:home", "about:blank"]:
+            strUrl = ""
+        
+        if self.text() != strUrl:
+            self.setText(strUrl)
         self.setCursorPosition(0)
     
     def __loadStarted(self):

eric ide

mercurial