14 QCursor, QApplication, QFileDialog |
14 QCursor, QApplication, QFileDialog |
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 |
43 self.setupUi(self) |
48 self.setupUi(self) |
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-security.png")) |
53 if SSL: |
|
54 self.tabWidget.setTabIcon(2, UI.PixmapCache.getIcon("siteinfo-security.png")) |
49 |
55 |
50 frame = browser.page().mainFrame() |
56 frame = browser.page().mainFrame() |
51 title = browser.title() |
57 title = browser.title() |
52 sslInfo = browser.page().getSslInfo() |
58 sslInfo = browser.page().getSslInfo() |
53 |
59 |
82 |
88 |
83 # populate the Security info and the Security tab |
89 # populate the Security info and the Security tab |
84 if sslInfo is not None and sslInfo.isValid(): |
90 if sslInfo is not None and sslInfo.isValid(): |
85 self.securityLabel.setStyleSheet(SiteInfoDialog.okStyle) |
91 self.securityLabel.setStyleSheet(SiteInfoDialog.okStyle) |
86 self.securityLabel.setText('<b>Connection is encrypted.</b>') |
92 self.securityLabel.setText('<b>Connection is encrypted.</b>') |
87 self.sslWidget.showCertificate(sslInfo) |
93 if SSL: |
88 self.securityDetailsButton.setEnabled(True) |
94 self.sslWidget.showCertificate(sslInfo) |
|
95 self.securityDetailsButton.setEnabled(True) |
|
96 else: |
|
97 self.securityDetailsButton.setEnabled(False) |
89 else: |
98 else: |
90 self.securityLabel.setStyleSheet(SiteInfoDialog.nokStyle) |
99 self.securityLabel.setStyleSheet(SiteInfoDialog.nokStyle) |
91 self.securityLabel.setText('<b>Connection is not encrypted.</b>') |
100 self.securityLabel.setText('<b>Connection is not encrypted.</b>') |
92 self.securityDetailsButton.setEnabled(False) |
101 self.securityDetailsButton.setEnabled(False) |
93 |
102 |