diff -r e2b36c2167b7 -r 5371a22cf2aa eric6/ViewManager/ViewManager.py --- a/eric6/ViewManager/ViewManager.py Sat Sep 05 11:26:33 2020 +0200 +++ b/eric6/ViewManager/ViewManager.py Sat Oct 03 11:13:46 2020 +0200 @@ -119,12 +119,16 @@ preview state @signal astViewerStateChanged(bool) emitted to signal a change in the AST viewer state + @signal disViewerStateChanged(bool) emitted to signal a change in the + DIS viewer state @signal editorLanguageChanged(Editor) emitted to signal a change of an editor's language @signal editorTextChanged(Editor) emitted to signal a change of an editor's text @signal editorLineChanged(str,int) emitted to signal a change of an editor's current line (line is given one based) + @signal editorLineChangedEd(Editor,int) emitted to signal a change of an + editor's current line (line is given one based) @signal editorDoubleClickedEd(Editor, position, buttons) emitted to signal a mouse double click in an editor """ @@ -147,9 +151,11 @@ syntaxerrorToggled = pyqtSignal(Editor) previewStateChanged = pyqtSignal(bool) astViewerStateChanged = pyqtSignal(bool) + disViewerStateChanged = pyqtSignal(bool) editorLanguageChanged = pyqtSignal(Editor) editorTextChanged = pyqtSignal(Editor) editorLineChanged = pyqtSignal(str, int) + editorLineChangedEd = pyqtSignal(Editor, int) editorDoubleClickedEd = pyqtSignal(Editor, QPoint, int) def __init__(self): @@ -3784,6 +3790,25 @@ self.astViewerAct.toggled[bool].connect(self.__astViewer) self.viewActions.append(self.astViewerAct) + self.disViewerAct = E5Action( + QCoreApplication.translate( + 'ViewManager', 'Python Disassembly Viewer'), + UI.PixmapCache.getIcon("disassembly"), + QCoreApplication.translate( + 'ViewManager', 'Python Disassembly Viewer'), + 0, 0, self, 'vm_python_dis_viewer', True) + self.disViewerAct.setStatusTip(QCoreApplication.translate( + 'ViewManager', 'Show the Disassembly for the current Python file')) + self.disViewerAct.setWhatsThis(QCoreApplication.translate( + 'ViewManager', + """<b>Python Disassembly Viewer</b>""" + """<p>This opens the a tree view of the Disassembly of the""" + """ current Python source file.</p>""" + )) + self.disViewerAct.setChecked(False) + self.disViewerAct.toggled[bool].connect(self.__disViewer) + self.viewActions.append(self.disViewerAct) + self.viewActGrp.setEnabled(False) self.viewFoldActGrp.setEnabled(False) self.unhighlightAct.setEnabled(False) @@ -3794,6 +3819,7 @@ self.prevSplitAct.setEnabled(False) self.previewAct.setEnabled(True) self.astViewerAct.setEnabled(False) + self.disViewerAct.setEnabled(False) self.newDocumentViewAct.setEnabled(False) self.newDocumentSplitViewAct.setEnabled(False) @@ -3815,6 +3841,7 @@ menu.addSeparator() menu.addAction(self.previewAct) menu.addAction(self.astViewerAct) + menu.addAction(self.disViewerAct) menu.addSeparator() menu.addAction(self.unhighlightAct) menu.addSeparator() @@ -3848,6 +3875,7 @@ tb.addSeparator() tb.addAction(self.previewAct) tb.addAction(self.astViewerAct) + tb.addAction(self.disViewerAct) tb.addSeparator() tb.addAction(self.newDocumentViewAct) if self.canSplit(): @@ -6211,6 +6239,14 @@ """ self.astViewerStateChanged.emit(checked) + def __disViewer(self, checked): + """ + Private slot to handle a change of the DIS Viewer selection state. + + @param checked state of the action (boolean) + """ + self.disViewerStateChanged.emit(checked) + ################################################################## ## Below are the action methods for the macro menu ################################################################## @@ -6683,6 +6719,7 @@ self.splitOrientationAct.setEnabled(False) self.previewAct.setEnabled(True) self.astViewerAct.setEnabled(False) + self.disViewerAct.setEnabled(False) self.macroActGrp.setEnabled(False) self.bookmarkActGrp.setEnabled(False) self.__enableSpellingActions() @@ -6704,6 +6741,9 @@ # hide the AST Viewer via its action self.astViewerAct.setChecked(False) + # hide the DIS Viewer via its action + self.disViewerAct.setChecked(False) + def __editorOpened(self): """ Private slot to handle the editorOpened signal. @@ -6729,6 +6769,7 @@ self.bookmarkActGrp.setEnabled(True) self.__enableSpellingActions() self.astViewerAct.setEnabled(True) + self.disViewerAct.setEnabled(True) # activate the autosave timer if (