Helpviewer/UrlBar/SslLabel.py

changeset 1341
6104ae9ceb55
parent 1131
7781e396c903
child 1366
f2e7957924cb
diff -r 913182fdc3dd -r 6104ae9ceb55 Helpviewer/UrlBar/SslLabel.py
--- a/Helpviewer/UrlBar/SslLabel.py	Mon Sep 26 18:07:55 2011 +0200
+++ b/Helpviewer/UrlBar/SslLabel.py	Tue Sep 27 19:03:52 2011 +0200
@@ -17,6 +17,9 @@
     """
     clicked = pyqtSignal()
     
+    okStyle = "QLabel { color : white; background-color : green; }"
+    nokStyle = "QLabel { color : white; background-color : red; }"
+    
     def __init__(self, parent=None):
         """
         Constructor
@@ -49,3 +52,14 @@
             self.clicked.emit()
         else:
             super().mouseDoubleClickEvent(evt)
+    
+    def setValidity(self, valid):
+        """
+        Public method to set the validity indication.
+        
+        @param valid flag indicating the certificate validity (boolean)
+        """
+        if valid:
+            self.setStyleSheet(SslLabel.okStyle)
+        else:
+            self.setStyleSheet(SslLabel.nokStyle)

eric ide

mercurial