15 with contextlib.suppress(ImportError): |
15 with contextlib.suppress(ImportError): |
16 from PyQt6.QtNetwork import QSslCertificate |
16 from PyQt6.QtNetwork import QSslCertificate |
17 |
17 |
18 from .Ui_EricSslCertificateSelectionDialog import Ui_EricSslCertificateSelectionDialog |
18 from .Ui_EricSslCertificateSelectionDialog import Ui_EricSslCertificateSelectionDialog |
19 |
19 |
20 import Utilities |
20 from eric7 import Utilities |
21 import UI.PixmapCache |
21 from eric7.EricGui import EricPixmapCache |
22 |
22 |
23 |
23 |
24 class EricSslCertificateSelectionDialog(QDialog, Ui_EricSslCertificateSelectionDialog): |
24 class EricSslCertificateSelectionDialog(QDialog, Ui_EricSslCertificateSelectionDialog): |
25 """ |
25 """ |
26 Class implementing a dialog to select a SSL certificate. |
26 Class implementing a dialog to select a SSL certificate. |
38 @type QWidget |
38 @type QWidget |
39 """ |
39 """ |
40 super().__init__(parent) |
40 super().__init__(parent) |
41 self.setupUi(self) |
41 self.setupUi(self) |
42 |
42 |
43 self.viewButton.setIcon(UI.PixmapCache.getIcon("certificates")) |
43 self.viewButton.setIcon(EricPixmapCache.getIcon("certificates")) |
44 |
44 |
45 self.buttonBox.button(QDialogButtonBox.OK).setEnabled(False) |
45 self.buttonBox.button(QDialogButtonBox.OK).setEnabled(False) |
46 self.viewButton.setEnabled(False) |
46 self.viewButton.setEnabled(False) |
47 |
47 |
48 self.__populateCertificatesTree(certificates) |
48 self.__populateCertificatesTree(certificates) |
112 def on_viewButton_clicked(self): |
112 def on_viewButton_clicked(self): |
113 """ |
113 """ |
114 Private slot to show data of the selected certificate. |
114 Private slot to show data of the selected certificate. |
115 """ |
115 """ |
116 with contextlib.suppress(ImportError): |
116 with contextlib.suppress(ImportError): |
117 from EricNetwork.EricSslCertificatesInfoDialog import ( |
117 from eric7.EricNetwork.EricSslCertificatesInfoDialog import ( |
118 EricSslCertificatesInfoDialog, |
118 EricSslCertificatesInfoDialog, |
119 ) |
119 ) |
120 |
120 |
121 cert = QSslCertificate.fromData( |
121 cert = QSslCertificate.fromData( |
122 self.certificatesTree.selectedItems()[0].data(0, self.CertRole) |
122 self.certificatesTree.selectedItems()[0].data(0, self.CertRole) |