|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2011 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Editor Syntax Checker configuration page. |
|
8 """ |
|
9 |
|
10 from .ConfigurationPageBase import ConfigurationPageBase |
|
11 from .Ui_EditorSyntaxPage import Ui_EditorSyntaxPage |
|
12 |
|
13 import Preferences |
|
14 |
|
15 |
|
16 class EditorSyntaxPage(ConfigurationPageBase, Ui_EditorSyntaxPage): |
|
17 """ |
|
18 Class implementing the Editor Syntax Checker configuration page. |
|
19 """ |
|
20 def __init__(self, parent=None): |
|
21 """ |
|
22 Constructor |
|
23 |
|
24 @param parent reference to the parent widget (QWidget) |
|
25 """ |
|
26 super().__init__() |
|
27 self.setupUi(self) |
|
28 self.setObjectName("EditorSyntaxPage") |
|
29 |
|
30 # set initial values |
|
31 self.onlineCheckBox.setChecked( |
|
32 Preferences.getEditor("OnlineSyntaxCheck")) |
|
33 self.onlineTimeoutSpinBox.setValue( |
|
34 Preferences.getEditor("OnlineSyntaxCheckInterval")) |
|
35 self.automaticSyntaxCheckCheckBox.setChecked( |
|
36 Preferences.getEditor("AutoCheckSyntax")) |
|
37 |
|
38 def save(self): |
|
39 """ |
|
40 Public slot to save the Editor Syntax Checker configuration. |
|
41 """ |
|
42 Preferences.setEditor("OnlineSyntaxCheck", |
|
43 self.onlineCheckBox.isChecked()) |
|
44 Preferences.setEditor("OnlineSyntaxCheckInterval", |
|
45 self.onlineTimeoutSpinBox.value()) |
|
46 Preferences.setEditor("AutoCheckSyntax", |
|
47 self.automaticSyntaxCheckCheckBox.isChecked()) |
|
48 |
|
49 |
|
50 def create(dlg): |
|
51 """ |
|
52 Module function to create the configuration page. |
|
53 |
|
54 @param dlg reference to the configuration dialog |
|
55 """ |
|
56 page = EditorSyntaxPage() |
|
57 return page |