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