eric6/Preferences/ConfigurationPages/EditorGeneralPage.py

changeset 7998
cd41c844862f
parent 7923
91e843545d9a
child 8002
6002378278c9
equal deleted inserted replaced
7997:2ca23396c25c 7998:cd41c844862f
17 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage 17 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage
18 from .EditorLanguageTabIndentOverrideDialog import ( 18 from .EditorLanguageTabIndentOverrideDialog import (
19 EditorLanguageTabIndentOverrideDialog 19 EditorLanguageTabIndentOverrideDialog
20 ) 20 )
21 21
22 from QScintilla.DocstringGenerator import getSupportedDocstringTypes
23
22 import Preferences 24 import Preferences
23 import UI.PixmapCache 25 import UI.PixmapCache
24 26
25 27
26 class EditorGeneralPage(ConfigurationPageBase, Ui_EditorGeneralPage): 28 class EditorGeneralPage(ConfigurationPageBase, Ui_EditorGeneralPage):
36 self.setObjectName("EditorGeneralPage") 38 self.setObjectName("EditorGeneralPage")
37 39
38 self.addButton.setIcon(UI.PixmapCache.getIcon("plus")) 40 self.addButton.setIcon(UI.PixmapCache.getIcon("plus"))
39 self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus")) 41 self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus"))
40 self.editButton.setIcon(UI.PixmapCache.getIcon("edit")) 42 self.editButton.setIcon(UI.PixmapCache.getIcon("edit"))
43
44 for docstringType, docstringStyle in sorted(
45 getSupportedDocstringTypes()
46 ):
47 self.docstringStyleComboBox.addItem(docstringStyle, docstringType)
41 48
42 # set initial values 49 # set initial values
43 self.tabwidthSlider.setValue( 50 self.tabwidthSlider.setValue(
44 Preferences.getEditor("TabWidth")) 51 Preferences.getEditor("TabWidth"))
45 self.indentwidthSlider.setValue( 52 self.indentwidthSlider.setValue(
62 self.sourceOutlineWidthStepSpinBox.setValue( 69 self.sourceOutlineWidthStepSpinBox.setValue(
63 Preferences.getEditor("SourceOutlineStepSize")) 70 Preferences.getEditor("SourceOutlineStepSize"))
64 self.sourceOutlineShowCodingCheckBox.setChecked( 71 self.sourceOutlineShowCodingCheckBox.setChecked(
65 Preferences.getEditor("SourceOutlineShowCoding")) 72 Preferences.getEditor("SourceOutlineShowCoding"))
66 73
74 index = self.docstringStyleComboBox.findData(
75 Preferences.getEditor("DocstringType"))
76 self.docstringStyleComboBox.setCurrentIndex(index)
77
67 virtualSpaceOptions = Preferences.getEditor("VirtualSpaceOptions") 78 virtualSpaceOptions = Preferences.getEditor("VirtualSpaceOptions")
68 self.vsSelectionCheckBox.setChecked( 79 self.vsSelectionCheckBox.setChecked(
69 virtualSpaceOptions & QsciScintillaBase.SCVS_RECTANGULARSELECTION) 80 virtualSpaceOptions & QsciScintillaBase.SCVS_RECTANGULARSELECTION)
70 self.vsUserCheckBox.setChecked( 81 self.vsUserCheckBox.setChecked(
71 virtualSpaceOptions & QsciScintillaBase.SCVS_USERACCESSIBLE) 82 virtualSpaceOptions & QsciScintillaBase.SCVS_USERACCESSIBLE)
108 "SourceOutlineStepSize", 119 "SourceOutlineStepSize",
109 self.sourceOutlineWidthStepSpinBox.value()) 120 self.sourceOutlineWidthStepSpinBox.value())
110 Preferences.setEditor( 121 Preferences.setEditor(
111 "SourceOutlineShowCoding", 122 "SourceOutlineShowCoding",
112 self.sourceOutlineShowCodingCheckBox.isChecked()) 123 self.sourceOutlineShowCodingCheckBox.isChecked())
124
125 Preferences.setEditor(
126 "DocstringType",
127 self.docstringStyleComboBox.currentData())
113 128
114 virtualSpaceOptions = QsciScintillaBase.SCVS_NONE 129 virtualSpaceOptions = QsciScintillaBase.SCVS_NONE
115 if self.vsSelectionCheckBox.isChecked(): 130 if self.vsSelectionCheckBox.isChecked():
116 virtualSpaceOptions |= QsciScintillaBase.SCVS_RECTANGULARSELECTION 131 virtualSpaceOptions |= QsciScintillaBase.SCVS_RECTANGULARSELECTION
117 if self.vsUserCheckBox.isChecked(): 132 if self.vsUserCheckBox.isChecked():

eric ide

mercurial