9 |
9 |
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 |
14 from QScintilla.QsciScintillaCompat import QsciScintillaCompat, QSCINTILLA_VERSION |
|
15 |
15 |
16 |
16 from .ConfigurationPageBase import ConfigurationPageBase |
17 from .ConfigurationPageBase import ConfigurationPageBase |
17 from .Ui_EditorStylesPage import Ui_EditorStylesPage |
18 from .Ui_EditorStylesPage import Ui_EditorStylesPage |
18 |
19 |
19 import Preferences |
20 import Preferences |
44 self.edgeModes = [ |
45 self.edgeModes = [ |
45 QsciScintilla.EdgeNone, |
46 QsciScintilla.EdgeNone, |
46 QsciScintilla.EdgeLine, |
47 QsciScintilla.EdgeLine, |
47 QsciScintilla.EdgeBackground |
48 QsciScintilla.EdgeBackground |
48 ] |
49 ] |
|
50 |
|
51 self.wrapModeComboBox.addItem(self.trUtf8("Disabled"), |
|
52 QsciScintilla.WrapFlagNone) |
|
53 self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Text"), |
|
54 QsciScintilla.WrapFlagByText) |
|
55 self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Margin"), |
|
56 QsciScintilla.WrapFlagByBorder) |
|
57 if QSCINTILLA_VERSION() >= 0x020700: |
|
58 self.wrapModeComboBox.addItem(self.trUtf8("Show Flag in Linenumber Margin"), |
|
59 QsciScintilla.WrapFlagInMargin) |
49 |
60 |
50 # set initial values |
61 # set initial values |
51 try: |
62 try: |
52 self.foldingStyleComboBox.setCurrentIndex( |
63 self.foldingStyleComboBox.setCurrentIndex( |
53 self.foldStyles.index(Preferences.getEditor("FoldingStyle"))) |
64 self.foldStyles.index(Preferences.getEditor("FoldingStyle"))) |
113 QColor(Preferences.getEditorColour("AnnotationsErrorForeground")) |
124 QColor(Preferences.getEditorColour("AnnotationsErrorForeground")) |
114 self.editorColours["AnnotationsErrorBackground"] = \ |
125 self.editorColours["AnnotationsErrorBackground"] = \ |
115 QColor(Preferences.getEditorColour("AnnotationsErrorBackground")) |
126 QColor(Preferences.getEditorColour("AnnotationsErrorBackground")) |
116 |
127 |
117 self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL")) |
128 self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL")) |
118 self.wrapLongLinesCheckBox.setChecked( |
129 self.wrapModeComboBox.setCurrentIndex(self.wrapModeComboBox.findData( |
119 Preferences.getEditor("WrapLongLines")) |
130 Preferences.getEditor("WrapLongLinesMode"))) |
120 |
131 |
121 self.edgeModeCombo.setCurrentIndex( |
132 self.edgeModeCombo.setCurrentIndex( |
122 self.edgeModes.index(Preferences.getEditor("EdgeMode"))) |
133 self.edgeModes.index(Preferences.getEditor("EdgeMode"))) |
123 self.edgeLineColumnSlider.setValue( |
134 self.edgeLineColumnSlider.setValue( |
124 Preferences.getEditor("EdgeColumn")) |
135 Preferences.getEditor("EdgeColumn")) |
209 Preferences.setEditor("CaretWidth", |
220 Preferences.setEditor("CaretWidth", |
210 self.caretWidthSpinBox.value()) |
221 self.caretWidthSpinBox.value()) |
211 |
222 |
212 Preferences.setEditor("ShowEOL", |
223 Preferences.setEditor("ShowEOL", |
213 self.eolCheckBox.isChecked()) |
224 self.eolCheckBox.isChecked()) |
214 Preferences.setEditor("WrapLongLines", |
225 Preferences.setEditor("WrapLongLinesMode", |
215 self.wrapLongLinesCheckBox.isChecked()) |
226 self.wrapModeComboBox.itemData(self.wrapModeComboBox.currentIndex())) |
216 Preferences.setEditor("EdgeMode", |
227 Preferences.setEditor("EdgeMode", |
217 self.edgeModes[self.edgeModeCombo.currentIndex()]) |
228 self.edgeModes[self.edgeModeCombo.currentIndex()]) |
218 Preferences.setEditor("EdgeColumn", |
229 Preferences.setEditor("EdgeColumn", |
219 self.edgeLineColumnSlider.value()) |
230 self.edgeLineColumnSlider.value()) |
220 |
231 |