src/eric7/Preferences/ConfigurationPages/EditorSyntaxPage.py

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8881
54e42bc2437a
child 9221
bf71ee032bb4
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2011 - 2022 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):
21 """
22 Constructor
23 """
24 super().__init__()
25 self.setupUi(self)
26 self.setObjectName("EditorSyntaxPage")
27
28 # set initial values
29 self.onlineCheckBox.setChecked(
30 Preferences.getEditor("OnlineSyntaxCheck"))
31 self.onlineTimeoutSpinBox.setValue(
32 Preferences.getEditor("OnlineSyntaxCheckInterval"))
33 self.automaticSyntaxCheckCheckBox.setChecked(
34 Preferences.getEditor("AutoCheckSyntax"))
35
36 # pyflakes related stuff
37 self.includeCheckBox.setChecked(
38 Preferences.getFlakes("IncludeInSyntaxCheck"))
39 self.ignoreStarImportCheckBox.setChecked(
40 Preferences.getFlakes("IgnoreStarImportWarnings"))
41
42 def save(self):
43 """
44 Public slot to save the Editor Syntax Checker configuration.
45 """
46 Preferences.setEditor(
47 "OnlineSyntaxCheck",
48 self.onlineCheckBox.isChecked())
49 Preferences.setEditor(
50 "OnlineSyntaxCheckInterval",
51 self.onlineTimeoutSpinBox.value())
52 Preferences.setEditor(
53 "AutoCheckSyntax",
54 self.automaticSyntaxCheckCheckBox.isChecked())
55
56 # pyflakes related stuff
57 Preferences.setFlakes(
58 "IncludeInSyntaxCheck",
59 self.includeCheckBox.isChecked())
60 Preferences.setFlakes(
61 "IgnoreStarImportWarnings",
62 self.ignoreStarImportCheckBox.isChecked())
63
64
65 def create(dlg):
66 """
67 Module function to create the configuration page.
68
69 @param dlg reference to the configuration dialog
70 @return reference to the instantiated page (ConfigurationPageBase)
71 """
72 page = EditorSyntaxPage()
73 return page

eric ide

mercurial