|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2008 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Rope Calltips configuration page. |
|
8 """ |
|
9 |
|
10 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
|
11 ConfigurationPageBase |
|
12 from .Ui_CallTipsRopePage import Ui_CallTipsRopePage |
|
13 |
|
14 class CallTipsRopePage(ConfigurationPageBase, Ui_CallTipsRopePage): |
|
15 """ |
|
16 Class implementing the Rope Calltips configuration page. |
|
17 """ |
|
18 def __init__(self, plugin): |
|
19 """ |
|
20 Constructor |
|
21 |
|
22 @param plugin reference to the plugin object |
|
23 """ |
|
24 ConfigurationPageBase.__init__(self) |
|
25 self.setupUi(self) |
|
26 self.setObjectName("CallTipsRopePage") |
|
27 |
|
28 self.__plugin = plugin |
|
29 |
|
30 # set initial values |
|
31 self.ropeCalltipsCheckBox.setChecked( |
|
32 self.__plugin.getPreferences("CodeAssistCalltipsEnabled")) |
|
33 self.ctMaxfixesSpinBox.setValue( |
|
34 self.__plugin.getPreferences("CalltipsMaxFixes")) |
|
35 |
|
36 def save(self): |
|
37 """ |
|
38 Public slot to save the Rope Calltips configuration. |
|
39 """ |
|
40 self.__plugin.setPreferences( |
|
41 "CodeAssistCalltipsEnabled", self.ropeCalltipsCheckBox.isChecked()) |
|
42 self.__plugin.setPreferences( |
|
43 "CalltipsMaxFixes", self.ctMaxfixesSpinBox.value()) |