Preferences/ConfigurationPages/EditorAutocompletionPage.py

changeset 0
de9c2efb9d02
child 7
c679fb30c8f3
equal deleted inserted replaced
-1:000000000000 0:de9c2efb9d02
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2006 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the Editor Autocompletion configuration page.
8 """
9
10 from ConfigurationPageBase import ConfigurationPageBase
11 from Ui_EditorAutocompletionPage import Ui_EditorAutocompletionPage
12
13 import Preferences
14
15 class EditorAutocompletionPage(ConfigurationPageBase, Ui_EditorAutocompletionPage):
16 """
17 Class implementing the Editor Autocompletion configuration page.
18 """
19 def __init__(self):
20 """
21 Constructor
22 """
23 ConfigurationPageBase.__init__(self)
24 self.setupUi(self)
25 self.setObjectName("EditorAutocompletionPage")
26
27 # set initial values
28 self.acEnabledCheckBox.setChecked(\
29 Preferences.getEditor("AutoCompletionEnabled"))
30 self.acCaseSensitivityCheckBox.setChecked(\
31 Preferences.getEditor("AutoCompletionCaseSensitivity"))
32 self.acReplaceWordCheckBox.setChecked(\
33 Preferences.getEditor("AutoCompletionReplaceWord"))
34 self.acThresholdSlider.setValue(\
35 Preferences.getEditor("AutoCompletionThreshold"))
36
37 def save(self):
38 """
39 Public slot to save the Editor Autocompletion configuration.
40 """
41 Preferences.setEditor("AutoCompletionEnabled",
42 int(self.acEnabledCheckBox.isChecked()))
43 Preferences.setEditor("AutoCompletionCaseSensitivity",
44 int(self.acCaseSensitivityCheckBox.isChecked()))
45 Preferences.setEditor("AutoCompletionReplaceWord",
46 int(self.acReplaceWordCheckBox.isChecked()))
47 Preferences.setEditor("AutoCompletionThreshold",
48 self.acThresholdSlider.value())
49
50 def create(dlg):
51 """
52 Module function to create the configuration page.
53
54 @param dlg reference to the configuration dialog
55 """
56 page = EditorAutocompletionPage()
57 return page

eric ide

mercurial