Made some more adjustments for QScintilla 2.7.0.

Tue, 11 Dec 2012 19:32:52 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 11 Dec 2012 19:32:52 +0100
changeset 2262
2371836c3c45
parent 2261
f4bb5648fc29
child 2263
7876e6ebc0c1

Made some more adjustments for QScintilla 2.7.0.

Preferences/ConfigurationPages/EditorCalltipsPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EditorCalltipsPage.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/MiniEditor.py file | annotate | diff | comparison | revisions
--- a/Preferences/ConfigurationPages/EditorCalltipsPage.py	Mon Dec 10 20:15:52 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorCalltipsPage.py	Tue Dec 11 19:32:52 2012 +0100
@@ -7,6 +7,10 @@
 Module implementing the Editor Calltips configuration page.
 """
 
+from PyQt4.Qsci import QsciScintilla
+
+from QScintilla.QsciScintillaCompat import QSCINTILLA_VERSION
+
 from .ConfigurationPageBase import ConfigurationPageBase
 from .Ui_EditorCalltipsPage import Ui_EditorCalltipsPage
 
@@ -25,6 +29,14 @@
         self.setupUi(self)
         self.setObjectName("EditorCalltipsPage")
         
+        if QSCINTILLA_VERSION() >= 0x020700:
+            self.positionComboBox.addItem(self.trUtf8("Below Text"),
+                QsciScintilla.CallTipsBelowText)
+            self.positionComboBox.addItem(self.trUtf8("Above Text"),
+                QsciScintilla.CallTipsAboveText)
+        else:
+            self.calltipsPositionBox.hide()
+        
         # set initial values
         self.ctEnabledCheckBox.setChecked(
             Preferences.getEditor("CallTipsEnabled"))
@@ -37,6 +49,10 @@
         self.ctScintillaCheckBox.setChecked(
             Preferences.getEditor("CallTipsScintillaOnFail"))
         
+        if QSCINTILLA_VERSION() >= 0x020700:
+            self.positionComboBox.setCurrentIndex(self.positionComboBox.findData(
+                Preferences.getEditor("CallTipsPosition")))
+        
     def save(self):
         """
         Public slot to save the EditorCalltips configuration.
@@ -50,6 +66,10 @@
         
         Preferences.setEditor("CallTipsScintillaOnFail",
             self.ctScintillaCheckBox.isChecked())
+        
+        if QSCINTILLA_VERSION() >= 0x020700:
+            Preferences.setEditor("CallTipsPosition",
+                self.positionComboBox.itemData(self.positionComboBox.currentIndex()))
 
 
 def create(dlg):
--- a/Preferences/ConfigurationPages/EditorCalltipsPage.ui	Mon Dec 10 20:15:52 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorCalltipsPage.ui	Tue Dec 11 19:32:52 2012 +0100
@@ -10,7 +10,7 @@
     <height>369</height>
    </rect>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
+  <layout class="QVBoxLayout" name="verticalLayout_3">
    <item>
     <widget class="QLabel" name="headerLabel">
      <property name="text">
@@ -50,13 +50,18 @@
       <property name="margin">
        <number>0</number>
       </property>
-      <item>
-       <widget class="QLabel" name="textLabel2">
-        <property name="text">
-         <string>Visible calltips:</string>
-        </property>
-       </widget>
-      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_4">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+     <property name="title">
+      <string>Visible Calltips</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
       <item>
        <widget class="QSlider" name="ctVisibleSlider">
         <property name="toolTip">
@@ -90,6 +95,25 @@
     </widget>
    </item>
    <item>
+    <widget class="QGroupBox" name="calltipsPositionBox">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+     <property name="title">
+      <string>Calltips Position</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <widget class="QComboBox" name="positionComboBox">
+        <property name="toolTip">
+         <string>Select the position for the calltips</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
     <widget class="QGroupBox" name="groupBox_2">
      <property name="enabled">
       <bool>false</bool>
@@ -139,6 +163,9 @@
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
      <property name="title">
       <string>Plug-In Behavior</string>
      </property>
@@ -176,57 +203,88 @@
  </widget>
  <tabstops>
   <tabstop>ctEnabledCheckBox</tabstop>
-  <tabstop>ctVisibleSlider</tabstop>
   <tabstop>calltipsBackgroundButton</tabstop>
   <tabstop>ctScintillaCheckBox</tabstop>
  </tabstops>
  <resources/>
  <connections>
   <connection>
