Thu, 07 Oct 2010 09:07:22 +0200
Started implementing the SSL info display.
--- a/Helpviewer/HelpBrowserWV.py Wed Oct 06 19:54:56 2010 +0200 +++ b/Helpviewer/HelpBrowserWV.py Thu Oct 07 09:07:22 2010 +0200 @@ -326,6 +326,12 @@ @return reference to the SSL info (QSslCertificate) """ return self.__sslInfo + + def showSslInfo(self): + """ + Public slot to show some SSL information for the loaded page. + """ + # TODO: add code to show SSL data ##########################################################################################
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Helpviewer/UrlBar/SslLabel.py Thu Oct 07 09:07:22 2010 +0200 @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2010 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing the label to show some SSL info. +""" + +from PyQt4.QtCore import Qt, pyqtSignal +from PyQt4.QtGui import QLabel + +class SslLabel(QLabel): + """ + Class implementing the label to show some SSL info. + """ + clicked = pyqtSignal() + + def __init__(self, parent = None): + """ + Constructor + + @param parent reference to the parent widget (QWidget) + """ + QLabel.__init__(self, parent) + + self.setFocusPolicy(Qt.NoFocus) + self.setCursor(Qt.ArrowCursor) + + def mouseReleaseEvent(self, evt): + """ + Protected method to handle mouse release events. + + @param evt reference to the mouse event (QMouseEvent) + """ + if evt.button() == Qt.LeftButton: + self.clicked.emit() + else: + QLabel.mouseReleaseEvent(self, evt) + + def mouseDoubleClickEvent(self, evt): + """ + Protected method to handle mouse double click events. + + @param evt reference to the mouse event (QMouseEvent) + """ + if evt.button() == Qt.LeftButton: + self.clicked.emit() + else: + QLabel.mouseDoubleClickEvent(self, evt)
--- a/Helpviewer/UrlBar/UrlBar.py Wed Oct 06 19:54:56 2010 +0200 +++ b/Helpviewer/UrlBar/UrlBar.py Thu Oct 07 09:07:22 2010 +0200 @@ -8,7 +8,7 @@ """ from PyQt4.QtCore import Qt, QPointF, QUrl -from PyQt4.QtGui import QColor, QPalette, QApplication, QLinearGradient, QLabel +from PyQt4.QtGui import QColor, QPalette, QApplication, QLinearGradient from PyQt4.QtNetwork import QSslCertificate from PyQt4.QtWebKit import QWebSettings @@ -16,6 +16,7 @@ from E5Gui.E5LineEditButton import E5LineEditButton from .FavIconLabel import FavIconLabel +from .SslLabel import SslLabel import UI.PixmapCache import Preferences @@ -42,7 +43,7 @@ self.__favicon = FavIconLabel(self) self.addWidget(self.__favicon, E5LineEdit.LeftSide) - self.__sslLabel = QLabel(self) + self.__sslLabel = SslLabel(self) self.__sslLabel.setStyleSheet( "QLabel { color : white; background-color : green; }") self.addWidget(self.__sslLabel, E5LineEdit.LeftSide) @@ -76,6 +77,8 @@ self.__browser.loadProgress.connect(self.update) self.__browser.loadFinished.connect(self.__loadFinished) self.__browser.loadStarted.connect(self.__loadStarted) + + self.__sslLabel.clicked[()].connect(self.__browser.page().showSslInfo) def browser(self): """
--- a/eric5.e4p Wed Oct 06 19:54:56 2010 +0200 +++ b/eric5.e4p Thu Oct 07 09:07:22 2010 +0200 @@ -823,6 +823,7 @@ <Source>Helpviewer/UrlBar/UrlBar.py</Source> <Source>Helpviewer/UrlBar/FavIconLabel.py</Source> <Source>Helpviewer/UrlBar/StackedUrlBar.py</Source> + <Source>Helpviewer/UrlBar/SslLabel.py</Source> </Sources> <Forms> <Form>PyUnit/UnittestDialog.ui</Form>