24 |
24 |
25 class CallTraceViewer(QWidget, Ui_CallTraceViewer): |
25 class CallTraceViewer(QWidget, Ui_CallTraceViewer): |
26 """ |
26 """ |
27 Class implementing the Call Trace viewer widget. |
27 Class implementing the Call Trace viewer widget. |
28 |
28 |
29 @signal sourceFile(str, int) emitted to show the source of a call/return point |
29 @signal sourceFile(str, int) emitted to show the source of a call/return |
|
30 point |
30 """ |
31 """ |
31 sourceFile = pyqtSignal(str, int) |
32 sourceFile = pyqtSignal(str, int) |
32 |
33 |
33 def __init__(self, debugServer, parent=None): |
34 def __init__(self, debugServer, parent=None): |
34 """ |
35 """ |
40 super(CallTraceViewer, self).__init__(parent) |
41 super(CallTraceViewer, self).__init__(parent) |
41 self.setupUi(self) |
42 self.setupUi(self) |
42 |
43 |
43 self.__dbs = debugServer |
44 self.__dbs = debugServer |
44 |
45 |
45 self.startTraceButton.setIcon(UI.PixmapCache.getIcon("callTraceStart.png")) |
46 self.startTraceButton.setIcon( |
46 self.stopTraceButton.setIcon(UI.PixmapCache.getIcon("callTraceStop.png")) |
47 UI.PixmapCache.getIcon("callTraceStart.png")) |
|
48 self.stopTraceButton.setIcon( |
|
49 UI.PixmapCache.getIcon("callTraceStop.png")) |
47 self.resizeButton.setIcon(UI.PixmapCache.getIcon("resizeColumns.png")) |
50 self.resizeButton.setIcon(UI.PixmapCache.getIcon("resizeColumns.png")) |
48 self.clearButton.setIcon(UI.PixmapCache.getIcon("editDelete.png")) |
51 self.clearButton.setIcon(UI.PixmapCache.getIcon("editDelete.png")) |
49 self.saveButton.setIcon(UI.PixmapCache.getIcon("fileSave.png")) |
52 self.saveButton.setIcon(UI.PixmapCache.getIcon("fileSave.png")) |
50 |
53 |
51 self.__headerItem = QTreeWidgetItem(["", self.trUtf8("From"), self.trUtf8("To")]) |
54 self.__headerItem = QTreeWidgetItem( |
|
55 ["", self.trUtf8("From"), self.trUtf8("To")]) |
52 self.__headerItem.setIcon(0, UI.PixmapCache.getIcon("callReturn.png")) |
56 self.__headerItem.setIcon(0, UI.PixmapCache.getIcon("callReturn.png")) |
53 self.callTrace.setHeaderItem(self.__headerItem) |
57 self.callTrace.setHeaderItem(self.__headerItem) |
54 |
58 |
55 self.__callStack = [] |
59 self.__callStack = [] |
56 |
60 |
153 itm = self.callTrace.itemBelow(itm) |
157 itm = self.callTrace.itemBelow(itm) |
154 f.close() |
158 f.close() |
155 except IOError as err: |
159 except IOError as err: |
156 E5MessageBox.critical(self, |
160 E5MessageBox.critical(self, |
157 self.trUtf8("Error saving Call Trace Info"), |
161 self.trUtf8("Error saving Call Trace Info"), |
158 self.trUtf8("""<p>The call trace info could not be written""" |
162 self.trUtf8("""<p>The call trace info could not""" |
159 """ to <b>{0}</b></p><p>Reason: {1}</p>""")\ |
163 """ be written to <b>{0}</b></p>""" |
|
164 """<p>Reason: {1}</p>""")\ |
160 .format(fname, str(err))) |
165 .format(fname, str(err))) |
161 |
166 |
162 @pyqtSlot(QTreeWidgetItem, int) |
167 @pyqtSlot(QTreeWidgetItem, int) |
163 def on_callTrace_itemDoubleClicked(self, item, column): |
168 def on_callTrace_itemDoubleClicked(self, item, column): |
164 """ |
169 """ |
215 """ |
220 """ |
216 if isCall: |
221 if isCall: |
217 icon = UI.PixmapCache.getIcon("forward.png") |
222 icon = UI.PixmapCache.getIcon("forward.png") |
218 else: |
223 else: |
219 icon = UI.PixmapCache.getIcon("back.png") |
224 icon = UI.PixmapCache.getIcon("back.png") |
220 parentItem = self.__callStack[-1] if self.__callStack else self.callTrace |
225 parentItem = \ |
|
226 self.__callStack[-1] if self.__callStack else self.callTrace |
221 |
227 |
222 if self.__projectMode: |
228 if self.__projectMode: |
223 fromFile = self.__project.getRelativePath(fromFile) |
229 fromFile = self.__project.getRelativePath(fromFile) |
224 toFile = self.__project.getRelativePath(toFile) |
230 toFile = self.__project.getRelativePath(toFile) |
225 |
231 |