Added entires to convert the selection to upper/lower case to the edit menu.

Fri, 19 Apr 2013 18:34:33 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 19 Apr 2013 18:34:33 +0200
changeset 2593
a2df0adce985
parent 2591
b1c918293219
child 2594
bbb99b1cdfd2

Added entires to convert the selection to upper/lower case to the edit menu.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
changelog file | annotate | diff | comparison | revisions
diff -r b1c918293219 -r a2df0adce985 APIs/Python3/eric5.api
--- a/APIs/Python3/eric5.api	Thu Apr 18 19:09:20 2013 +0200
+++ b/APIs/Python3/eric5.api	Fri Apr 19 18:34:33 2013 +0200
@@ -6982,6 +6982,7 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getRectangularSelection?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getZoom?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hasIndicator?4(indicator, pos)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hasSelection?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.indentationGuideView?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.indicatorDefine?4(indicator, style, color)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.lineAt?4(pos)
diff -r b1c918293219 -r a2df0adce985 Documentation/Help/source.qch
Binary file Documentation/Help/source.qch has changed
diff -r b1c918293219 -r a2df0adce985 Documentation/Help/source.qhp
--- a/Documentation/Help/source.qhp	Thu Apr 18 19:09:20 2013 +0200
+++ b/Documentation/Help/source.qhp	Fri Apr 19 18:34:33 2013 +0200
@@ -8959,6 +8959,7 @@
       <keyword name="QsciScintillaCompat.getRectangularSelection" id="QsciScintillaCompat.getRectangularSelection" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getRectangularSelection" />
       <keyword name="QsciScintillaCompat.getZoom" id="QsciScintillaCompat.getZoom" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getZoom" />
       <keyword name="QsciScintillaCompat.hasIndicator" id="QsciScintillaCompat.hasIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hasIndicator" />
+      <keyword name="QsciScintillaCompat.hasSelection" id="QsciScintillaCompat.hasSelection" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hasSelection" />
       <keyword name="QsciScintillaCompat.indentationGuideView" id="QsciScintillaCompat.indentationGuideView" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.indentationGuideView" />
       <keyword name="QsciScintillaCompat.indicatorDefine" id="QsciScintillaCompat.indicatorDefine" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.indicatorDefine" />
       <keyword name="QsciScintillaCompat.lineAt" id="QsciScintillaCompat.lineAt" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.lineAt" />
diff -r b1c918293219 -r a2df0adce985 Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Thu Apr 18 19:09:20 2013 +0200
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Fri Apr 19 18:34:33 2013 +0200
@@ -208,6 +208,9 @@
 <td><a href="#QsciScintillaCompat.hasIndicator">hasIndicator</a></td>
 <td>Public method to test for the existence of an indicator.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.hasSelection">hasSelection</a></td>
+<td>Public method to check for a selection.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.indentationGuideView">indentationGuideView</a></td>
 <td>Public method to get the indentation guide view.</td>
 </tr><tr>
@@ -838,6 +841,16 @@
 <dd>
 flag indicating the existence of the indicator (boolean)
 </dd>
+</dl><a NAME="QsciScintillaCompat.hasSelection" ID="QsciScintillaCompat.hasSelection"></a>
+<h4>QsciScintillaCompat.hasSelection</h4>
+<b>hasSelection</b>(<i></i>)
+<p>
+        Public method to check for a selection.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating the presence of a selection (boolean)
+</dd>
 </dl><a NAME="QsciScintillaCompat.indentationGuideView" ID="QsciScintillaCompat.indentationGuideView"></a>
 <h4>QsciScintillaCompat.indentationGuideView</h4>
 <b>indentationGuideView</b>(<i></i>)
diff -r b1c918293219 -r a2df0adce985 QScintilla/QsciScintillaCompat.py
--- a/QScintilla/QsciScintillaCompat.py	Thu Apr 18 19:09:20 2013 +0200
+++ b/QScintilla/QsciScintillaCompat.py	Fri Apr 19 18:34:33 2013 +0200
@@ -474,6 +474,14 @@
         """
         self.SendScintilla(QsciScintilla.SCI_LINEENDEXTEND)
     
+    def hasSelection(self):
+        """
+        Public method to check for a selection.
+        
+        @return flag indicating the presence of a selection (boolean)
+        """
+        return self.getSelection()[0] != -1
+    
     def selectionIsRectangle(self):
         """
         Public method to check, if the current selection is rectangular.
