src/eric7/Debugger/DebugUI.py

branch
server
changeset 10630
552a790fd9bc
parent 10597
fbe93720ee9f
child 10704
27d21e5163b8
--- a/src/eric7/Debugger/DebugUI.py	Tue Feb 27 15:05:53 2024 +0100
+++ b/src/eric7/Debugger/DebugUI.py	Fri Mar 08 15:30:23 2024 +0100
@@ -2565,6 +2565,14 @@
             scriptName = self.lastDebuggedFile
         else:
             scriptName = ""
+        if (
+            scriptName
+            and FileSystemUtilities.isRemoteFileName(scriptName)
+            and not self.ui.isEricServerConnected()
+        ):
+            self.__showNotConnectedWarning(title=cap, name=scriptName)
+            return
+
         dlg = StartDialog(
             cap,
             self.lastUsedVenvName,
@@ -2661,7 +2669,7 @@
                 FileSystemUtilities.isRemoteFileName(fn)
                 and not self.ui.isEricServerConnected()
             ):
-                self.__showNotConnectedWarning(title=cap)
+                self.__showNotConnectedWarning(title=cap, name=fn)
                 return
 
             # save the filename for use by the restart method
@@ -3205,18 +3213,20 @@
         """
         return self.debugServer.getProjectEnvironmentString()
 
-    def __showNotConnectedWarning(self, title):
+    def __showNotConnectedWarning(self, title, name=""):
         """
         Private method to show a warning about a not connected eric-ide server.
 
         @param title title for the dialog
         @type str
+        @param name name of the file (defaults to "")
+        @type str (optional)
         """
         EricMessageBox.warning(
             None,
             title,
             self.tr(
-                "<p>The selected file is located on an eric-ide server but no such"
-                " server is connected. Aborting...</p>"
-            ),
+                "<p>The selected file <b>{0}</b> is located on an eric-ide server but"
+                " no such server is connected. Aborting...</p>"
+            ).format(name),
         )

eric ide

mercurial