eric7/Preferences/ConfigurationPages/LogViewerPage.py

branch
eric7
changeset 8869
3dbb04832c21
parent 8863
03e7c23a05b1
child 8879
159a4d6bab47
equal deleted inserted replaced
8868:612e9b9b5ad9 8869:3dbb04832c21
5 5
6 """ 6 """
7 Module implementing the Log Viewer configuration page. 7 Module implementing the Log Viewer configuration page.
8 """ 8 """
9 9
10 from PyQt6.QtCore import pyqtSlot
11 from PyQt6.QtGui import QColor
12
10 from .ConfigurationPageBase import ConfigurationPageBase 13 from .ConfigurationPageBase import ConfigurationPageBase
11 from .Ui_LogViewerPage import Ui_LogViewerPage 14 from .Ui_LogViewerPage import Ui_LogViewerPage
12 15
13 import Preferences 16 import Preferences
14 17
15 18
16 # TODO: add a line edit with an error sample
17 class LogViewerPage(ConfigurationPageBase, Ui_LogViewerPage): 19 class LogViewerPage(ConfigurationPageBase, Ui_LogViewerPage):
18 """ 20 """
19 Class implementing the Log Viewer configuration page. 21 Class implementing the Log Viewer configuration page.
20 """ 22 """
21 def __init__(self, parent=None): 23 def __init__(self, parent=None):
41 self.stdxxxFilterEdit.setListWhatsThis(self.tr( 43 self.stdxxxFilterEdit.setListWhatsThis(self.tr(
42 "<b>Message Filters for both</b>" 44 "<b>Message Filters for both</b>"
43 "<p>This list shows the configured message filters used to" 45 "<p>This list shows the configured message filters used to"
44 " suppress messages received via stdout or stderr.</p>" 46 " suppress messages received via stdout or stderr.</p>"
45 )) 47 ))
48
49 self.colourChanged.connect(self.__colorChanged)
46 50
47 # set initial values 51 # set initial values
48 self.lvAutoRaiseCheckBox.setChecked( 52 self.lvAutoRaiseCheckBox.setChecked(
49 Preferences.getUI("LogViewerAutoRaise")) 53 Preferences.getUI("LogViewerAutoRaise"))
50 54
77 self.stderrFilterEdit.getList()) 81 self.stderrFilterEdit.getList())
78 Preferences.setUI( 82 Preferences.setUI(
79 "LogViewerStdxxxFilter", 83 "LogViewerStdxxxFilter",
80 self.stdxxxFilterEdit.getList()) 84 self.stdxxxFilterEdit.getList())
81 85
86 @pyqtSlot(str, QColor)
87 def __colorChanged(self, colorKey, color):
88 """
89 Private slot handling the selection of a color.
90
91 @param colorKey key of the color entry
92 @type str
93 @param color selected color
94 @type QColor
95 """
96 if colorKey == "LogStdErrColour":
97 self.errorTextExample.setStyleSheet(f"color: {color.name()}")
82 98
83 def create(dlg): 99 def create(dlg):
84 """ 100 """
85 Module function to create the configuration page. 101 Module function to create the configuration page.
86 102

eric ide

mercurial