Preferences/ConfigurationPages/EditorStylesPage.py

changeset 2261
f4bb5648fc29
parent 2230
2b1b9265156c
child 2262
2371836c3c45
--- a/Preferences/ConfigurationPages/EditorStylesPage.py	Mon Dec 10 18:40:10 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorStylesPage.py	Mon Dec 10 20:15:52 2012 +0100
@@ -11,7 +11,8 @@
 from PyQt4.QtGui import QColor, QPalette, QColorDialog
 from PyQt4.Qsci import QsciScintilla
 
-from QScintilla.QsciScintillaCompat import QsciScintillaCompat
+from QScintilla.QsciScintillaCompat import QsciScintillaCompat, QSCINTILLA_VERSION
+
 
 from .ConfigurationPageBase import ConfigurationPageBase
 from .Ui_EditorStylesPage import Ui_EditorStylesPage
@@ -47,6 +48,16 @@
             QsciScintilla.EdgeBackground
         ]
         
+        self.wrapModeComboBox.addItem(self.trUtf8("Disabled"),
+            QsciScintilla.WrapFlagNone)
+        self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Text"),
+            QsciScintilla.WrapFlagByText)
+        self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Margin"),
+            QsciScintilla.WrapFlagByBorder)
+        if QSCINTILLA_VERSION() >= 0x020700:
+            self.wrapModeComboBox.addItem(self.trUtf8("Show Flag in Linenumber Margin"),
+                QsciScintilla.WrapFlagInMargin)
+        
         # set initial values
         try:
             self.foldingStyleComboBox.setCurrentIndex(
@@ -115,8 +126,8 @@
             QColor(Preferences.getEditorColour("AnnotationsErrorBackground"))
         
         self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL"))
-        self.wrapLongLinesCheckBox.setChecked(
-            Preferences.getEditor("WrapLongLines"))
+        self.wrapModeComboBox.setCurrentIndex(self.wrapModeComboBox.findData(
+            Preferences.getEditor("WrapLongLinesMode")))
         
         self.edgeModeCombo.setCurrentIndex(
             self.edgeModes.index(Preferences.getEditor("EdgeMode")))
@@ -211,8 +222,8 @@
         
         Preferences.setEditor("ShowEOL",
             self.eolCheckBox.isChecked())
-        Preferences.setEditor("WrapLongLines",
-            self.wrapLongLinesCheckBox.isChecked())
+        Preferences.setEditor("WrapLongLinesMode",
+            self.wrapModeComboBox.itemData(self.wrapModeComboBox.currentIndex()))
         Preferences.setEditor("EdgeMode",
             self.edgeModes[self.edgeModeCombo.currentIndex()])
         Preferences.setEditor("EdgeColumn",

eric ide

mercurial