+   <sender>ctVisibleSlider</sender>
+   <signal>valueChanged(int)</signal>
+   <receiver>lCDNumber5</receiver>
+   <slot>display(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>102</x>
+     <y>109</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>386</x>
+     <y>111</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ctEnabledCheckBox</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>groupBox_4</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>45</x>
+     <y>44</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>50</x>
+     <y>71</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ctEnabledCheckBox</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>calltipsPositionBox</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>124</x>
+     <y>44</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>134</x>
+     <y>131</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
    <sender>ctEnabledCheckBox</sender>
    <signal>toggled(bool)</signal>
    <receiver>groupBox_2</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>68</x>
-     <y>48</y>
+     <x>173</x>
+     <y>46</y>
     </hint>
     <hint type="destinationlabel">
-     <x>77</x>
-     <y>148</y>
+     <x>182</x>
+     <y>192</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>ctEnabledCheckBox</sender>
    <signal>toggled(bool)</signal>
-   <receiver>frame</receiver>
+   <receiver>groupBox</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>199</x>
-     <y>47</y>
+     <x>232</x>
+     <y>46</y>
     </hint>
     <hint type="destinationlabel">
-     <x>199</x>
-     <y>75</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>ctVisibleSlider</sender>
-   <signal>valueChanged(int)</signal>
-   <receiver>lCDNumber5</receiver>
-   <slot>display(int)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>285</x>
-     <y>75</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>372</x>
-     <y>77</y>
+     <x>245</x>
+     <y>257</y>
     </hint>
    </hints>
   </connection>
--- a/Preferences/ConfigurationPages/EditorStylesPage.py	Mon Dec 10 20:15:52 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorStylesPage.py	Tue Dec 11 19:32:52 2012 +0100
@@ -13,7 +13,6 @@
 
 from QScintilla.QsciScintillaCompat import QsciScintillaCompat, QSCINTILLA_VERSION
 
-
 from .ConfigurationPageBase import ConfigurationPageBase
 from .Ui_EditorStylesPage import Ui_EditorStylesPage
 
@@ -49,13 +48,20 @@
         ]
         
         self.wrapModeComboBox.addItem(self.trUtf8("Disabled"),
+            QsciScintilla.WrapNone)
+        self.wrapModeComboBox.addItem(self.trUtf8("Word Boundary"),
+            QsciScintilla.WrapWord)
+        self.wrapModeComboBox.addItem(self.trUtf8("Character Boundary"),
+            QsciScintilla.WrapCharacter)
+        self.wrapVisualComboBox.addItem(self.trUtf8("No Indicator"),
             QsciScintilla.WrapFlagNone)
-        self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Text"),
+        self.wrapVisualComboBox.addItem(self.trUtf8("Indicator by Text"),
             QsciScintilla.WrapFlagByText)
