Debugger/ExceptionLogger.py

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

eric ide

mercurial