13 |
13 |
14 import enum |
14 import enum |
15 |
15 |
16 |
16 |
17 from PyQt5.QtCore import pyqtSlot, Qt, QTimer |
17 from PyQt5.QtCore import pyqtSlot, Qt, QTimer |
18 from PyQt5.QtGui import QCursor, QBrush |
18 from PyQt5.QtGui import QBrush |
19 from PyQt5.QtWidgets import ( |
19 from PyQt5.QtWidgets import ( |
20 QApplication, QTreeWidgetItem, QAbstractItemView, QWidget, QMenu |
20 QTreeWidgetItem, QAbstractItemView, QWidget, QMenu |
21 ) |
21 ) |
22 |
22 |
23 from E5Gui.E5Application import e5App |
23 from E5Gui.E5Application import e5App |
|
24 from E5Gui.E5OverrideCursor import E5OverrideCursor |
24 |
25 |
25 import Preferences |
26 import Preferences |
26 |
27 |
27 from .Ui_PythonDisViewer import Ui_PythonDisViewer |
28 from .Ui_PythonDisViewer import Ui_PythonDisViewer |
28 |
29 |
476 if filename: |
477 if filename: |
477 filename = os.path.basename(filename) |
478 filename = os.path.basename(filename) |
478 else: |
479 else: |
479 filename = "<dis>" |
480 filename = "<dis>" |
480 |
481 |
481 QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) |
482 with E5OverrideCursor(): |
482 try: |
483 try: |
483 codeObject = self.__tryCompile(source, filename) |
484 codeObject = self.__tryCompile(source, filename) |
484 except Exception as exc: |
485 except Exception as exc: |
485 codeObject = None |
486 codeObject = None |
486 self.__createErrorItem(str(exc)) |
487 self.__createErrorItem(str(exc)) |
487 |
|
488 if codeObject: |
|
489 self.setUpdatesEnabled(False) |
|
490 block = self.disWidget.blockSignals(True) |
|
491 |
488 |
492 self.__disassembleObject(codeObject, self.disWidget, filename) |
489 if codeObject: |
493 QTimer.singleShot(0, self.__resizeDisColumns) |
490 self.setUpdatesEnabled(False) |
494 |
491 block = self.disWidget.blockSignals(True) |
495 self.disWidget.blockSignals(block) |
492 |
496 self.setUpdatesEnabled(True) |
493 self.__disassembleObject(codeObject, self.disWidget, filename) |
497 |
494 QTimer.singleShot(0, self.__resizeDisColumns) |
498 QApplication.restoreOverrideCursor() |
495 |
|
496 self.disWidget.blockSignals(block) |
|
497 self.setUpdatesEnabled(True) |
499 |
498 |
500 @pyqtSlot(dict) |
499 @pyqtSlot(dict) |
501 def showDisassembly(self, disassembly): |
500 def showDisassembly(self, disassembly): |
502 """ |
501 """ |
503 Public slot to receive a code disassembly from the debug client. |
502 Public slot to receive a code disassembly from the debug client. |