diff -r b1c918293219 -r a2df0adce985 ViewManager/ViewManager.py
--- a/ViewManager/ViewManager.py	Thu Apr 18 19:09:20 2013 +0200
+++ b/ViewManager/ViewManager.py	Fri Apr 19 18:34:33 2013 +0200
@@ -1806,28 +1806,6 @@
         self.editActions.append(act)
         
         act = E5Action(QApplication.translate('ViewManager',
-                        'Convert selection to lower case'),
-                      QApplication.translate('ViewManager',
-                        'Convert selection to lower case'),
-                      QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')),
-                      0,
-                      self.editorActGrp, 'vm_edit_convert_selection_lower')
-        self.esm.setMapping(act, QsciScintilla.SCI_LOWERCASE)
-        act.triggered[()].connect(self.esm.map)
-        self.editActions.append(act)
-        
-        act = E5Action(QApplication.translate('ViewManager',
-                        'Convert selection to upper case'),
-                      QApplication.translate('ViewManager',
-                        'Convert selection to upper case'),
-                      QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+U')),
-                      0,
-                      self.editorActGrp, 'vm_edit_convert_selection_upper')
-        self.esm.setMapping(act, QsciScintilla.SCI_UPPERCASE)
-        act.triggered[()].connect(self.esm.map)
-        self.editActions.append(act)
-        
-        act = E5Action(QApplication.translate('ViewManager',
                         'Move to end of display line'),
                       QApplication.translate('ViewManager',
                         'Move to end of display line'),
@@ -2304,6 +2282,28 @@
             self.editActions.append(act)
         
         self.editorActGrp.setEnabled(False)
+        
+        self.editLowerCaseAct = E5Action(QApplication.translate('ViewManager',
+                        'Convert selection to lower case'),
+                    QApplication.translate('ViewManager',
+                        'Convert selection to lower case'),
+                    QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')),
+                    0,
+                    self.editActGrp, 'vm_edit_convert_selection_lower')
+        self.esm.setMapping(self.editLowerCaseAct, QsciScintilla.SCI_LOWERCASE)
+        self.editLowerCaseAct.triggered[()].connect(self.esm.map)
+        self.editActions.append(self.editLowerCaseAct)
+        
+        self.editUpperCaseAct = E5Action(QApplication.translate('ViewManager',
+                        'Convert selection to upper case'),
+                    QApplication.translate('ViewManager',
+                        'Convert selection to upper case'),
+                    QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+U')),
+                    0,
+                    self.editActGrp, 'vm_edit_convert_selection_upper')
+        self.esm.setMapping(self.editUpperCaseAct, QsciScintilla.SCI_UPPERCASE)
+        self.editUpperCaseAct.triggered[()].connect(self.esm.map)
+        self.editActions.append(self.editUpperCaseAct)
     
     def initEditMenu(self):
         """
@@ -2362,12 +2362,14 @@
         menu.addAction(self.streamCommentAct)
         menu.addAction(self.boxCommentAct)
         menu.addSeparator()
+        menu.addAction(self.editUpperCaseAct)
+        menu.addAction(self.editLowerCaseAct)
+        menu.addAction(self.sortAct)
+        menu.addSeparator()
         menu.addMenu(autocompletionMenu)
         menu.addSeparator()
         menu.addMenu(searchMenu)
         menu.addSeparator()
-        menu.addAction(self.sortAct)
-        menu.addSeparator()
         menu.addAction(self.gotoAct)
         menu.addAction(self.gotoBraceAct)
         menu.addAction(self.gotoLastEditAct)
@@ -5743,6 +5745,9 @@
                 self.gotoNextDefAct.setEnabled(False)
             
             self.sortAct.setEnabled(editor.selectionIsRectangle())
+            enable = editor.hasSelection()
+            self.editUpperCaseAct.setEnabled(enable)
+            self.editLowerCaseAct.setEnabled(enable)
             
             if setSb:
                 line, pos = editor.getCursorPosition()
@@ -5907,6 +5912,9 @@
         editor = self.sender()
         if editor:
             self.sortAct.setEnabled(editor.selectionIsRectangle())
+            enable = editor.hasSelection()
+            self.editUpperCaseAct.setEnabled(enable)
+            self.editLowerCaseAct.setEnabled(enable)
         else:
             self.sortAct.setEnabled(False)
     
diff -r b1c918293219 -r a2df0adce985 changelog
--- a/changelog	Thu Apr 18 19:09:20 2013 +0200
+++ b/changelog	Fri Apr 19 18:34:33 2013 +0200
@@ -17,6 +17,8 @@
   -- added the capability to preview HTML, Mardown and ReST files
   -- added the capability to sort lines spanned by a rectangular selection
      based on the selected text
+  -- added entires to convert the selection to upper/lower case to the
+     edit menu
 - Multi Project
   -- extended the context menus of the multi project browser to be able
      to add projects this way

eric ide

mercurial