DebugViewer: don't show the thread ID anymore because it is meaningless for the user. multi_processing

Sat, 15 Feb 2020 16:30:08 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 15 Feb 2020 16:30:08 +0100
branch
multi_processing
changeset 7418
6214fa980a9d
parent 7417
9391a330f50f
child 7419
9c1163735448

DebugViewer: don't show the thread ID anymore because it is meaningless for the user.

eric6/Debugger/DebugViewer.py file | annotate | diff | comparison | revisions
--- a/eric6/Debugger/DebugViewer.py	Sat Feb 15 15:59:24 2020 +0100
+++ b/eric6/Debugger/DebugViewer.py	Sat Feb 15 16:30:08 2020 +0100
@@ -50,6 +50,8 @@
     sourceFile = pyqtSignal(str, int)
     preferencesChanged = pyqtSignal()
     
+    ThreadIdRole = Qt.UserRole + 1
+    
     def __init__(self, debugServer, parent=None):
         """
         Constructor
@@ -249,8 +251,7 @@
         self.__mainLayout.addWidget(QLabel(self.tr("Threads:")))
         self.__threadList = QTreeWidget()
         self.__threadList.setHeaderLabels(
-            [self.tr("ID"), self.tr("Name"),
-             self.tr("State"), ""])
+            [self.tr("Name"), self.tr("State"), ""])
         self.__threadList.setSortingEnabled(True)
         self.__mainLayout.addWidget(self.__threadList)
         
@@ -617,8 +618,8 @@
                     state = self.tr("running")
                     icon = "mediaPlaybackStart"
                 itm = QTreeWidgetItem(self.__threadList,
-                                      ["{0:d}".format(thread['id']),
-                                       thread['name'], state])
+                                      [thread['name'], state])
+                itm.setData(0, self.ThreadIdRole, thread['id'])
                 itm.setIcon(0, UI.PixmapCache.getIcon(icon))
                 if thread['id'] == currentID:
                     citm = itm
@@ -659,7 +660,7 @@
             (QTreeWidgetItem)
         """
         if current is not None and self.__doThreadListUpdate:
-            tid = int(current.text(0))
+            tid = current.data(0, self.ThreadIdRole)
             self.debugServer.remoteSetThread(self.getSelectedDebuggerId(), tid)
     
     def __callStackFrameSelected(self, frameNo):

eric ide

mercurial