5 |
5 |
6 """ |
6 """ |
7 Module implementing the Jedi Auto-completion configuration page. |
7 Module implementing the Jedi Auto-completion configuration page. |
8 """ |
8 """ |
9 |
9 |
10 from Preferences.ConfigurationPages.ConfigurationPageBase import ( |
10 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase |
11 ConfigurationPageBase |
|
12 ) |
|
13 from .Ui_EditorAutoCompletionJediPage import Ui_EditorAutoCompletionJediPage |
11 from .Ui_EditorAutoCompletionJediPage import Ui_EditorAutoCompletionJediPage |
14 |
12 |
15 import Preferences |
13 import Preferences |
16 |
14 |
17 |
15 |
18 class EditorAutoCompletionJediPage(ConfigurationPageBase, |
16 class EditorAutoCompletionJediPage( |
19 Ui_EditorAutoCompletionJediPage): |
17 ConfigurationPageBase, Ui_EditorAutoCompletionJediPage |
|
18 ): |
20 """ |
19 """ |
21 Class implementing the Jedi Auto-completion configuration page. |
20 Class implementing the Jedi Auto-completion configuration page. |
22 """ |
21 """ |
|
22 |
23 def __init__(self): |
23 def __init__(self): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 """ |
26 """ |
27 super().__init__() |
27 super().__init__() |
28 self.setupUi(self) |
28 self.setupUi(self) |
29 self.setObjectName("EditorAutoCompletionJediPage") |
29 self.setObjectName("EditorAutoCompletionJediPage") |
30 |
30 |
31 # set initial values |
31 # set initial values |
32 self.jediAutocompletionCheckBox.setChecked( |
32 self.jediAutocompletionCheckBox.setChecked( |
33 Preferences.getJedi("JediCompletionsEnabled")) |
33 Preferences.getJedi("JediCompletionsEnabled") |
|
34 ) |
34 self.jediFuzzyAutocompletionCheckBox.setChecked( |
35 self.jediFuzzyAutocompletionCheckBox.setChecked( |
35 Preferences.getJedi("JediFuzzyCompletionsEnabled")) |
36 Preferences.getJedi("JediFuzzyCompletionsEnabled") |
36 |
37 ) |
|
38 |
37 def save(self): |
39 def save(self): |
38 """ |
40 """ |
39 Public slot to save the Jedi Auto-completion configuration. |
41 Public slot to save the Jedi Auto-completion configuration. |
40 """ |
42 """ |
41 Preferences.setJedi( |
43 Preferences.setJedi( |
42 "JediCompletionsEnabled", |
44 "JediCompletionsEnabled", self.jediAutocompletionCheckBox.isChecked() |
43 self.jediAutocompletionCheckBox.isChecked()) |
45 ) |
44 Preferences.setJedi( |
46 Preferences.setJedi( |
45 "JediFuzzyCompletionsEnabled", |
47 "JediFuzzyCompletionsEnabled", |
46 self.jediFuzzyAutocompletionCheckBox.isChecked()) |
48 self.jediFuzzyAutocompletionCheckBox.isChecked(), |
|
49 ) |
47 |
50 |
48 |
51 |
49 def create(dlg): |
52 def create(dlg): |
50 """ |
53 """ |
51 Module function to create the configuration page. |
54 Module function to create the configuration page. |
52 |
55 |
53 @param dlg reference to the configuration dialog |
56 @param dlg reference to the configuration dialog |
54 @return reference to the instantiated page (ConfigurationPageBase) |
57 @return reference to the instantiated page (ConfigurationPageBase) |
55 """ |
58 """ |
56 page = EditorAutoCompletionJediPage() |
59 page = EditorAutoCompletionJediPage() |
57 return page |
60 return page |