Tue, 28 Dec 2021 15:02:01 +0100
Added some TODO markers.
4095
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
7923
91e843545d9a
Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
3 | # Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de> |
4095
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the Log Viewer configuration page. |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | from .ConfigurationPageBase import ConfigurationPageBase |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | from .Ui_LogViewerPage import Ui_LogViewerPage |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | import Preferences |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
8863
03e7c23a05b1
Added some TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
16 | # TODO: add a line edit with an error sample |
4095
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | class LogViewerPage(ConfigurationPageBase, Ui_LogViewerPage): |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | Class implementing the Log Viewer configuration page. |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | """ |
4097
ad2a6bd965d9
Added a configuration page to edit the list of mime types to be opened in an eric editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4095
diff
changeset
|
21 | def __init__(self, parent=None): |
4095
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | Constructor |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | @param parent reference to the parent widget (QWidget) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
27 | super().__init__() |
4095
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | self.setupUi(self) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | self.setObjectName("LogViewerPage") |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | self.stdoutFilterEdit.setListWhatsThis(self.tr( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | "<b>Message Filters for Standard Output</b>" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | "<p>This list shows the configured message filters used to" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | " suppress messages received via stdout.</p>" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | self.stderrFilterEdit.setListWhatsThis(self.tr( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | "<b>Message Filters for Standard Error </b>" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | "<p>This list shows the configured message filters used to" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | " suppress messages received via stderr.</p>" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | self.stdxxxFilterEdit.setListWhatsThis(self.tr( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | "<b>Message Filters for both</b>" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | "<p>This list shows the configured message filters used to" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | " suppress messages received via stdout or stderr.</p>" |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | # set initial values |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | self.lvAutoRaiseCheckBox.setChecked( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | Preferences.getUI("LogViewerAutoRaise")) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | self.initColour( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | "LogStdErrColour", self.stderrTextColourButton, |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | Preferences.getUI) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | self.stdoutFilterEdit.setList( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | Preferences.getUI("LogViewerStdoutFilter")) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | self.stderrFilterEdit.setList( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | Preferences.getUI("LogViewerStderrFilter")) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | self.stdxxxFilterEdit.setList( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | Preferences.getUI("LogViewerStdxxxFilter")) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | def save(self): |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | Public slot to save the Interface configuration. |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | "LogViewerAutoRaise", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | self.lvAutoRaiseCheckBox.isChecked()) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | self.saveColours(Preferences.setUI) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | "LogViewerStdoutFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | self.stdoutFilterEdit.getList()) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
76 | "LogViewerStderrFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | self.stderrFilterEdit.getList()) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | "LogViewerStdxxxFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | self.stdxxxFilterEdit.getList()) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | def create(dlg): |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | Module function to create the configuration page. |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | @param dlg reference to the configuration dialog |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | @return reference to the instantiated page (ConfigurationPageBase) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | page = LogViewerPage() |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | return page |