Helpviewer/SiteInfo/SiteInfoDialog.py

branch
5_2_x
changeset 1861
6e8f19ebda9d
parent 1509
c0b5e693b0eb
child 2123
7f02c9d4cd3b
--- a/Helpviewer/SiteInfo/SiteInfoDialog.py	Fri May 11 18:52:41 2012 +0200
+++ b/Helpviewer/SiteInfo/SiteInfoDialog.py	Fri May 11 18:48:10 2012 +0200
@@ -16,7 +16,12 @@
 
 from E5Gui import E5MessageBox, E5FileDialog
 
-from .Ui_SiteInfoDialog import Ui_SiteInfoDialog
+try:
+    from .Ui_SiteInfoDialog import Ui_SiteInfoDialog        # __IGNORE_WARNING__
+    SSL = True
+except ImportError:
+    from .Ui_SiteInfoNoSslDialog import Ui_SiteInfoDialog   # __IGNORE_WARNING__
+    SSL = False
 
 from ..Download.DownloadUtilities import dataString
 
@@ -45,7 +50,8 @@
         # put icons
         self.tabWidget.setTabIcon(0, UI.PixmapCache.getIcon("siteinfo-general.png"))
         self.tabWidget.setTabIcon(1, UI.PixmapCache.getIcon("siteinfo-media.png"))
-        self.tabWidget.setTabIcon(2, UI.PixmapCache.getIcon("siteinfo-security.png"))
+        if SSL:
+            self.tabWidget.setTabIcon(2, UI.PixmapCache.getIcon("siteinfo-security.png"))
         
         frame = browser.page().mainFrame()
         title = browser.title()
@@ -84,8 +90,11 @@
         if sslInfo is not None and sslInfo.isValid():
             self.securityLabel.setStyleSheet(SiteInfoDialog.okStyle)
             self.securityLabel.setText('<b>Connection is encrypted.</b>')
-            self.sslWidget.showCertificate(sslInfo)
-            self.securityDetailsButton.setEnabled(True)
+            if SSL:
+                self.sslWidget.showCertificate(sslInfo)
+                self.securityDetailsButton.setEnabled(True)
+            else:
+                self.securityDetailsButton.setEnabled(False)
         else:
             self.securityLabel.setStyleSheet(SiteInfoDialog.nokStyle)
             self.securityLabel.setText('<b>Connection is not encrypted.</b>')

eric ide

mercurial