Fixed an issue with Qt installations that don't support SSL.

Sat, 01 Jan 2011 19:25:31 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 01 Jan 2011 19:25:31 +0100
changeset 798
5c1786fad576
parent 796
a6175e238484
child 801
16f9875e278b

Fixed an issue with Qt installations that don't support SSL.

Helpviewer/Network/NetworkAccessManagerProxy.py file | annotate | diff | comparison | revisions
Helpviewer/UrlBar/UrlBar.py file | annotate | diff | comparison | revisions
PluginManager/PluginRepositoryDialog.py file | annotate | diff | comparison | revisions
UI/UserInterface.py file | annotate | diff | comparison | revisions
--- a/Helpviewer/Network/NetworkAccessManagerProxy.py	Sat Jan 01 18:20:21 2011 +0100
+++ b/Helpviewer/Network/NetworkAccessManagerProxy.py	Sat Jan 01 19:25:31 2011 +0100
@@ -8,6 +8,11 @@
 """
 
 from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest
+try:
+    from PyQt4.QtNetwork import QSslError   # __IGNORE_WARNING__
+    SSL_AVAILABLE = True
+except ImportError:
+    SSL_AVAILABLE = False
 
 class NetworkAccessManagerProxy(QNetworkAccessManager):
     """
@@ -47,7 +52,8 @@
         # do not steal ownership
         self.cookieJar().setParent(self.__class__.primaryManager)
         
-        self.sslErrors.connect(self.__class__.primaryManager.sslErrors)
+        if SSL_AVAILABLE:
+            self.sslErrors.connect(self.__class__.primaryManager.sslErrors)
         self.proxyAuthenticationRequired.connect(
             self.__class__.primaryManager.proxyAuthenticationRequired)
         self.authenticationRequired.connect(
--- a/Helpviewer/UrlBar/UrlBar.py	Sat Jan 01 18:20:21 2011 +0100
+++ b/Helpviewer/UrlBar/UrlBar.py	Sat Jan 01 19:25:31 2011 +0100
@@ -9,7 +9,10 @@
 
 from PyQt4.QtCore import pyqtSlot, Qt, QPointF, QUrl
 from PyQt4.QtGui import QColor, QPalette, QApplication, QLinearGradient, QIcon
-from PyQt4.QtNetwork import QSslCertificate
+try:
+    from PyQt4.QtNetwork import QSslCertificate
+except ImportError:
+    QSslCertificate = None      # __IGNORE_WARNING__
 from PyQt4.QtWebKit import QWebSettings
 
 from E5Gui.E5LineEdit import E5LineEdit
@@ -137,7 +140,9 @@
                 self.__bookmarkButton.setIcon(self.__bmActiveIcon)
             self.__bookmarkButton.setVisible(True)
         
-        if ok and self.__browser.url().scheme() == "https":
+        if ok and \
+           self.__browser.url().scheme() == "https" and \
+           QSslCertificate is not None:
             sslInfo = self.__browser.page().getSslInfo()
             if sslInfo is not None:
                 org = Utilities.decodeString(
--- a/PluginManager/PluginRepositoryDialog.py	Sat Jan 01 18:20:21 2011 +0100
+++ b/PluginManager/PluginRepositoryDialog.py	Sat Jan 01 19:25:31 2011 +0100
@@ -15,6 +15,11 @@
 from PyQt4.QtGui import *
 from PyQt4.QtCore import *
 from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply
+try:
+    from PyQt4.QtNetwork import QSslError   # __IGNORE_WARNING__
+    SSL_AVAILABLE = True
+except ImportError:
+    SSL_AVAILABLE = False
 
 from .Ui_PluginRepositoryDialog import Ui_PluginRepositoryDialog
 
@@ -76,7 +81,8 @@
         self.__networkManager = QNetworkAccessManager(self)
         self.__networkManager.proxyAuthenticationRequired.connect(
             proxyAuthenticationRequired)
-        self.__networkManager.sslErrors.connect(self.__sslErrors)
+        if SSL_AVAILABLE:
+            self.__networkManager.sslErrors.connect(self.__sslErrors)
         self.__replies = []
         
         self.__doneMethod = None
--- a/UI/UserInterface.py	Sat Jan 01 18:20:21 2011 +0100
+++ b/UI/UserInterface.py	Sat Jan 01 19:25:31 2011 +0100
@@ -16,6 +16,11 @@
 from PyQt4.Qsci import QSCINTILLA_VERSION_STR
 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \
     QNetworkRequest, QNetworkReply
+try:
+    from PyQt4.QtNetwork import QSslError   # __IGNORE_WARNING__
+    SSL_AVAILABLE = True
+except ImportError:
+    SSL_AVAILABLE = False
 
 from Debugger.DebugUI import DebugUI
 from Debugger.DebugServer import DebugServer
@@ -560,7 +565,8 @@
         self.__networkManager = QNetworkAccessManager(self)
         self.__networkManager.proxyAuthenticationRequired.connect(
             proxyAuthenticationRequired)
-        self.__networkManager.sslErrors.connect(self.__sslErrors)
+        if SSL_AVAILABLE:
+            self.__networkManager.sslErrors.connect(self.__sslErrors)
         self.__replies = []
         
         # attribute for the help window

eric ide

mercurial