Preferences/ConfigurationPages/EditorStylesPage.py

changeset 2262
2371836c3c45
parent 2261
f4bb5648fc29
child 2302
f29e9405c851
equal deleted inserted replaced
2261:f4bb5648fc29 2262:2371836c3c45
10 from PyQt4.QtCore import pyqtSlot 10 from PyQt4.QtCore import pyqtSlot
11 from PyQt4.QtGui import QColor, QPalette, QColorDialog 11 from PyQt4.QtGui import QColor, QPalette, QColorDialog
12 from PyQt4.Qsci import QsciScintilla 12 from PyQt4.Qsci import QsciScintilla
13 13
14 from QScintilla.QsciScintillaCompat import QsciScintillaCompat, QSCINTILLA_VERSION 14 from QScintilla.QsciScintillaCompat import QsciScintillaCompat, QSCINTILLA_VERSION
15
16 15
17 from .ConfigurationPageBase import ConfigurationPageBase 16 from .ConfigurationPageBase import ConfigurationPageBase
18 from .Ui_EditorStylesPage import Ui_EditorStylesPage 17 from .Ui_EditorStylesPage import Ui_EditorStylesPage
19 18
20 import Preferences 19 import Preferences
47 QsciScintilla.EdgeLine, 46 QsciScintilla.EdgeLine,
48 QsciScintilla.EdgeBackground 47 QsciScintilla.EdgeBackground
49 ] 48 ]
50 49
51 self.wrapModeComboBox.addItem(self.trUtf8("Disabled"), 50 self.wrapModeComboBox.addItem(self.trUtf8("Disabled"),
51 QsciScintilla.WrapNone)
52 self.wrapModeComboBox.addItem(self.trUtf8("Word Boundary"),
53 QsciScintilla.WrapWord)
54 self.wrapModeComboBox.addItem(self.trUtf8("Character Boundary"),
55 QsciScintilla.WrapCharacter)
56 self.wrapVisualComboBox.addItem(self.trUtf8("No Indicator"),
52 QsciScintilla.WrapFlagNone) 57 QsciScintilla.WrapFlagNone)
53 self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Text"), 58 self.wrapVisualComboBox.addItem(self.trUtf8("Indicator by Text"),
54 QsciScintilla.WrapFlagByText) 59 QsciScintilla.WrapFlagByText)
55 self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Margin"), 60 self.wrapVisualComboBox.addItem(self.trUtf8("Indicator by Margin"),
56 QsciScintilla.WrapFlagByBorder) 61 QsciScintilla.WrapFlagByBorder)
57 if QSCINTILLA_VERSION() >= 0x020700: 62 if QSCINTILLA_VERSION() >= 0x020700:
58 self.wrapModeComboBox.addItem(self.trUtf8("Show Flag in Linenumber Margin"), 63 self.wrapVisualComboBox.addItem(
64 self.trUtf8("Indicator in Line Number Margin"),
59 QsciScintilla.WrapFlagInMargin) 65 QsciScintilla.WrapFlagInMargin)
60 66
61 # set initial values 67 # set initial values
62 try: 68 try:
63 self.foldingStyleComboBox.setCurrentIndex( 69 self.foldingStyleComboBox.setCurrentIndex(
126 QColor(Preferences.getEditorColour("AnnotationsErrorBackground")) 132 QColor(Preferences.getEditorColour("AnnotationsErrorBackground"))
127 133
128 self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL")) 134 self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL"))
129 self.wrapModeComboBox.setCurrentIndex(self.wrapModeComboBox.findData( 135 self.wrapModeComboBox.setCurrentIndex(self.wrapModeComboBox.findData(
130 Preferences.getEditor("WrapLongLinesMode"))) 136 Preferences.getEditor("WrapLongLinesMode")))
137 self.wrapVisualComboBox.setCurrentIndex(self.wrapVisualComboBox.findData(
138 Preferences.getEditor("WrapVisualFlag")))
131 139
132 self.edgeModeCombo.setCurrentIndex( 140 self.edgeModeCombo.setCurrentIndex(
133 self.edgeModes.index(Preferences.getEditor("EdgeMode"))) 141 self.edgeModes.index(Preferences.getEditor("EdgeMode")))
134 self.edgeLineColumnSlider.setValue( 142 self.edgeLineColumnSlider.setValue(
135 Preferences.getEditor("EdgeColumn")) 143 Preferences.getEditor("EdgeColumn"))
222 230
223 Preferences.setEditor("ShowEOL", 231 Preferences.setEditor("ShowEOL",
224 self.eolCheckBox.isChecked()) 232 self.eolCheckBox.isChecked())
225 Preferences.setEditor("WrapLongLinesMode", 233 Preferences.setEditor("WrapLongLinesMode",
226 self.wrapModeComboBox.itemData(self.wrapModeComboBox.currentIndex())) 234 self.wrapModeComboBox.itemData(self.wrapModeComboBox.currentIndex()))
235 Preferences.setEditor("WrapVisualFlag",
236 self.wrapVisualComboBox.itemData(self.wrapVisualComboBox.currentIndex()))
227 Preferences.setEditor("EdgeMode", 237 Preferences.setEditor("EdgeMode",
228 self.edgeModes[self.edgeModeCombo.currentIndex()]) 238 self.edgeModes[self.edgeModeCombo.currentIndex()])
229 Preferences.setEditor("EdgeColumn", 239 Preferences.setEditor("EdgeColumn",
230 self.edgeLineColumnSlider.value()) 240 self.edgeLineColumnSlider.value())
231 241

eric ide

mercurial