src/eric7/Debugger/DebugUI.py

branch
server
changeset 10564
0de57f082daa
parent 10540
7631c0ba2877
child 10597
fbe93720ee9f
equal deleted inserted replaced
10563:b4b47c1a02ba 10564:0de57f082daa
2046 2046
2047 fn = editor.getFileName() 2047 fn = editor.getFileName()
2048 self.clientType = editor.determineFileType() 2048 self.clientType = editor.determineFileType()
2049 self.lastStartAction = 5 2049 self.lastStartAction = 5
2050 2050
2051 if (
2052 FileSystemUtilities.isRemoteFileName(fn)
2053 and not self.ui.isEricServerConnected()
2054 ):
2055 self.__showNotConnectedWarning(title=cap)
2056 return
2057
2051 # save the filename for use by the restart method 2058 # save the filename for use by the restart method
2052 self.lastDebuggedFile = fn 2059 self.lastDebuggedFile = fn
2053 self.restartAct.setEnabled(True) 2060 self.restartAct.setEnabled(True)
2054 2061
2055 # save the most recently used virtual environment 2062 # save the most recently used virtual environment
2240 return 2247 return
2241 2248
2242 fn = editor.getFileName() 2249 fn = editor.getFileName()
2243 self.clientType = editor.determineFileType() 2250 self.clientType = editor.determineFileType()
2244 self.lastStartAction = 7 2251 self.lastStartAction = 7
2252
2253 if (
2254 FileSystemUtilities.isRemoteFileName(fn)
2255 and not self.ui.isEricServerConnected()
2256 ):
2257 self.__showNotConnectedWarning(title=cap)
2258 return
2245 2259
2246 # save the filename for use by the restart method 2260 # save the filename for use by the restart method
2247 self.lastDebuggedFile = fn 2261 self.lastDebuggedFile = fn
2248 self.restartAct.setEnabled(True) 2262 self.restartAct.setEnabled(True)
2249 2263
2431 2445
2432 fn = editor.getFileName() 2446 fn = editor.getFileName()
2433 self.clientType = editor.determineFileType() 2447 self.clientType = editor.determineFileType()
2434 self.lastStartAction = 3 2448 self.lastStartAction = 3
2435 2449
2450 if (
2451 FileSystemUtilities.isRemoteFileName(fn)
2452 and not self.ui.isEricServerConnected()
2453 ):
2454 self.__showNotConnectedWarning(title=cap)
2455 return
2456
2436 # save the filename for use by the restart method 2457 # save the filename for use by the restart method
2437 self.lastDebuggedFile = fn 2458 self.lastDebuggedFile = fn
2438 self.restartAct.setEnabled(True) 2459 self.restartAct.setEnabled(True)
2439 2460
2440 # save the most recently used virtual environment 2461 # save the most recently used virtual environment
2513 Public method to handle the debug actions. 2534 Public method to handle the debug actions.
2514 2535
2515 @param debugProject flag indicating debugging the current project 2536 @param debugProject flag indicating debugging the current project
2516 (True) or script (False) 2537 (True) or script (False)
2517 @type bool 2538 @type bool
2518 @param script name of a script (optional) 2539 @param script name of a script (defaults to "")
2519 @type str 2540 @type str (optional)
2520 """ 2541 """
2521 from .StartDialog import StartDialog, StartDialogMode 2542 from .StartDialog import StartDialog, StartDialogMode
2522 2543
2523 self.__resetUI() 2544 self.__resetUI()
2524 doNotStart = False 2545 doNotStart = False
2634 2655
2635 fn = editor.getFileName() 2656 fn = editor.getFileName()
2636 self.clientType = editor.determineFileType() 2657 self.clientType = editor.determineFileType()
2637 self.lastStartAction = 1 2658 self.lastStartAction = 1
2638 2659
2660 if (
2661 FileSystemUtilities.isRemoteFileName(fn)
2662 and not self.ui.isEricServerConnected()
2663 ):
2664 self.__showNotConnectedWarning(title=cap)
2665 return
2666
2639 # save the filename for use by the restart method 2667 # save the filename for use by the restart method
2640 self.lastDebuggedFile = fn 2668 self.lastDebuggedFile = fn
2641 self.restartAct.setEnabled(True) 2669 self.restartAct.setEnabled(True)
2642 2670
2643 # save the most recently used virtual environment 2671 # save the most recently used virtual environment
2826 2854
2827 # Hide all error highlights 2855 # Hide all error highlights
2828 self.viewmanager.unhighlight() 2856 self.viewmanager.unhighlight()
2829 2857
2830 if not doNotStart: 2858 if not doNotStart:
2859 if (
2860 FileSystemUtilities.isRemoteFileName(fn)
2861 and not self.ui.isEricServerConnected()
2862 ):
2863 self.__showNotConnectedWarning(title=self.tr("Restart"))
2864 return
2865
2831 if forProject and self.project.getProjectType() in ["E7Plugin"]: 2866 if forProject and self.project.getProjectType() in ["E7Plugin"]:
2832 argv = '--plugin="{0}" {1}'.format(fn, argv) 2867 argv = '--plugin="{0}" {1}'.format(fn, argv)
2833 fn = "" # script name of the eric IDE is set in debug client 2868 fn = "" # script name of the eric IDE is set in debug client
2834 2869
2835 self.debugViewer.initCallStackViewer(forProject) 2870 self.debugViewer.initCallStackViewer(forProject)
3167 3202
3168 @return string for the project environment 3203 @return string for the project environment
3169 @rtype str 3204 @rtype str
3170 """ 3205 """
3171 return self.debugServer.getProjectEnvironmentString() 3206 return self.debugServer.getProjectEnvironmentString()
3207
3208 def __showNotConnectedWarning(self, title):
3209 """
3210 Private method to show a warning about a not connected eric-ide server.
3211
3212 @param title title for the dialog
3213 @type str
3214 """
3215 EricMessageBox.warning(
3216 None,
3217 title,
3218 self.tr(
3219 "<p>The selected file is located on an eric-ide server but no such"
3220 " server is connected. Aborting...</p>"
3221 ),
3222 )
3223

eric ide

mercurial