--- a/eric7/Preferences/ConfigurationPages/LogViewerPage.py Tue Dec 28 15:48:39 2021 +0100 +++ b/eric7/Preferences/ConfigurationPages/LogViewerPage.py Tue Dec 28 16:36:53 2021 +0100 @@ -7,13 +7,15 @@ Module implementing the Log Viewer configuration page. """ +from PyQt6.QtCore import pyqtSlot +from PyQt6.QtGui import QColor + from .ConfigurationPageBase import ConfigurationPageBase from .Ui_LogViewerPage import Ui_LogViewerPage import Preferences -# TODO: add a line edit with an error sample class LogViewerPage(ConfigurationPageBase, Ui_LogViewerPage): """ Class implementing the Log Viewer configuration page. @@ -44,6 +46,8 @@ " suppress messages received via stdout or stderr.</p>" )) + self.colourChanged.connect(self.__colorChanged) + # set initial values self.lvAutoRaiseCheckBox.setChecked( Preferences.getUI("LogViewerAutoRaise")) @@ -79,6 +83,18 @@ "LogViewerStdxxxFilter", self.stdxxxFilterEdit.getList()) + @pyqtSlot(str, QColor) + def __colorChanged(self, colorKey, color): + """ + Private slot handling the selection of a color. + + @param colorKey key of the color entry + @type str + @param color selected color + @type QColor + """ + if colorKey == "LogStdErrColour": + self.errorTextExample.setStyleSheet(f"color: {color.name()}") def create(dlg): """