Helpviewer/SiteInfo/SiteInfoDialog.py

changeset 1857
baf039cc2d9a
parent 1780
f42757fd021b
child 2078
9f4a45741622
--- a/Helpviewer/SiteInfo/SiteInfoDialog.py	Wed May 09 20:19:04 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
 
@@ -46,7 +51,8 @@
         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-databases.png"))
-        self.tabWidget.setTabIcon(3, UI.PixmapCache.getIcon("siteinfo-security.png"))
+        if SSL:
+            self.tabWidget.setTabIcon(3, UI.PixmapCache.getIcon("siteinfo-security.png"))
         
         self.__mainFrame = browser.page().mainFrame()
         title = browser.title()
@@ -85,8 +91,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