Helpviewer/SiteInfo/SiteInfoDialog.py

changeset 5736
000ea446ff4b
parent 5587
ea526b78ee6c
child 6048
82ad8ec9548c
equal deleted inserted replaced
5735:f606dbe20be6 5736:000ea446ff4b
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 import os 12 import os
13 13
14 from PyQt5.QtCore import pyqtSlot, QUrl, Qt, QFile, qVersion 14 from PyQt5.QtCore import pyqtSlot, QUrl, Qt, QFile
15 from PyQt5.QtGui import QPixmap, QCursor, QPainter, QColor, QBrush 15 from PyQt5.QtGui import QPixmap, QCursor, QPainter, QColor, QBrush
16 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QGraphicsScene, QMenu, \ 16 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QGraphicsScene, QMenu, \
17 QApplication, QListWidgetItem 17 QApplication, QListWidgetItem
18 from PyQt5.QtWebKit import QWebSettings 18 from PyQt5.QtWebKit import QWebSettings
19 19
27 SSL = False 27 SSL = False
28 28
29 from ..Download.DownloadUtilities import dataString 29 from ..Download.DownloadUtilities import dataString
30 30
31 import UI.PixmapCache 31 import UI.PixmapCache
32 from Globals import qVersionTuple
32 33
33 34
34 class SiteInfoDialog(QDialog, Ui_SiteInfoDialog): 35 class SiteInfoDialog(QDialog, Ui_SiteInfoDialog):
35 """ 36 """
36 Class implementing a dialog to show some information about a site. 37 Class implementing a dialog to show some information about a site.
106 encoding = QWebSettings.globalSettings().defaultTextEncoding() 107 encoding = QWebSettings.globalSettings().defaultTextEncoding()
107 self.encodingLabel.setText(encoding) 108 self.encodingLabel.setText(encoding)
108 109
109 # populate the Security info and the Security tab 110 # populate the Security info and the Security tab
110 if sslInfo and \ 111 if sslInfo and \
111 ((qVersion() >= "5.0.0" and not sslInfo[0].isBlacklisted()) or 112 ((qVersionTuple() >= (5, 0, 0) and
112 (qVersion() < "5.0.0" and sslInfo[0].isValid())): 113 not sslInfo[0].isBlacklisted()) or
114 (qVersionTuple() < (5, 0, 0) and sslInfo[0].isValid())):
113 self.securityLabel.setStyleSheet(SiteInfoDialog.okStyle) 115 self.securityLabel.setStyleSheet(SiteInfoDialog.okStyle)
114 self.securityLabel.setText('<b>Connection is encrypted.</b>') 116 self.securityLabel.setText('<b>Connection is encrypted.</b>')
115 if SSL: 117 if SSL:
116 self.sslWidget.showCertificateChain(sslInfo) 118 self.sslWidget.showCertificateChain(sslInfo)
117 self.securityDetailsButton.setEnabled(True) 119 self.securityDetailsButton.setEnabled(True)

eric ide

mercurial