Fri, 01 Jan 2016 12:12:12 +0100
Updated copyright for 2016.
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 | |
4631
5c1a96925da4
Updated copyright for 2016.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4097
diff
changeset
|
3 | # Copyright (c) 2006 - 2016 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 __future__ import unicode_literals |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | 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
|
13 | 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
|
14 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | import Preferences |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | |
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 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
|
19 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | 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
|
21 | """ |
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
|
22 | 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
|
23 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | Constructor |
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 | @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
|
27 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | 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
|
29 | 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
|
30 | 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
|
31 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | 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
|
33 | "<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
|
34 | "<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
|
35 | " 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
|
36 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | 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
|
38 | "<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
|
39 | "<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
|
40 | " 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
|
41 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | 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
|
43 | "<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
|
44 | "<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
|
45 | " 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
|
46 | )) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | # 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
|
49 | 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
|
50 | 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
|
51 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | self.initColour( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | "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
|
54 | Preferences.getUI) |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | 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
|
57 | 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
|
58 | 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
|
59 | 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
|
60 | 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
|
61 | 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
|
62 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | 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
|
64 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | 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
|
66 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | "LogViewerAutoRaise", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | 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
|
70 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | 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
|
72 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | "LogViewerStdoutFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | 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
|
76 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | "LogViewerStderrFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | 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
|
79 | Preferences.setUI( |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | "LogViewerStdxxxFilter", |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | 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
|
82 | |
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 | 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
|
85 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | 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
|
87 | |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | @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
|
89 | @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
|
90 | """ |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | page = LogViewerPage() |
c78cdc1a3c14
Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | return page |