13 from .Ui_EditorCalltipsQScintillaPage import Ui_EditorCalltipsQScintillaPage |
13 from .Ui_EditorCalltipsQScintillaPage import Ui_EditorCalltipsQScintillaPage |
14 |
14 |
15 import Preferences |
15 import Preferences |
16 |
16 |
17 |
17 |
18 class EditorCalltipsQScintillaPage(ConfigurationPageBase, |
18 class EditorCalltipsQScintillaPage( |
19 Ui_EditorCalltipsQScintillaPage): |
19 ConfigurationPageBase, Ui_EditorCalltipsQScintillaPage |
|
20 ): |
20 """ |
21 """ |
21 Class implementing the QScintilla Calltips configuration page. |
22 Class implementing the QScintilla Calltips configuration page. |
22 """ |
23 """ |
|
24 |
23 def __init__(self): |
25 def __init__(self): |
24 """ |
26 """ |
25 Constructor |
27 Constructor |
26 """ |
28 """ |
27 super().__init__() |
29 super().__init__() |
28 self.setupUi(self) |
30 self.setupUi(self) |
29 self.setObjectName("EditorCalltipsQScintillaPage") |
31 self.setObjectName("EditorCalltipsQScintillaPage") |
30 |
32 |
31 # set initial values |
33 # set initial values |
32 ctContext = Preferences.getEditor("CallTipsStyle") |
34 ctContext = Preferences.getEditor("CallTipsStyle") |
33 if ctContext == QsciScintilla.CallTipsStyle.CallTipsNoContext: |
35 if ctContext == QsciScintilla.CallTipsStyle.CallTipsNoContext: |
34 self.ctNoContextButton.setChecked(True) |
36 self.ctNoContextButton.setChecked(True) |
35 elif ( |
37 elif ctContext == QsciScintilla.CallTipsStyle.CallTipsNoAutoCompletionContext: |
36 ctContext == |
|
37 QsciScintilla.CallTipsStyle.CallTipsNoAutoCompletionContext |
|
38 ): |
|
39 self.ctNoAutoCompletionButton.setChecked(True) |
38 self.ctNoAutoCompletionButton.setChecked(True) |
40 elif ctContext == QsciScintilla.CallTipsStyle.CallTipsContext: |
39 elif ctContext == QsciScintilla.CallTipsStyle.CallTipsContext: |
41 self.ctContextButton.setChecked(True) |
40 self.ctContextButton.setChecked(True) |
42 |
41 |
43 def save(self): |
42 def save(self): |
44 """ |
43 """ |
45 Public slot to save the EditorCalltips configuration. |
44 Public slot to save the EditorCalltips configuration. |
46 """ |
45 """ |
47 if self.ctNoContextButton.isChecked(): |
46 if self.ctNoContextButton.isChecked(): |
48 Preferences.setEditor( |
47 Preferences.setEditor( |
49 "CallTipsStyle", |
48 "CallTipsStyle", QsciScintilla.CallTipsStyle.CallTipsNoContext |
50 QsciScintilla.CallTipsStyle.CallTipsNoContext) |
49 ) |
51 elif self.ctNoAutoCompletionButton.isChecked(): |
50 elif self.ctNoAutoCompletionButton.isChecked(): |
52 Preferences.setEditor( |
51 Preferences.setEditor( |
53 "CallTipsStyle", |
52 "CallTipsStyle", |
54 QsciScintilla.CallTipsStyle.CallTipsNoAutoCompletionContext) |
53 QsciScintilla.CallTipsStyle.CallTipsNoAutoCompletionContext, |
|
54 ) |
55 elif self.ctContextButton.isChecked(): |
55 elif self.ctContextButton.isChecked(): |
56 Preferences.setEditor( |
56 Preferences.setEditor( |
57 "CallTipsStyle", |
57 "CallTipsStyle", QsciScintilla.CallTipsStyle.CallTipsContext |
58 QsciScintilla.CallTipsStyle.CallTipsContext) |
58 ) |
59 |
59 |
60 |
60 |
61 def create(dlg): |
61 def create(dlg): |
62 """ |
62 """ |
63 Module function to create the configuration page. |
63 Module function to create the configuration page. |
64 |
64 |
65 @param dlg reference to the configuration dialog |
65 @param dlg reference to the configuration dialog |
66 @return reference to the instantiated page (ConfigurationPageBase) |
66 @return reference to the instantiated page (ConfigurationPageBase) |
67 """ |
67 """ |
68 page = EditorCalltipsQScintillaPage() |
68 page = EditorCalltipsQScintillaPage() |
69 return page |
69 return page |