Wed, 30 Dec 2020 11:00:05 +0100
Updated copyright for 2021.
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 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | 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
|
17 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | 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
|
19 | """ |
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
|
20 | 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
|
21 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | Constructor |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | @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
|
25 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | super(LogViewerPage, self).__init__() |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | 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
|
28 | 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
|
29 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | 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
|
31 | "<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
|
32 | "<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
|
33 | " 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
|
34 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | 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
|
36 | "<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
|
37 | "<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
|
38 | " 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
|
39 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | 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
|
41 | "<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
|
42 | "<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
|
43 | " 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
|
44 | )) |
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 | # 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
|
47 | 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
|
48 | 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
|
49 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | self.initColour( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | "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
|
52 | Preferences.getUI) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | 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
|
55 | 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
|
56 | 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
|
57 | 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
|
58 | 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
|
59 | 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
|
60 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | 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
|
62 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | 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
|
64 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | "LogViewerAutoRaise", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | 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
|
68 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | 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
|
70 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | "LogViewerStdoutFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | 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
|
74 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | "LogViewerStderrFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
76 | 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
|
77 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | "LogViewerStdxxxFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | 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
|
80 | |
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 | 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
|
83 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | 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
|
85 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | @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
|
87 | @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
|
88 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | page = LogViewerPage() |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | return page |