Made some adjustments for QScintilla 2.7.0.

Mon, 10 Dec 2012 20:15:52 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 10 Dec 2012 20:15:52 +0100
changeset 2261
f4bb5648fc29
parent 2260
e5146f38a03a
child 2262
2371836c3c45

Made some adjustments for QScintilla 2.7.0.

Preferences/ConfigurationPages/EditorPropertiesPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EditorPropertiesPage.ui file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EditorStylesPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EditorStylesPage.ui file | annotate | diff | comparison | revisions
Preferences/__init__.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/Lexers/LexerCPP.py file | annotate | diff | comparison | revisions
QScintilla/Lexers/LexerCSS.py file | annotate | diff | comparison | revisions
QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
--- a/Preferences/ConfigurationPages/EditorPropertiesPage.py	Mon Dec 10 18:40:10 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorPropertiesPage.py	Mon Dec 10 20:15:52 2012 +0100
@@ -69,10 +69,26 @@
                 Preferences.getEditor("CppHighlightTripleQuotedStrings"))
         else:
             self.cppHighlightTripleQuotedCheckBox.setEnabled(False)
+        if QSCINTILLA_VERSION() >= 0x020700:
+            self.cppHighlightHashQuotedCheckBox.setChecked(
+                Preferences.getEditor("CppHighlightHashQuotedStrings"))
+        else:
+            self.cppHighlightHashQuotedCheckBox.setEnabled(False)
         
         # CSS
         self.foldCssCommentCheckBox.setChecked(
             Preferences.getEditor("CssFoldComment"))
