48 self.resizeButton.setIcon(UI.PixmapCache.getIcon("resizeColumns.png")) |
48 self.resizeButton.setIcon(UI.PixmapCache.getIcon("resizeColumns.png")) |
49 self.clearButton.setIcon(UI.PixmapCache.getIcon("editDelete.png")) |
49 self.clearButton.setIcon(UI.PixmapCache.getIcon("editDelete.png")) |
50 self.saveButton.setIcon(UI.PixmapCache.getIcon("fileSave.png")) |
50 self.saveButton.setIcon(UI.PixmapCache.getIcon("fileSave.png")) |
51 |
51 |
52 self.__headerItem = QTreeWidgetItem( |
52 self.__headerItem = QTreeWidgetItem( |
53 ["", self.trUtf8("From"), self.trUtf8("To")]) |
53 ["", self.tr("From"), self.tr("To")]) |
54 self.__headerItem.setIcon(0, UI.PixmapCache.getIcon("callReturn.png")) |
54 self.__headerItem.setIcon(0, UI.PixmapCache.getIcon("callReturn.png")) |
55 self.callTrace.setHeaderItem(self.__headerItem) |
55 self.callTrace.setHeaderItem(self.__headerItem) |
56 |
56 |
57 self.__callStack = [] |
57 self.__callStack = [] |
58 |
58 |
118 Private slot to save the call trace info to a file. |
118 Private slot to save the call trace info to a file. |
119 """ |
119 """ |
120 if self.callTrace.topLevelItemCount() > 0: |
120 if self.callTrace.topLevelItemCount() > 0: |
121 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( |
121 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( |
122 self, |
122 self, |
123 self.trUtf8("Save Call Trace Info"), |
123 self.tr("Save Call Trace Info"), |
124 "", |
124 "", |
125 self.trUtf8("Text Files (*.txt);;All Files (*)"), |
125 self.tr("Text Files (*.txt);;All Files (*)"), |
126 None, |
126 None, |
127 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) |
127 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) |
128 if fname: |
128 if fname: |
129 ext = QFileInfo(fname).suffix() |
129 ext = QFileInfo(fname).suffix() |
130 if not ext: |
130 if not ext: |
132 if ex: |
132 if ex: |
133 fname += ex |
133 fname += ex |
134 if QFileInfo(fname).exists(): |
134 if QFileInfo(fname).exists(): |
135 res = E5MessageBox.yesNo( |
135 res = E5MessageBox.yesNo( |
136 self, |
136 self, |
137 self.trUtf8("Save Call Trace Info"), |
137 self.tr("Save Call Trace Info"), |
138 self.trUtf8("<p>The file <b>{0}</b> already exists." |
138 self.tr("<p>The file <b>{0}</b> already exists." |
139 " Overwrite it?</p>").format(fname), |
139 " Overwrite it?</p>").format(fname), |
140 icon=E5MessageBox.Warning) |
140 icon=E5MessageBox.Warning) |
141 if not res: |
141 if not res: |
142 return |
142 return |
143 fname = Utilities.toNativeSeparators(fname) |
143 fname = Utilities.toNativeSeparators(fname) |
144 |
144 |
157 itm = self.callTrace.itemBelow(itm) |
157 itm = self.callTrace.itemBelow(itm) |
158 f.close() |
158 f.close() |
159 except IOError as err: |
159 except IOError as err: |
160 E5MessageBox.critical( |
160 E5MessageBox.critical( |
161 self, |
161 self, |
162 self.trUtf8("Error saving Call Trace Info"), |
162 self.tr("Error saving Call Trace Info"), |
163 self.trUtf8("""<p>The call trace info could not""" |
163 self.tr("""<p>The call trace info could not""" |
164 """ be written to <b>{0}</b></p>""" |
164 """ be written to <b>{0}</b></p>""" |
165 """<p>Reason: {1}</p>""") |
165 """<p>Reason: {1}</p>""") |
166 .format(fname, str(err))) |
166 .format(fname, str(err))) |
167 |
167 |
168 @pyqtSlot(QTreeWidgetItem, int) |
168 @pyqtSlot(QTreeWidgetItem, int) |
169 def on_callTrace_itemDoubleClicked(self, item, column): |
169 def on_callTrace_itemDoubleClicked(self, item, column): |
170 """ |
170 """ |