diff -r 1f800f8295ea -r 9251c4dc4f7a eric6/ViewManager/ViewManager.py --- a/eric6/ViewManager/ViewManager.py Thu Sep 17 19:16:18 2020 +0200 +++ b/eric6/ViewManager/ViewManager.py Sat Sep 19 19:04:21 2020 +0200 @@ -119,6 +119,8 @@ 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 @@ -147,6 +149,7 @@ syntaxerrorToggled = pyqtSignal(Editor) previewStateChanged = pyqtSignal(bool) astViewerStateChanged = pyqtSignal(bool) + disViewerStateChanged = pyqtSignal(bool) editorLanguageChanged = pyqtSignal(Editor) editorTextChanged = pyqtSignal(Editor) editorLineChanged = pyqtSignal(str, int) @@ -3784,6 +3787,23 @@ self.astViewerAct.toggled[bool].connect(self.__astViewer) self.viewActions.append(self.astViewerAct) + self.disViewerAct = E5Action( + QCoreApplication.translate('ViewManager', 'Python DIS Viewer'), + UI.PixmapCache.getIcon("disassembly"), + QCoreApplication.translate('ViewManager', 'Python DIS 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 DIS 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 +3814,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 +3836,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 +3870,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 +6234,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 +6714,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 +6736,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 +6764,7 @@ self.bookmarkActGrp.setEnabled(True) self.__enableSpellingActions() self.astViewerAct.setEnabled(True) + self.disViewerAct.setEnabled(True) # activate the autosave timer if (