eric6/QScintilla/ShellWindow.py

changeset 8265
0090cfa83159
parent 8220
006ee31b4835
--- a/eric6/QScintilla/ShellWindow.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/QScintilla/ShellWindow.py	Tue Apr 27 17:25:06 2021 +0200
@@ -65,6 +65,8 @@
         self.setStyle(Preferences.getUI("Style"),
                       Preferences.getUI("StyleSheet"))
         
+        self.__lastDebuggerId = ""
+        
         # initialize the APIs manager
         self.__apisManager = APIsManager(parent=self)
         
@@ -72,7 +74,11 @@
         self.__debugServer = DebugServer(originalPathString,
                                          preventPassiveDebugging=True,
                                          parent=self)
+        self.__debugServer.clientDebuggerId.connect(self.__clientDebuggerId)
+        
         self.__shell = Shell(self.__debugServer, self, None, True, self)
+        self.__shell.registerDebuggerIdMethod(self.getDebuggerId)
+        
         self.__searchWidget = SearchWidget(self.__shell, self, showLine=True)
         
         centralWidget = QWidget()
@@ -132,6 +138,24 @@
         
         event.accept()
     
+    def __clientDebuggerId(self, debuggerId):
+        """
+        Private slot to receive the ID of a newly connected debugger backend.
+        
+        @param debuggerId ID of a newly connected debugger backend
+        @type str
+        """
+        self.__lastDebuggerId = debuggerId
+    
+    def getDebuggerId(self):
+        """
+        Public method to get the most recently registered debugger ID.
+        
+        @return debugger ID
+        @rtype str
+        """
+        return self.__lastDebuggerId
+    
     ##################################################################
     ## Below are API handling methods
     ##################################################################

eric ide

mercurial