82 """ |
82 """ |
83 self.gotFocus.emit() |
83 self.gotFocus.emit() |
84 super(QuickSearchLineEdit, self).focusInEvent(evt) # pass it on |
84 super(QuickSearchLineEdit, self).focusInEvent(evt) # pass it on |
85 |
85 |
86 |
86 |
87 # TODO: add an action to show code info for the object under the cursor (Ctrl-Alt-I) |
|
88 class ViewManager(QWidget): |
87 class ViewManager(QWidget): |
89 """ |
88 """ |
90 Base class inherited by all specific viewmanager classes. |
89 Base class inherited by all specific viewmanager classes. |
91 |
90 |
92 It defines the interface to be implemented by specific |
91 It defines the interface to be implemented by specific |
1377 """ left of the cursor.</p>""" |
1376 """ left of the cursor.</p>""" |
1378 )) |
1377 )) |
1379 self.calltipsAct.triggered.connect(self.__editShowCallTips) |
1378 self.calltipsAct.triggered.connect(self.__editShowCallTips) |
1380 self.editActions.append(self.calltipsAct) |
1379 self.editActions.append(self.calltipsAct) |
1381 |
1380 |
|
1381 self.codeInfoAct = E5Action( |
|
1382 QCoreApplication.translate('ViewManager', 'Code Info'), |
|
1383 UI.PixmapCache.getIcon("codeDocuViewer.png"), |
|
1384 QCoreApplication.translate('ViewManager', 'Code Info'), |
|
1385 QKeySequence(QCoreApplication.translate( |
|
1386 'ViewManager', "Ctrl+Alt+I", "Edit|Code Info")), |
|
1387 0, |
|
1388 self.editActGrp, 'vm_edit_codeinfo') |
|
1389 self.codeInfoAct.setStatusTip(QCoreApplication.translate( |
|
1390 'ViewManager', 'Show Code Info')) |
|
1391 self.codeInfoAct.setWhatsThis(QCoreApplication.translate( |
|
1392 'ViewManager', |
|
1393 """<b>Code Info</b>""" |
|
1394 """<p>Show code information based on the cursor position.</p>""" |
|
1395 )) |
|
1396 self.codeInfoAct.triggered.connect(self.__editShowCodeInfo) |
|
1397 self.editActions.append(self.codeInfoAct) |
|
1398 |
1382 self.sortAct = E5Action( |
1399 self.sortAct = E5Action( |
1383 QCoreApplication.translate('ViewManager', 'Sort'), |
1400 QCoreApplication.translate('ViewManager', 'Sort'), |
1384 QCoreApplication.translate('ViewManager', 'Sort'), |
1401 QCoreApplication.translate('ViewManager', 'Sort'), |
1385 QKeySequence(QCoreApplication.translate( |
1402 QKeySequence(QCoreApplication.translate( |
1386 'ViewManager', "Ctrl+Alt+S", "Edit|Sort")), |
1403 'ViewManager', "Ctrl+Alt+S", "Edit|Sort")), |
5431 def __editShowCallTips(self): |
5448 def __editShowCallTips(self): |
5432 """ |
5449 """ |
5433 Private method to handle the calltips action. |
5450 Private method to handle the calltips action. |
5434 """ |
5451 """ |
5435 self.activeWindow().callTip() |
5452 self.activeWindow().callTip() |
|
5453 |
|
5454 def __editShowCodeInfo(self): |
|
5455 """ |
|
5456 Private method to handle the code info action. |
|
5457 """ |
|
5458 self.showEditorInfo(self.activeWindow()) |
5436 |
5459 |
5437 ################################################################## |
5460 ################################################################## |
5438 ## Below are the action and utility methods for the search menu |
5461 ## Below are the action and utility methods for the search menu |
5439 ################################################################## |
5462 ################################################################## |
5440 |
5463 |
6788 Public method to show some information for a given editor. |
6811 Public method to show some information for a given editor. |
6789 |
6812 |
6790 @param editor editor to show information text for |
6813 @param editor editor to show information text for |
6791 @type Editor |
6814 @type Editor |
6792 """ |
6815 """ |
6793 # TODO: implement CodeDocumentationViewer |
|
6794 self.ui.documentationViewer().showInfo(editor) |
6816 self.ui.documentationViewer().showInfo(editor) |
6795 |
6817 |
6796 ################################################################## |
6818 ################################################################## |
6797 ## Below are protected utility methods |
6819 ## Below are protected utility methods |
6798 ################################################################## |
6820 ################################################################## |