|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2008 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Rope Autocompletion configuration page. |
|
8 """ |
|
9 |
|
10 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
|
11 ConfigurationPageBase |
|
12 from .Ui_AutoCompletionRopePage import Ui_AutoCompletionRopePage |
|
13 |
|
14 |
|
15 class AutoCompletionRopePage(ConfigurationPageBase, Ui_AutoCompletionRopePage): |
|
16 """ |
|
17 Class implementing the Rope Autocompletion configuration page. |
|
18 """ |
|
19 def __init__(self, plugin): |
|
20 """ |
|
21 Constructor |
|
22 |
|
23 @param plugin reference to the plugin object |
|
24 """ |
|
25 ConfigurationPageBase.__init__(self) |
|
26 self.setupUi(self) |
|
27 self.setObjectName("AutoCompletionRopePage") |
|
28 |
|
29 self.__plugin = plugin |
|
30 |
|
31 # set initial values |
|
32 self.ropeAutocompletionCheckBox.setChecked( |
|
33 self.__plugin.getPreferences("CodeAssistEnabled")) |
|
34 self.acMaxfixesSpinBox.setValue( |
|
35 self.__plugin.getPreferences("MaxFixes")) |
|
36 self.codeAssistTimeoutSpinBox.setValue( |
|
37 self.__plugin.getPreferences("CodeAssistTimeout")) |
|
38 self.qscintillaCheckBox.setChecked( |
|
39 self.__plugin.getPreferences("ShowQScintillaCompletions")) |
|
40 |
|
41 def save(self): |
|
42 """ |
|
43 Public slot to save the Rope Autocompletion configuration. |
|
44 """ |
|
45 self.__plugin.setPreferences( |
|
46 "CodeAssistEnabled", self.ropeAutocompletionCheckBox.isChecked()) |
|
47 self.__plugin.setPreferences( |
|
48 "MaxFixes", self.acMaxfixesSpinBox.value()) |
|
49 self.__plugin.setPreferences( |
|
50 "CodeAssistTimeout", self.codeAssistTimeoutSpinBox.value()) |
|
51 self.__plugin.setPreferences( |
|
52 "ShowQScintillaCompletions", self.qscintillaCheckBox.isChecked()) |