Preferences/ConfigurationPages/EditorTypingPage.py

changeset 7
c679fb30c8f3
parent 0
de9c2efb9d02
child 12
1d8dd9706f46
equal deleted inserted replaced
6:52e8c820d0dd 7:c679fb30c8f3
5 5
6 """ 6 """
7 Module implementing the Editor Typing configuration page. 7 Module implementing the Editor Typing configuration page.
8 """ 8 """
9 9
10 from PyQt4.QtCore import QVariant, pyqtSlot 10 from PyQt4.QtCore import pyqtSlot
11 11
12 from ConfigurationPageBase import ConfigurationPageBase 12 from ConfigurationPageBase import ConfigurationPageBase
13 from Ui_EditorTypingPage import Ui_EditorTypingPage 13 from Ui_EditorTypingPage import Ui_EditorTypingPage
14 14
15 import Preferences 15 import Preferences
32 self.pageIds['Python'] = self.stackedWidget.indexOf(self.pythonPage) 32 self.pageIds['Python'] = self.stackedWidget.indexOf(self.pythonPage)
33 self.pageIds['Ruby'] = self.stackedWidget.indexOf(self.rubyPage) 33 self.pageIds['Ruby'] = self.stackedWidget.indexOf(self.rubyPage)
34 languages = self.pageIds.keys() 34 languages = self.pageIds.keys()
35 languages.sort() 35 languages.sort()
36 for language in languages: 36 for language in languages:
37 self.languageCombo.addItem(language, QVariant(self.pageIds[language])) 37 self.languageCombo.addItem(language, self.pageIds[language])
38 38
39 # Python 39 # Python
40 self.pythonGroup.setChecked(\ 40 self.pythonGroup.setChecked(\
41 Preferences.getEditorTyping("Python/EnabledTypingAids")) 41 Preferences.getEditorTyping("Python/EnabledTypingAids"))
42 self.pythonInsertClosingBraceCheckBox.setChecked(\ 42 self.pythonInsertClosingBraceCheckBox.setChecked(\
88 """ 88 """
89 Public slot to save the Editor Typing configuration. 89 Public slot to save the Editor Typing configuration.
90 """ 90 """
91 # Python 91 # Python
92 Preferences.setEditorTyping("Python/EnabledTypingAids", 92 Preferences.setEditorTyping("Python/EnabledTypingAids",
93 int(self.pythonGroup.isChecked())) 93 self.pythonGroup.isChecked())
94 Preferences.setEditorTyping("Python/InsertClosingBrace", 94 Preferences.setEditorTyping("Python/InsertClosingBrace",
95 int(self.pythonInsertClosingBraceCheckBox.isChecked())) 95 self.pythonInsertClosingBraceCheckBox.isChecked())
96 Preferences.setEditorTyping("Python/SkipBrace", 96 Preferences.setEditorTyping("Python/SkipBrace",
97 int(self.pythonSkipBraceCheckBox.isChecked())) 97 self.pythonSkipBraceCheckBox.isChecked())
98 Preferences.setEditorTyping("Python/IndentBrace", 98 Preferences.setEditorTyping("Python/IndentBrace",
99 int(self.pythonIndentBraceCheckBox.isChecked())) 99 self.pythonIndentBraceCheckBox.isChecked())
100 Preferences.setEditorTyping("Python/InsertQuote", 100 Preferences.setEditorTyping("Python/InsertQuote",
101 int(self.pythonInsertQuoteCheckBox.isChecked())) 101 self.pythonInsertQuoteCheckBox.isChecked())
102 Preferences.setEditorTyping("Python/DedentElse", 102 Preferences.setEditorTyping("Python/DedentElse",
103 int(self.pythonDedentElseCheckBox.isChecked())) 103 self.pythonDedentElseCheckBox.isChecked())
104 Preferences.setEditorTyping("Python/DedentExcept", 104 Preferences.setEditorTyping("Python/DedentExcept",
105 int(self.pythonDedentExceptCheckBox.isChecked())) 105 self.pythonDedentExceptCheckBox.isChecked())
106 Preferences.setEditorTyping("Python/Py24StyleTry", 106 Preferences.setEditorTyping("Python/Py24StyleTry",
107 int(self.pythonDedentExceptPy24CheckBox.isChecked())) 107 self.pythonDedentExceptPy24CheckBox.isChecked())
108 Preferences.setEditorTyping("Python/InsertImport", 108 Preferences.setEditorTyping("Python/InsertImport",
109 int(self.pythonInsertImportCheckBox.isChecked())) 109 self.pythonInsertImportCheckBox.isChecked())
110 Preferences.setEditorTyping("Python/InsertSelf", 110 Preferences.setEditorTyping("Python/InsertSelf",
111 int(self.pythonInsertSelfCheckBox.isChecked())) 111 self.pythonInsertSelfCheckBox.isChecked())
112 Preferences.setEditorTyping("Python/InsertBlank", 112 Preferences.setEditorTyping("Python/InsertBlank",
113 int(self.pythonInsertBlankCheckBox.isChecked())) 113 self.pythonInsertBlankCheckBox.isChecked())
114 Preferences.setEditorTyping("Python/ColonDetection", 114 Preferences.setEditorTyping("Python/ColonDetection",
115 int(self.pythonColonDetectionCheckBox.isChecked())) 115 self.pythonColonDetectionCheckBox.isChecked())
116 Preferences.setEditorTyping("Python/DedentDef", 116 Preferences.setEditorTyping("Python/DedentDef",
117 int(self.pythonDedentDefCheckBox.isChecked())) 117 self.pythonDedentDefCheckBox.isChecked())
118 118
119 # Ruby 119 # Ruby
120 Preferences.setEditorTyping("Ruby/EnabledTypingAids", 120 Preferences.setEditorTyping("Ruby/EnabledTypingAids",
121 int(self.rubyGroup.isChecked())) 121 self.rubyGroup.isChecked())
122 Preferences.setEditorTyping("Ruby/InsertClosingBrace", 122 Preferences.setEditorTyping("Ruby/InsertClosingBrace",
123 int(self.rubyInsertClosingBraceCheckBox.isChecked())) 123 self.rubyInsertClosingBraceCheckBox.isChecked())
124 Preferences.setEditorTyping("Ruby/SkipBrace", 124 Preferences.setEditorTyping("Ruby/SkipBrace",
125 int(self.rubySkipBraceCheckBox.isChecked())) 125 self.rubySkipBraceCheckBox.isChecked())
126 Preferences.setEditorTyping("Ruby/IndentBrace", 126 Preferences.setEditorTyping("Ruby/IndentBrace",
127 int(self.rubyIndentBraceCheckBox.isChecked())) 127 self.rubyIndentBraceCheckBox.isChecked())
128 Preferences.setEditorTyping("Ruby/InsertQuote", 128 Preferences.setEditorTyping("Ruby/InsertQuote",
129 int(self.rubyInsertQuoteCheckBox.isChecked())) 129 self.rubyInsertQuoteCheckBox.isChecked())
130 Preferences.setEditorTyping("Ruby/InsertBlank", 130 Preferences.setEditorTyping("Ruby/InsertBlank",
131 int(self.rubyInsertBlankCheckBox.isChecked())) 131 self.rubyInsertBlankCheckBox.isChecked())
132 Preferences.setEditorTyping("Ruby/InsertHereDoc", 132 Preferences.setEditorTyping("Ruby/InsertHereDoc",
133 int(self.rubyInsertHereDocCheckBox.isChecked())) 133 self.rubyInsertHereDocCheckBox.isChecked())
134 Preferences.setEditorTyping("Ruby/InsertInlineDoc", 134 Preferences.setEditorTyping("Ruby/InsertInlineDoc",
135 int(self.rubyInsertInlineDocCheckBox.isChecked())) 135 self.rubyInsertInlineDocCheckBox.isChecked())
136 136
137 @pyqtSlot(str) 137 @pyqtSlot(str)
138 def on_languageCombo_activated(self, language): 138 def on_languageCombo_activated(self, language):
139 """ 139 """
140 Private slot to select the page related to the selected language. 140 Private slot to select the page related to the selected language.

eric ide

mercurial