+        if QSCINTILLA_VERSION() >= 0x020700:
+            self.cssHssCheckBox.setChecked(
+                Preferences.getEditor("CssHssSupport"))
+            self.cssLessCheckBox.setChecked(
+                Preferences.getEditor("CssLessSupport"))
+            self.cssSassyCheckBox.setChecked(
+                Preferences.getEditor("CssSassySupport"))
+        else:
+            self.cssHssCheckBox.setEnabled(False)
+            self.cssLessCheckBox.setEnabled(False)
+            self.cssSassyCheckBox.setEnabled(False)
         
         # D
         self.foldDCommentCheckBox.setChecked(
@@ -293,10 +309,20 @@
         if QSCINTILLA_VERSION() >= 0x020600:
             Preferences.setEditor("CppHighlightTripleQuotedStrings",
                 self.cppHighlightTripleQuotedCheckBox.isChecked())
+        if QSCINTILLA_VERSION() >= 0x020700:
+            Preferences.setEditor("CppHighlightHashQuotedStrings",
+                self.cppHighlightHashQuotedCheckBox.isChecked())
         
         # CSS
         Preferences.setEditor("CssFoldComment",
             self.foldCssCommentCheckBox.isChecked())
+        if QSCINTILLA_VERSION() >= 0x020700:
+            Preferences.setEditor("CssHssSupport",
+                self.cssHssCheckBox.isChecked())
+            Preferences.setEditor("CssLessSupport",
+                self.cssLessCheckBox.isChecked())
+            Preferences.setEditor("CssSassySupport",
+                self.cssSassyCheckBox.isChecked())
         
         # D
         Preferences.setEditor("DFoldComment",
--- a/Preferences/ConfigurationPages/EditorPropertiesPage.ui	Mon Dec 10 18:40:10 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorPropertiesPage.ui	Mon Dec 10 20:15:52 2012 +0100
@@ -155,7 +155,7 @@
         </property>
        </widget>
       </item>
-      <item row="4" column="1">
+      <item row="5" column="0">
        <widget class="QCheckBox" name="cppHighlightTripleQuotedCheckBox">
         <property name="toolTip">
          <string>Select to highlight triple quoted strings</string>
@@ -165,6 +165,16 @@
         </property>
        </widget>
       </item>
+      <item row="5" column="1">
+       <widget class="QCheckBox" name="cppHighlightHashQuotedCheckBox">
+        <property name="toolTip">
+         <string>Select to highlight hash quoted strings</string>
+        </property>
+        <property name="text">
+         <string>Highlight hash quoted strings</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
@@ -192,8 +202,8 @@
      <property name="title">
       <string>CSS Lexer Properties</string>
      </property>
-     <layout class="QVBoxLayout">
-      <item>
+     <layout class="QGridLayout" name="gridLayout_10">
+      <item row="0" column="0">
        <widget class="QCheckBox" name="foldCssCommentCheckBox">
         <property name="toolTip">
          <string>Select whether folding of comments shall be possible</string>
@@ -203,6 +213,36 @@
         </property>
        </widget>
       </item>
+      <item row="1" column="0">
+       <widget class="QCheckBox" name="cssHssCheckBox">
+        <property name="toolTip">
+         <string>Select to activate HSS support</string>
+        </property>
+        <property name="text">
+         <string>HSS support</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QCheckBox" name="cssLessCheckBox">
+        <property name="toolTip">
+         <string>Select to activate Less CSS support</string>
+        </property>
+        <property name="text">
+         <string>Less CSS support</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QCheckBox" name="cssSassyCheckBox">
+        <property name="toolTip">
+         <string>Select to activate Sassy CSS support</string>
+        </property>
+        <property name="text">
+         <string>Sassy CSS support</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
@@ -911,8 +951,12 @@
   <tabstop>cppDollarAllowedCheckBox</tabstop>
   <tabstop>cppStylePreprocessorCheckBox</tabstop>
   <tabstop>cppHighlightTripleQuotedCheckBox</tabstop>
+  <tabstop>cppHighlightHashQuotedCheckBox</tabstop>
   <tabstop>cmakeFoldAtElseCheckBox</tabstop>
   <tabstop>foldCssCommentCheckBox</tabstop>
+  <tabstop>cssHssCheckBox</tabstop>
+  <tabstop>cssLessCheckBox</tabstop>
+  <tabstop>cssSassyCheckBox</tabstop>
   <tabstop>foldDCommentCheckBox</tabstop>
   <tabstop>foldDAtElseCheckBox</tabstop>
   <tabstop>dIndentOpeningBraceCheckBox</tabstop>
--- 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",
--- a/Preferences/ConfigurationPages/EditorStylesPage.ui	Mon Dec 10 18:40:10 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorStylesPage.ui	Mon Dec 10 20:15:52 2012 +0100
@@ -7,10 +7,10 @@
     <x>0</x>
     <y>0</y>
     <width>587</width>
-    <height>1874</height>
+    <height>1913</height>
    </rect>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_4">
+  <layout class="QVBoxLayout" name="verticalLayout_5">
    <item>
     <widget class="QLabel" name="headerLabel">
      <property name="text">
@@ -900,30 +900,58 @@
      <property name="title">
       <string>End of Line</string>
      </property>
-     <layout class="QVBoxLayout" name="_10">
+     <layout class="QVBoxLayout" name="verticalLayout_4">
+      <item>
+       <widget class="QCheckBox" name="eolCheckBox">
+        <property name="toolTip">
+         <string>Select whether end of line shall be shown</string>
+        </property>
+        <property name="text">
+         <string>Show End of Line</string>
+        </property>
+       </widget>
+      </item>
       <item>
-       <layout class="QGridLayout" name="_11">
-        <item row="0" column="0">
-         <widget class="QCheckBox" name="eolCheckBox">
-          <property name="toolTip">
-           <string>Select whether end of line shall be shown</string>
-          </property>
-          <property name="text">
-           <string>Show End of Line</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="QCheckBox" name="wrapLongLinesCheckBox">
-          <property name="toolTip">
-           <string>Select, whether long lines should be wrapped</string>
-          </property>
-          <property name="text">
-           <string>Wrap long lines</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
+       <widget class="QGroupBox" name="wrapLongLinesGroup">
+        <property name="toolTip">
+         <string/>
+        </property>
+        <property name="title">
+         <string>Wrap long lines</string>
+        </property>
+        <property name="checkable">
+         <bool>false</bool>
+        </property>
+        <layout class="QHBoxLayout" name="horizontalLayout_4">
+         <item>
+          <widget class="QLabel" name="textLabel1_15">
+           <property name="text">
+            <string>Mode:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="wrapModeComboBox">
+           <property name="toolTip">
+            <string>Select the wrap mode for long lines</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>400</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </widget>
       </item>
       <item>
        <widget class="QGroupBox" name="groupBox_9">
@@ -1546,7 +1574,7 @@
   <tabstop>nonmatchingBracesButton</tabstop>
   <tabstop>nonmatchingBracesBackButton</tabstop>
   <tabstop>eolCheckBox</tabstop>
-  <tabstop>wrapLongLinesCheckBox</tabstop>
+  <tabstop>wrapModeComboBox</tabstop>
   <tabstop>edgeModeCombo</tabstop>
   <tabstop>edgeLineColumnSlider</tabstop>
   <tabstop>edgeBackgroundColorButton</tabstop>
--- a/Preferences/__init__.py	Mon Dec 10 18:40:10 2012 +0100
+++ b/Preferences/__init__.py	Mon Dec 10 20:15:52 2012 +0100
@@ -254,7 +254,7 @@
         "WhitespaceSize": 1,
         "ShowEOL": False,
         "UseMonospacedFont": False,
-        "WrapLongLines": False,
+        "WrapLongLinesMode": QsciScintilla.WrapFlagNone,
         "WarnFilesize": 512,
         "ClearBreaksOnClose": True,
         "StripTrailingWhitespace": False,
@@ -346,9 +346,13 @@
         "CppDollarsAllowed": True,
         "CppStylePreprocessor": False,
         "CppHighlightTripleQuotedStrings": False,
+        "CppHighlightHashQuotedStrings": False,
         
         # CSS specifics
         "CssFoldComment": True,
+        "CssHssSupport": False,
+        "CssLessSupport": False,
+        "CssSassySupport": False,
         
         # D specifics
         "DFoldComment": True,
@@ -1534,7 +1538,8 @@
                  "CallTipsVisible", "CallTipsStyle", "MarkOccurrencesTimeout",
                  "AutoSpellCheckChunkSize", "SpellCheckingMinWordSize",
                  "PostScriptLevel", "EOLMode", "ZoomFactor", "WhitespaceSize",
-                 "OnlineSyntaxCheckInterval", "OnlineChangeTraceInterval"]:
+                 "OnlineSyntaxCheckInterval", "OnlineChangeTraceInterval",
+                 "WrapLongLinesMode"]:
         return int(prefClass.settings.value("Editor/" + key,
             prefClass.editorDefaults[key]))
     elif key in ["AdditionalOpenFilters", "AdditionalSaveFilters",
--- a/QScintilla/Editor.py	Mon Dec 10 18:40:10 2012 +0100
+++ b/QScintilla/Editor.py	Mon Dec 10 20:15:52 2012 +0100
@@ -3927,14 +3927,13 @@
             self.setEdgeColumn(Preferences.getEditor("EdgeColumn"))
             self.setEdgeColor(Preferences.getEditorColour("Edge"))
         
-        if Preferences.getEditor("WrapLongLines"):
+        wrapFlag = Preferences.getEditor("WrapLongLinesMode")
+        if wrapFlag == QsciScintilla.WrapFlagNone:
+            self.setWrapMode(QsciScintilla.WrapNone)
+            self.setWrapVisualFlags(wrapFlag, wrapFlag)
+        else:
             self.setWrapMode(QsciScintilla.WrapWord)
-            self.setWrapVisualFlags(
-                QsciScintilla.WrapFlagByBorder, QsciScintilla.WrapFlagByBorder)
-        else:
-            self.setWrapMode(QsciScintilla.WrapNone)
-            self.setWrapVisualFlags(
-                QsciScintilla.WrapFlagNone, QsciScintilla.WrapFlagNone)
+            self.setWrapVisualFlags(wrapFlag, wrapFlag)
         
         self.zoomTo(Preferences.getEditor("ZoomFactor"))
         
--- a/QScintilla/Lexers/LexerCPP.py	Mon Dec 10 18:40:10 2012 +0100
+++ b/QScintilla/Lexers/LexerCPP.py	Mon Dec 10 20:15:52 2012 +0100
@@ -64,6 +64,11 @@
                 Preferences.getEditor("CppHighlightTripleQuotedStrings"))
         except AttributeError:
             pass
