src/eric7/WebBrowser/UrlBar/SslLabel.py

Sun, 26 Feb 2023 12:44:03 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 26 Feb 2023 12:44:03 +0100
branch
mpy_network
changeset 9803
2ab3de60b51c
parent 9653
e67609152c5e
child 10436
f6881d10e995
permissions
-rw-r--r--

MicroPython
- fixed an issue checking, if the device data is available

# -*- coding: utf-8 -*-

# Copyright (c) 2020 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the label to show some SSL info (if available).
"""

from PyQt6.QtCore import Qt

from eric7.EricWidgets.EricClickableLabel import EricClickableLabel


class SslLabel(EricClickableLabel):
    """
    Class implementing the label to show some SSL info (if available).
    """

    okStyle = "QLabel { color : white; background-color : green; }"
    nokStyle = "QLabel { color : white; background-color : red; }"

    def __init__(self, parent=None):
        """
        Constructor

        @param parent reference to the parent widget (QWidget)
        """
        super().__init__(parent)

        self.setFocusPolicy(Qt.FocusPolicy.NoFocus)

    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