-        self.wrapModeComboBox.addItem(self.trUtf8("Show Flag by Margin"),
+        self.wrapVisualComboBox.addItem(self.trUtf8("Indicator by Margin"),
             QsciScintilla.WrapFlagByBorder)
         if QSCINTILLA_VERSION() >= 0x020700:
-            self.wrapModeComboBox.addItem(self.trUtf8("Show Flag in Linenumber Margin"),
+            self.wrapVisualComboBox.addItem(
+                self.trUtf8("Indicator in Line Number Margin"),
                 QsciScintilla.WrapFlagInMargin)
         
         # set initial values
@@ -128,6 +134,8 @@
         self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL"))
         self.wrapModeComboBox.setCurrentIndex(self.wrapModeComboBox.findData(
             Preferences.getEditor("WrapLongLinesMode")))
+        self.wrapVisualComboBox.setCurrentIndex(self.wrapVisualComboBox.findData(
+            Preferences.getEditor("WrapVisualFlag")))
         
         self.edgeModeCombo.setCurrentIndex(
             self.edgeModes.index(Preferences.getEditor("EdgeMode")))
@@ -224,6 +232,8 @@
             self.eolCheckBox.isChecked())
         Preferences.setEditor("WrapLongLinesMode",
             self.wrapModeComboBox.itemData(self.wrapModeComboBox.currentIndex()))
+        Preferences.setEditor("WrapVisualFlag",
+            self.wrapVisualComboBox.itemData(self.wrapVisualComboBox.currentIndex()))
         Preferences.setEditor("EdgeMode",
             self.edgeModes[self.edgeModeCombo.currentIndex()])
         Preferences.setEditor("EdgeColumn",
--- a/Preferences/ConfigurationPages/EditorStylesPage.ui	Mon Dec 10 20:15:52 2012 +0100
+++ b/Preferences/ConfigurationPages/EditorStylesPage.ui	Tue Dec 11 19:32:52 2012 +0100
@@ -922,22 +922,22 @@
         <property name="checkable">
          <bool>false</bool>
         </property>
-        <layout class="QHBoxLayout" name="horizontalLayout_4">
-         <item>
+        <layout class="QGridLayout" name="gridLayout_7">
+         <item row="0" column="0">
           <widget class="QLabel" name="textLabel1_15">
            <property name="text">
             <string>Mode:</string>
            </property>
           </widget>
          </item>
-         <item>
+         <item row="0" column="1">
           <widget class="QComboBox" name="wrapModeComboBox">
            <property name="toolTip">
             <string>Select the wrap mode for long lines</string>
            </property>
           </widget>
          </item>
-         <item>
+         <item row="0" column="2">
           <spacer name="horizontalSpacer_2">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
@@ -950,6 +950,20 @@
            </property>
           </spacer>
          </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_5">
+           <property name="text">
+            <string>Indication:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QComboBox" name="wrapVisualComboBox">
+           <property name="toolTip">
+            <string>Select, how wrapped lines are indicated</string>
+           </property>
+          </widget>
+         </item>
         </layout>
        </widget>
       </item>
@@ -1575,6 +1589,7 @@
   <tabstop>nonmatchingBracesBackButton</tabstop>
   <tabstop>eolCheckBox</tabstop>
   <tabstop>wrapModeComboBox</tabstop>
+  <tabstop>wrapVisualComboBox</tabstop>
   <tabstop>edgeModeCombo</tabstop>
   <tabstop>edgeLineColumnSlider</tabstop>
   <tabstop>edgeBackgroundColorButton</tabstop>
--- a/Preferences/__init__.py	Mon Dec 10 20:15:52 2012 +0100
+++ b/Preferences/__init__.py	Tue Dec 11 19:32:52 2012 +0100
@@ -254,7 +254,8 @@
         "WhitespaceSize": 1,
         "ShowEOL": False,
         "UseMonospacedFont": False,
-        "WrapLongLinesMode": QsciScintilla.WrapFlagNone,
+        "WrapLongLinesMode": QsciScintilla.WrapNone,
+        "WrapVisualFlag": QsciScintilla.WrapFlagNone,
         "WarnFilesize": 512,
         "ClearBreaksOnClose": True,
         "StripTrailingWhitespace": False,
@@ -441,6 +442,12 @@
     else:
         editorDefaults["EOLMode"] = QsciScintilla.EolUnix
     
+    try:
+        # since QScintilla 2.7.0
+        editorDefaults["CallTipsPosition"] = QsciScintilla.CallTipsBelowText
+    except AttributeError:
+        editorDefaults["CallTipsPosition"] = 0
+    
     editorColourDefaults = {
         "CurrentMarker": QColor(Qt.yellow),
         "ErrorMarker": QColor(Qt.red),
@@ -1539,7 +1546,7 @@
                  "AutoSpellCheckChunkSize", "SpellCheckingMinWordSize",
                  "PostScriptLevel", "EOLMode", "ZoomFactor", "WhitespaceSize",
                  "OnlineSyntaxCheckInterval", "OnlineChangeTraceInterval",
-                 "WrapLongLinesMode"]:
+                 "WrapLongLinesMode", "WrapVisualFlag", "CallTipsPosition"]:
         return int(prefClass.settings.value("Editor/" + key,
             prefClass.editorDefaults[key]))
     elif key in ["AdditionalOpenFilters", "AdditionalSaveFilters",
--- a/QScintilla/Editor.py	Mon Dec 10 20:15:52 2012 +0100
+++ b/QScintilla/Editor.py	Tue Dec 11 19:32:52 2012 +0100
@@ -3927,13 +3927,9 @@
             self.setEdgeColumn(Preferences.getEditor("EdgeColumn"))
             self.setEdgeColor(Preferences.getEditorColour("Edge"))
         
-        wrapFlag = Preferences.getEditor("WrapLongLinesMode")
-        if wrapFlag == QsciScintilla.WrapFlagNone:
-            self.setWrapMode(QsciScintilla.WrapNone)
-            self.setWrapVisualFlags(wrapFlag, wrapFlag)
-        else:
-            self.setWrapMode(QsciScintilla.WrapWord)
-            self.setWrapVisualFlags(wrapFlag, wrapFlag)
+        wrapVisualFlag = Preferences.getEditor("WrapVisualFlag")
+        self.setWrapMode(Preferences.getEditor("WrapLongLinesMode"))
+        self.setWrapVisualFlags(wrapVisualFlag, wrapVisualFlag)
         
         self.zoomTo(Preferences.getEditor("ZoomFactor"))
         
@@ -4028,6 +4024,10 @@
                 self.setCallTipsStyle(QsciScintilla.CallTipsNoAutoCompletionContext)
             else:
                 self.setCallTipsStyle(QsciScintilla.CallTipsContext)
+            try:
+                self.setCallTipsPosition(Preferences.getEditor("CallTipsPosition"))
+            except AttributeError:
+                pass
         else:
             self.setCallTipsStyle(QsciScintilla.CallTipsNone)
 
--- a/QScintilla/MiniEditor.py	Mon Dec 10 20:15:52 2012 +0100
+++ b/QScintilla/MiniEditor.py	Tue Dec 11 19:32:52 2012 +0100
@@ -2194,13 +2194,9 @@
             self.__textEdit.setEdgeColumn(Preferences.getEditor("EdgeColumn"))
             self.__textEdit.setEdgeColor(Preferences.getEditorColour("Edge"))
         
-        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(wrapFlag, wrapFlag)
+        wrapVisualFlag = Preferences.getEditor("WrapVisualFlag")
+        self.__textEdit.setWrapMode(Preferences.getEditor("WrapLongLinesMode"))
+        self.__textEdit.setWrapVisualFlags(wrapVisualFlag, wrapVisualFlag)
         
         self.searchIndicator = QsciScintilla.INDIC_CONTAINER
         self.__textEdit.indicatorDefine(self.searchIndicator, QsciScintilla.INDIC_BOX,

eric ide

mercurial