src/eric7/Preferences/ConfigurationPages/EditorSyntaxPage.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
15 15
16 class EditorSyntaxPage(ConfigurationPageBase, Ui_EditorSyntaxPage): 16 class EditorSyntaxPage(ConfigurationPageBase, Ui_EditorSyntaxPage):
17 """ 17 """
18 Class implementing the Editor Syntax Checker configuration page. 18 Class implementing the Editor Syntax Checker configuration page.
19 """ 19 """
20
20 def __init__(self): 21 def __init__(self):
21 """ 22 """
22 Constructor 23 Constructor
23 """ 24 """
24 super().__init__() 25 super().__init__()
25 self.setupUi(self) 26 self.setupUi(self)
26 self.setObjectName("EditorSyntaxPage") 27 self.setObjectName("EditorSyntaxPage")
27 28
28 # set initial values 29 # set initial values
29 self.onlineCheckBox.setChecked( 30 self.onlineCheckBox.setChecked(Preferences.getEditor("OnlineSyntaxCheck"))
30 Preferences.getEditor("OnlineSyntaxCheck"))
31 self.onlineTimeoutSpinBox.setValue( 31 self.onlineTimeoutSpinBox.setValue(
32 Preferences.getEditor("OnlineSyntaxCheckInterval")) 32 Preferences.getEditor("OnlineSyntaxCheckInterval")
33 )
33 self.automaticSyntaxCheckCheckBox.setChecked( 34 self.automaticSyntaxCheckCheckBox.setChecked(
34 Preferences.getEditor("AutoCheckSyntax")) 35 Preferences.getEditor("AutoCheckSyntax")
35 36 )
37
36 # pyflakes related stuff 38 # pyflakes related stuff
37 self.includeCheckBox.setChecked( 39 self.includeCheckBox.setChecked(Preferences.getFlakes("IncludeInSyntaxCheck"))
38 Preferences.getFlakes("IncludeInSyntaxCheck"))
39 self.ignoreStarImportCheckBox.setChecked( 40 self.ignoreStarImportCheckBox.setChecked(
40 Preferences.getFlakes("IgnoreStarImportWarnings")) 41 Preferences.getFlakes("IgnoreStarImportWarnings")
41 42 )
43
42 def save(self): 44 def save(self):
43 """ 45 """
44 Public slot to save the Editor Syntax Checker configuration. 46 Public slot to save the Editor Syntax Checker configuration.
45 """ 47 """
48 Preferences.setEditor("OnlineSyntaxCheck", self.onlineCheckBox.isChecked())
46 Preferences.setEditor( 49 Preferences.setEditor(
47 "OnlineSyntaxCheck", 50 "OnlineSyntaxCheckInterval", self.onlineTimeoutSpinBox.value()
48 self.onlineCheckBox.isChecked()) 51 )
49 Preferences.setEditor( 52 Preferences.setEditor(
50 "OnlineSyntaxCheckInterval", 53 "AutoCheckSyntax", self.automaticSyntaxCheckCheckBox.isChecked()
51 self.onlineTimeoutSpinBox.value()) 54 )
52 Preferences.setEditor( 55
53 "AutoCheckSyntax",
54 self.automaticSyntaxCheckCheckBox.isChecked())
55
56 # pyflakes related stuff 56 # pyflakes related stuff
57 Preferences.setFlakes("IncludeInSyntaxCheck", self.includeCheckBox.isChecked())
57 Preferences.setFlakes( 58 Preferences.setFlakes(
58 "IncludeInSyntaxCheck", 59 "IgnoreStarImportWarnings", self.ignoreStarImportCheckBox.isChecked()
59 self.includeCheckBox.isChecked()) 60 )
60 Preferences.setFlakes(
61 "IgnoreStarImportWarnings",
62 self.ignoreStarImportCheckBox.isChecked())
63 61
64 62
65 def create(dlg): 63 def create(dlg):
66 """ 64 """
67 Module function to create the configuration page. 65 Module function to create the configuration page.
68 66
69 @param dlg reference to the configuration dialog 67 @param dlg reference to the configuration dialog
70 @return reference to the instantiated page (ConfigurationPageBase) 68 @return reference to the instantiated page (ConfigurationPageBase)
71 """ 69 """
72 page = EditorSyntaxPage() 70 page = EditorSyntaxPage()
73 return page 71 return page

eric ide

mercurial