33 @param parent the parent widget of this widget |
33 @param parent the parent widget of this widget |
34 """ |
34 """ |
35 super(ExceptionLogger, self).__init__(parent) |
35 super(ExceptionLogger, self).__init__(parent) |
36 self.setObjectName("ExceptionLogger") |
36 self.setObjectName("ExceptionLogger") |
37 |
37 |
38 self.setWindowTitle(self.trUtf8("Exceptions")) |
38 self.setWindowTitle(self.tr("Exceptions")) |
39 |
39 |
40 self.setWordWrap(True) |
40 self.setWordWrap(True) |
41 self.setRootIsDecorated(True) |
41 self.setRootIsDecorated(True) |
42 self.setHeaderLabels([self.trUtf8("Exception")]) |
42 self.setHeaderLabels([self.tr("Exception")]) |
43 self.setSortingEnabled(False) |
43 self.setSortingEnabled(False) |
44 |
44 |
45 self.setContextMenuPolicy(Qt.CustomContextMenu) |
45 self.setContextMenuPolicy(Qt.CustomContextMenu) |
46 self.customContextMenuRequested.connect(self.__showContextMenu) |
46 self.customContextMenuRequested.connect(self.__showContextMenu) |
47 self.itemDoubleClicked.connect(self.__itemDoubleClicked) |
47 self.itemDoubleClicked.connect(self.__itemDoubleClicked) |
48 |
48 |
49 self.setWhatsThis(self.trUtf8( |
49 self.setWhatsThis(self.tr( |
50 """<b>Exceptions Logger</b>""" |
50 """<b>Exceptions Logger</b>""" |
51 """<p>This windows shows a trace of all exceptions, that have""" |
51 """<p>This windows shows a trace of all exceptions, that have""" |
52 """ occured during the last debugging session. Initially only""" |
52 """ occured during the last debugging session. Initially only""" |
53 """ the exception type and exception message are shown. After""" |
53 """ the exception type and exception message are shown. After""" |
54 """ the expansion of this entry, the complete call stack as""" |
54 """ the expansion of this entry, the complete call stack as""" |
55 """ reported by the client is show with the most recent call""" |
55 """ reported by the client is show with the most recent call""" |
56 """ first.</p>""" |
56 """ first.</p>""" |
57 )) |
57 )) |
58 |
58 |
59 self.menu = QMenu(self) |
59 self.menu = QMenu(self) |
60 self.menu.addAction(self.trUtf8("Show source"), self.__openSource) |
60 self.menu.addAction(self.tr("Show source"), self.__openSource) |
61 self.menu.addAction(self.trUtf8("Clear"), self.clear) |
61 self.menu.addAction(self.tr("Clear"), self.clear) |
62 self.menu.addSeparator() |
62 self.menu.addSeparator() |
63 self.menu.addAction(self.trUtf8("Configure..."), self.__configure) |
63 self.menu.addAction(self.tr("Configure..."), self.__configure) |
64 |
64 |
65 self.backMenu = QMenu(self) |
65 self.backMenu = QMenu(self) |
66 self.backMenu.addAction(self.trUtf8("Clear"), self.clear) |
66 self.backMenu.addAction(self.tr("Clear"), self.clear) |
67 self.backMenu.addSeparator() |
67 self.backMenu.addSeparator() |
68 self.backMenu.addAction(self.trUtf8("Configure..."), self.__configure) |
68 self.backMenu.addAction(self.tr("Configure..."), self.__configure) |
69 |
69 |
70 def __itemDoubleClicked(self, itm): |
70 def __itemDoubleClicked(self, itm): |
71 """ |
71 """ |
72 Private slot to handle the double click of an item. |
72 Private slot to handle the double click of an item. |
73 |
73 |
97 @param stackTrace list of stack entries. |
97 @param stackTrace list of stack entries. |
98 """ |
98 """ |
99 itm = QTreeWidgetItem(self) |
99 itm = QTreeWidgetItem(self) |
100 if exceptionType is None: |
100 if exceptionType is None: |
101 itm.setText( |
101 itm.setText( |
102 0, self.trUtf8('An unhandled exception occured.' |
102 0, self.tr('An unhandled exception occured.' |
103 ' See the shell window for details.')) |
103 ' See the shell window for details.')) |
104 return |
104 return |
105 |
105 |
106 if exceptionMessage == '': |
106 if exceptionMessage == '': |
107 itm.setText(0, "{0}".format(exceptionType)) |
107 itm.setText(0, "{0}".format(exceptionType)) |
108 else: |
108 else: |