14 class SslLabel(QLabel): |
14 class SslLabel(QLabel): |
15 """ |
15 """ |
16 Class implementing the label to show some SSL info. |
16 Class implementing the label to show some SSL info. |
17 """ |
17 """ |
18 clicked = pyqtSignal() |
18 clicked = pyqtSignal() |
|
19 |
|
20 okStyle = "QLabel { color : white; background-color : green; }" |
|
21 nokStyle = "QLabel { color : white; background-color : red; }" |
19 |
22 |
20 def __init__(self, parent=None): |
23 def __init__(self, parent=None): |
21 """ |
24 """ |
22 Constructor |
25 Constructor |
23 |
26 |
47 """ |
50 """ |
48 if evt.button() == Qt.LeftButton: |
51 if evt.button() == Qt.LeftButton: |
49 self.clicked.emit() |
52 self.clicked.emit() |
50 else: |
53 else: |
51 super().mouseDoubleClickEvent(evt) |
54 super().mouseDoubleClickEvent(evt) |
|
55 |
|
56 def setValidity(self, valid): |
|
57 """ |
|
58 Public method to set the validity indication. |
|
59 |
|
60 @param valid flag indicating the certificate validity (boolean) |
|
61 """ |
|
62 if valid: |
|
63 self.setStyleSheet(SslLabel.okStyle) |
|
64 else: |
|
65 self.setStyleSheet(SslLabel.nokStyle) |