Helpviewer/SiteInfo/SiteInfoDialog.py

changeset 1857
baf039cc2d9a
parent 1780
f42757fd021b
child 2078
9f4a45741622
equal deleted inserted replaced
1856:76cb601aec88 1857:baf039cc2d9a
14 QCursor, QApplication, QListWidgetItem 14 QCursor, QApplication, QListWidgetItem
15 from PyQt4.QtWebKit import QWebSettings 15 from PyQt4.QtWebKit import QWebSettings
16 16
17 from E5Gui import E5MessageBox, E5FileDialog 17 from E5Gui import E5MessageBox, E5FileDialog
18 18
19 from .Ui_SiteInfoDialog import Ui_SiteInfoDialog 19 try:
20 from .Ui_SiteInfoDialog import Ui_SiteInfoDialog # __IGNORE_WARNING__
21 SSL = True
22 except ImportError:
23 from .Ui_SiteInfoNoSslDialog import Ui_SiteInfoDialog # __IGNORE_WARNING__
24 SSL = False
20 25
21 from ..Download.DownloadUtilities import dataString 26 from ..Download.DownloadUtilities import dataString
22 27
23 import Helpviewer.HelpWindow 28 import Helpviewer.HelpWindow
24 29
44 49
45 # put icons 50 # put icons
46 self.tabWidget.setTabIcon(0, UI.PixmapCache.getIcon("siteinfo-general.png")) 51 self.tabWidget.setTabIcon(0, UI.PixmapCache.getIcon("siteinfo-general.png"))
47 self.tabWidget.setTabIcon(1, UI.PixmapCache.getIcon("siteinfo-media.png")) 52 self.tabWidget.setTabIcon(1, UI.PixmapCache.getIcon("siteinfo-media.png"))
48 self.tabWidget.setTabIcon(2, UI.PixmapCache.getIcon("siteinfo-databases.png")) 53 self.tabWidget.setTabIcon(2, UI.PixmapCache.getIcon("siteinfo-databases.png"))
49 self.tabWidget.setTabIcon(3, UI.PixmapCache.getIcon("siteinfo-security.png")) 54 if SSL:
55 self.tabWidget.setTabIcon(3, UI.PixmapCache.getIcon("siteinfo-security.png"))
50 56
51 self.__mainFrame = browser.page().mainFrame() 57 self.__mainFrame = browser.page().mainFrame()
52 title = browser.title() 58 title = browser.title()
53 sslInfo = browser.page().getSslInfo() 59 sslInfo = browser.page().getSslInfo()
54 60
83 89
84 # populate the Security info and the Security tab 90 # populate the Security info and the Security tab
85 if sslInfo is not None and sslInfo.isValid(): 91 if sslInfo is not None and sslInfo.isValid():
86 self.securityLabel.setStyleSheet(SiteInfoDialog.okStyle) 92 self.securityLabel.setStyleSheet(SiteInfoDialog.okStyle)
87 self.securityLabel.setText('<b>Connection is encrypted.</b>') 93 self.securityLabel.setText('<b>Connection is encrypted.</b>')
88 self.sslWidget.showCertificate(sslInfo) 94 if SSL:
89 self.securityDetailsButton.setEnabled(True) 95 self.sslWidget.showCertificate(sslInfo)
96 self.securityDetailsButton.setEnabled(True)
97 else:
98 self.securityDetailsButton.setEnabled(False)
90 else: 99 else:
91 self.securityLabel.setStyleSheet(SiteInfoDialog.nokStyle) 100 self.securityLabel.setStyleSheet(SiteInfoDialog.nokStyle)
92 self.securityLabel.setText('<b>Connection is not encrypted.</b>') 101 self.securityLabel.setText('<b>Connection is not encrypted.</b>')
93 self.securityDetailsButton.setEnabled(False) 102 self.securityDetailsButton.setEnabled(False)
94 103

eric ide

mercurial