+        try:
+            self.setHighlightHashQuotedStrings(
+                Preferences.getEditor("CppHighlightHashQuotedStrings"))
+        except AttributeError:
+            pass
     
     def autoCompletionWordSeparators(self):
         """
--- a/QScintilla/Lexers/LexerCSS.py	Mon Dec 10 18:40:10 2012 +0100
+++ b/QScintilla/Lexers/LexerCSS.py	Mon Dec 10 20:15:52 2012 +0100
@@ -38,6 +38,15 @@
         """
         self.setFoldComments(Preferences.getEditor("CssFoldComment"))
         self.setFoldCompact(Preferences.getEditor("AllFoldCompact"))
+        try:
+            self.setHSSLanguage(
+                Preferences.getEditor("CssHssSupport"))
+            self.setLessLanguage(
+                Preferences.getEditor("CssLessSupport"))
+            self.setSCSSLanguage(
+                Preferences.getEditor("CssSassySupport"))
+        except AttributeError:
+            pass
     
     def isCommentStyle(self, style):
         """
--- a/QScintilla/MiniEditor.py	Mon Dec 10 18:40:10 2012 +0100
+++ b/QScintilla/MiniEditor.py	Mon Dec 10 20:15:52 2012 +0100
@@ -2194,14 +2194,13 @@
             self.__textEdit.setEdgeColumn(Preferences.getEditor("EdgeColumn"))
             self.__textEdit.setEdgeColor(Preferences.getEditorColour("Edge"))
         
-        if Preferences.getEditor("WrapLongLines"):
+        wrapFlag = Preferences.getEditor("WrapLongLinesMode")
+        if wrapFlag == QsciScintilla.WrapFlagNone:
+            self.__textEdit.setWrapMode(QsciScintilla.WrapNone)
+            self.__textEdit.setWrapVisualFlags(wrapFlag, wrapFlag)
+        else:
             self.__textEdit.setWrapMode(QsciScintilla.WrapWord)
-            self.__textEdit.setWrapVisualFlags(
-                QsciScintilla.WrapFlagByBorder, QsciScintilla.WrapFlagByBorder)
-        else:
-            self.__textEdit.setWrapMode(QsciScintilla.WrapNone)
-            self.__textEdit.setWrapVisualFlags(
-                QsciScintilla.WrapFlagNone, QsciScintilla.WrapFlagNone)
+            self.__textEdit.setWrapVisualFlags(wrapFlag, wrapFlag)
         
         self.searchIndicator = QsciScintilla.INDIC_CONTAINER
         self.__textEdit.indicatorDefine(self.searchIndicator, QsciScintilla.INDIC_BOX,

eric ide

mercurial