5 |
5 |
6 """ |
6 """ |
7 Module implementing the label to show some SSL info. |
7 Module implementing the label to show some SSL info. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import Qt, pyqtSignal |
10 from PyQt4.QtCore import Qt, pyqtSignal, QPoint |
11 from PyQt4.QtGui import QLabel |
11 from PyQt4.QtGui import QLabel |
12 |
12 |
13 |
13 |
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(QPoint) |
19 |
19 |
20 okStyle = "QLabel { color : white; background-color : green; }" |
20 okStyle = "QLabel { color : white; background-color : green; }" |
21 nokStyle = "QLabel { color : white; background-color : red; }" |
21 nokStyle = "QLabel { color : white; background-color : red; }" |
22 |
22 |
23 def __init__(self, parent=None): |
23 def __init__(self, parent=None): |
36 Protected method to handle mouse release events. |
36 Protected method to handle mouse release events. |
37 |
37 |
38 @param evt reference to the mouse event (QMouseEvent) |
38 @param evt reference to the mouse event (QMouseEvent) |
39 """ |
39 """ |
40 if evt.button() == Qt.LeftButton: |
40 if evt.button() == Qt.LeftButton: |
41 self.clicked.emit() |
41 self.clicked.emit(evt.globalPos()) |
42 else: |
42 else: |
43 super().mouseReleaseEvent(evt) |
43 super().mouseReleaseEvent(evt) |
44 |
44 |
45 def mouseDoubleClickEvent(self, evt): |
45 def mouseDoubleClickEvent(self, evt): |
46 """ |
46 """ |
47 Protected method to handle mouse double click events. |
47 Protected method to handle mouse double click events. |
48 |
48 |
49 @param evt reference to the mouse event (QMouseEvent) |
49 @param evt reference to the mouse event (QMouseEvent) |
50 """ |
50 """ |
51 if evt.button() == Qt.LeftButton: |
51 if evt.button() == Qt.LeftButton: |
52 self.clicked.emit() |
52 self.clicked.emit(evt.globalPos()) |
53 else: |
53 else: |
54 super().mouseDoubleClickEvent(evt) |
54 super().mouseDoubleClickEvent(evt) |
55 |
55 |
56 def setValidity(self, valid): |
56 def setValidity(self, valid): |
57 """ |
57 """ |