eric6/QScintilla/Shell.py

branch
multi_processing
changeset 7408
0d58e708f57b
parent 7389
770ffcb88be5
child 7412
0a995393d2ba
--- a/eric6/QScintilla/Shell.py	Mon Feb 10 18:49:49 2020 +0100
+++ b/eric6/QScintilla/Shell.py	Mon Feb 10 19:49:45 2020 +0100
@@ -16,7 +16,7 @@
 except ImportError:
     from ThirdParty.enum import Enum
 
-from PyQt5.QtCore import pyqtSignal, QFileInfo, Qt, QEvent
+from PyQt5.QtCore import pyqtSignal, pyqtSlot, QFileInfo, Qt, QEvent
 from PyQt5.QtGui import QClipboard, QPalette, QFont
 from PyQt5.QtWidgets import (
     QDialog, QInputDialog, QApplication, QMenu, QWidget, QHBoxLayout,
@@ -244,6 +244,8 @@
         dbs.clientSignal.connect(self.__clientSignal)
         self.dbs = dbs
         
+        self.__debugUI = None
+        
         # Initialize instance variables.
         self.__initialise()
         self.prline = 0
@@ -603,6 +605,7 @@
         @param ui reference to the debugger UI object (DebugUI)
         """
         ui.exceptionInterrupt.connect(self.__writePrompt)
+        self.__debugUI = ui
         
     def __initialise(self):
         """
@@ -1335,7 +1338,10 @@
                 super(Shell, self).keyPressEvent(ev)
                 self.incrementalSearchActive = True
                 if ac and self.racEnabled:
-                    self.dbs.remoteCompletion(self.completionText + txt)
+                    self.dbs.remoteCompletion(
+                        self.__debugUI.getSelectedDebuggerId(),
+                        self.completionText + txt
+                    )
             else:
                 self.__insertTextNoEcho(txt)
         else:
@@ -1367,7 +1373,10 @@
             if self.inContinue and not buf[:index - len(sys.ps2)].strip():
                 self.SendScintilla(cmd)
             elif self.racEnabled:
-                self.dbs.remoteCompletion(buf)
+                self.dbs.remoteCompletion(
+                    self.__debugUI.getSelectedDebuggerId(),
+                    buf
+                )
         
     def __QScintillaLeftDeleteCommand(self, method):
         """
@@ -1395,7 +1404,10 @@
                 db = 1
             if db and ac and self.racEnabled and self.completionText:
                 delta = len(self.text(line)) - oldLength
-                self.dbs.remoteCompletion(self.completionText[:delta])
+                self.dbs.remoteCompletion(
+                    self.__debugUI.getSelectedDebuggerId(),
+                    self.completionText[:delta]
+                )
         
     def __QScintillaDeleteBack(self):
         """
@@ -1862,10 +1874,8 @@
                 self.vm.quit()
                 return
             
-            self.dbs.remoteStatement(
-                e5App().getObject("DebugUI").getSelectedDebuggerId(),
-                cmd
-            )
+            self.dbs.remoteStatement(self.__debugUI.getSelectedDebuggerId(),
+                                     cmd)
             while self.inCommandExecution:
                 try:
                     QApplication.processEvents()
@@ -2081,7 +2091,8 @@
                 self.dbs.clientProcessStdout.disconnect(self.__writeStdOut)
                 self.dbs.clientProcessStderr.disconnect(self.__writeStdErr)
             self.__showStdOutErr = showStdOutErr
-        
+    
+    @pyqtSlot(list, str)
     def __showCompletions(self, completions, text):
         """
         Private method to display the possible completions.

eric ide

mercurial