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