eric6/Debugger/DebugUI.py

changeset 8230
8b5c6896655b
parent 8222
5994b80b8760
child 8243
cc717c2ae956
equal deleted inserted replaced
8229:6fa22aa4fc4a 8230:8b5c6896655b
835 835
836 @param fn filename of the opened editor 836 @param fn filename of the opened editor
837 """ 837 """
838 self.editorOpen = True 838 self.editorOpen = True
839 839
840 if fn: 840 editor = self.viewmanager.getOpenEditor(fn) if fn else None
841 editor = self.viewmanager.getOpenEditor(fn)
842 else:
843 editor = None
844 self.__checkActions(editor) 841 self.__checkActions(editor)
845 842
846 def __lastEditorClosed(self): 843 def __lastEditorClosed(self):
847 """ 844 """
848 Private slot to handle the closeProgram signal. 845 Private slot to handle the closeProgram signal.
865 """ 862 """
866 Private slot to check some actions for their enable/disable status. 863 Private slot to check some actions for their enable/disable status.
867 864
868 @param editor editor window 865 @param editor editor window
869 """ 866 """
870 if editor: 867 fn = editor.getFileName() if editor else None
871 fn = editor.getFileName()
872 else:
873 fn = None
874 868
875 cap = 0 869 cap = 0
876 if fn: 870 if fn:
877 for language in self.debugServer.getSupportedLanguages(): 871 for language in self.debugServer.getSupportedLanguages():
878 exts = self.debugServer.getExtensions(language) 872 exts = self.debugServer.getExtensions(language)
1633 1627
1634 model = self.debugServer.getBreakPointModel() 1628 model = self.debugServer.getBreakPointModel()
1635 for row in range(model.rowCount()): 1629 for row in range(model.rowCount()):
1636 index = model.index(row, 0) 1630 index = model.index(row, 0)
1637 filename, line, cond = model.getBreakPointByIndex(index)[:3] 1631 filename, line, cond = model.getBreakPointByIndex(index)[:3]
1638 if not cond: 1632 formattedCond = " : {0}".format(cond[:20]) if cond else ""
1639 formattedCond = ""
1640 else:
1641 formattedCond = " : {0}".format(cond[:20])
1642 bpSuffix = " : {0:d}{1}".format(line, formattedCond) 1633 bpSuffix = " : {0:d}{1}".format(line, formattedCond)
1643 act = self.breakpointsMenu.addAction( 1634 act = self.breakpointsMenu.addAction(
1644 "{0}{1}".format( 1635 "{0}{1}".format(
1645 Utilities.compactPath( 1636 Utilities.compactPath(
1646 filename, 1637 filename,
1985 self.__resetUI() 1976 self.__resetUI()
1986 doNotStart = False 1977 doNotStart = False
1987 1978
1988 # Get the command line arguments, the working directory and the 1979 # Get the command line arguments, the working directory and the
1989 # exception reporting flag. 1980 # exception reporting flag.
1990 if runProject: 1981 cap = (self.tr("Run Project") if runProject
1991 cap = self.tr("Run Project") 1982 else self.tr("Run Script"))
1992 else:
1993 cap = self.tr("Run Script")
1994 dlg = StartDialog( 1983 dlg = StartDialog(
1995 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 1984 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory,
1996 self.envHistory, self.exceptions, self.ui, 1, 1985 self.envHistory, self.exceptions, self.ui, 1,
1997 autoClearShell=self.autoClearShell, 1986 autoClearShell=self.autoClearShell,
1998 configOverride=self.overrideGlobalConfig) 1987 configOverride=self.overrideGlobalConfig)
2125 self.__resetUI() 2114 self.__resetUI()
2126 doNotStart = False 2115 doNotStart = False
2127 2116
2128 # Get the command line arguments, the working directory and the 2117 # Get the command line arguments, the working directory and the
2129 # exception reporting flag. 2118 # exception reporting flag.
2130 if debugProject: 2119 cap = (self.tr("Debug Project") if debugProject
2131 cap = self.tr("Debug Project") 2120 else self.tr("Debug Script"))
2132 else:
2133 cap = self.tr("Debug Script")
2134 dlg = StartDialog( 2121 dlg = StartDialog(
2135 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, 2122 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory,
2136 self.envHistory, self.exceptions, self.ui, 0, 2123 self.envHistory, self.exceptions, self.ui, 0,
2137 tracePython=self.tracePython, autoClearShell=self.autoClearShell, 2124 tracePython=self.tracePython, autoClearShell=self.autoClearShell,
2138 autoContinue=self.autoContinue, 2125 autoContinue=self.autoContinue,

eric ide

mercurial