ViewManager/ViewManager.py

changeset 5905
f31960634997
parent 5900
cd90bfdc1247
child 5907
c928af9fce32
--- a/ViewManager/ViewManager.py	Sun Oct 15 17:21:51 2017 +0200
+++ b/ViewManager/ViewManager.py	Sun Oct 15 19:40:26 2017 +0200
@@ -84,7 +84,6 @@
         super(QuickSearchLineEdit, self).focusInEvent(evt)   # pass it on
 
 
-# TODO: add an action to show code info for the object under the cursor (Ctrl-Alt-I)
 class ViewManager(QWidget):
     """
     Base class inherited by all specific viewmanager classes.
@@ -1379,6 +1378,24 @@
         self.calltipsAct.triggered.connect(self.__editShowCallTips)
         self.editActions.append(self.calltipsAct)
         
+        self.codeInfoAct = E5Action(
+            QCoreApplication.translate('ViewManager', 'Code Info'),
+            UI.PixmapCache.getIcon("codeDocuViewer.png"),
+            QCoreApplication.translate('ViewManager', 'Code Info'),
+            QKeySequence(QCoreApplication.translate(
+                'ViewManager', "Ctrl+Alt+I", "Edit|Code Info")),
+            0,
+            self.editActGrp, 'vm_edit_codeinfo')
+        self.codeInfoAct.setStatusTip(QCoreApplication.translate(
+            'ViewManager', 'Show Code Info'))
+        self.codeInfoAct.setWhatsThis(QCoreApplication.translate(
+            'ViewManager',
+            """<b>Code Info</b>"""
+            """<p>Show code information based on the cursor position.</p>"""
+        ))
+        self.codeInfoAct.triggered.connect(self.__editShowCodeInfo)
+        self.editActions.append(self.codeInfoAct)
+        
         self.sortAct = E5Action(
             QCoreApplication.translate('ViewManager', 'Sort'),
             QCoreApplication.translate('ViewManager', 'Sort'),
@@ -5434,6 +5451,12 @@
         """
         self.activeWindow().callTip()
     
+    def __editShowCodeInfo(self):
+        """
+        Private method to handle the code info action.
+        """
+        self.showEditorInfo(self.activeWindow())
+    
     ##################################################################
     ## Below are the action and utility methods for the search menu
     ##################################################################
@@ -6790,7 +6813,6 @@
         @param editor editor to show information text for
         @type Editor
         """
-        # TODO: implement CodeDocumentationViewer
         self.ui.documentationViewer().showInfo(editor)
     
     ##################################################################

eric ide

mercurial