eric6/Debugger/DebugViewer.py

branch
multi_processing
changeset 7418
6214fa980a9d
parent 7412
0a995393d2ba
child 7421
4a9900aef04e
equal deleted inserted replaced
7417:9391a330f50f 7418:6214fa980a9d
48 @signal preferencesChanged() emitted to react on changed preferences 48 @signal preferencesChanged() emitted to react on changed preferences
49 """ 49 """
50 sourceFile = pyqtSignal(str, int) 50 sourceFile = pyqtSignal(str, int)
51 preferencesChanged = pyqtSignal() 51 preferencesChanged = pyqtSignal()
52 52
53 ThreadIdRole = Qt.UserRole + 1
54
53 def __init__(self, debugServer, parent=None): 55 def __init__(self, debugServer, parent=None):
54 """ 56 """
55 Constructor 57 Constructor
56 58
57 @param debugServer reference to the debug server object (DebugServer) 59 @param debugServer reference to the debug server object (DebugServer)
247 249
248 # add the threads viewer 250 # add the threads viewer
249 self.__mainLayout.addWidget(QLabel(self.tr("Threads:"))) 251 self.__mainLayout.addWidget(QLabel(self.tr("Threads:")))
250 self.__threadList = QTreeWidget() 252 self.__threadList = QTreeWidget()
251 self.__threadList.setHeaderLabels( 253 self.__threadList.setHeaderLabels(
252 [self.tr("ID"), self.tr("Name"), 254 [self.tr("Name"), self.tr("State"), ""])
253 self.tr("State"), ""])
254 self.__threadList.setSortingEnabled(True) 255 self.__threadList.setSortingEnabled(True)
255 self.__mainLayout.addWidget(self.__threadList) 256 self.__mainLayout.addWidget(self.__threadList)
256 257
257 self.__doThreadListUpdate = True 258 self.__doThreadListUpdate = True
258 259
615 debugStatus = 0 616 debugStatus = 0
616 else: 617 else:
617 state = self.tr("running") 618 state = self.tr("running")
618 icon = "mediaPlaybackStart" 619 icon = "mediaPlaybackStart"
619 itm = QTreeWidgetItem(self.__threadList, 620 itm = QTreeWidgetItem(self.__threadList,
620 ["{0:d}".format(thread['id']), 621 [thread['name'], state])
621 thread['name'], state]) 622 itm.setData(0, self.ThreadIdRole, thread['id'])
622 itm.setIcon(0, UI.PixmapCache.getIcon(icon)) 623 itm.setIcon(0, UI.PixmapCache.getIcon(icon))
623 if thread['id'] == currentID: 624 if thread['id'] == currentID:
624 citm = itm 625 citm = itm
625 626
626 self.__threadList.header().resizeSections( 627 self.__threadList.header().resizeSections(
657 @param current reference to the new current item (QTreeWidgetItem) 658 @param current reference to the new current item (QTreeWidgetItem)
658 @param previous reference to the previous current item 659 @param previous reference to the previous current item
659 (QTreeWidgetItem) 660 (QTreeWidgetItem)
660 """ 661 """
661 if current is not None and self.__doThreadListUpdate: 662 if current is not None and self.__doThreadListUpdate:
662 tid = int(current.text(0)) 663 tid = current.data(0, self.ThreadIdRole)
663 self.debugServer.remoteSetThread(self.getSelectedDebuggerId(), tid) 664 self.debugServer.remoteSetThread(self.getSelectedDebuggerId(), tid)
664 665
665 def __callStackFrameSelected(self, frameNo): 666 def __callStackFrameSelected(self, frameNo):
666 """ 667 """
667 Private slot to handle the selection of a call stack entry of the 668 Private slot to handle the selection of a call stack entry of the

eric ide

mercurial