Debugger/DebugUI.py

changeset 7
c679fb30c8f3
parent 0
de9c2efb9d02
child 12
1d8dd9706f46
equal deleted inserted replaced
6:52e8c820d0dd 7:c679fb30c8f3
64 64
65 # Generate the variables filter dialog 65 # Generate the variables filter dialog
66 self.dbgFilterDialog = VariablesFilterDialog(self.ui, 'Filter Dialog', True) 66 self.dbgFilterDialog = VariablesFilterDialog(self.ui, 'Filter Dialog', True)
67 67
68 # read the saved debug info values 68 # read the saved debug info values
69 self.argvHistory = \ 69 self.argvHistory = Preferences.toList(
70 Preferences.Prefs.settings \ 70 Preferences.Prefs.settings.value('DebugInfo/ArgumentsHistory'))
71 .value('DebugInfo/ArgumentsHistory').toStringList() 71 self.wdHistory = Preferences.toList(
72 self.wdHistory = \ 72 Preferences.Prefs.settings.value('DebugInfo/WorkingDirectoryHistory'))
73 Preferences.Prefs.settings \ 73 self.envHistory = Preferences.toList(
74 .value('DebugInfo/WorkingDirectoryHistory').toStringList() 74 Preferences.Prefs.settings.value('DebugInfo/EnvironmentHistory'))
75 self.envHistory = \ 75 self.excList = Preferences.toList(
76 Preferences.Prefs.settings \ 76 Preferences.Prefs.settings.value('DebugInfo/Exceptions'))
77 .value('DebugInfo/EnvironmentHistory').toStringList() 77 self.excIgnoreList = Preferences.toList(
78 self.excList = \ 78 Preferences.Prefs.settings.value('DebugInfo/IgnoredExceptions'))
79 Preferences.Prefs.settings \ 79 self.exceptions = Preferences.toBool(
80 .value('DebugInfo/Exceptions').toStringList() 80 Preferences.Prefs.settings.value('DebugInfo/ReportExceptions', True))
81 self.excIgnoreList = \ 81 self.autoClearShell = Preferences.toBool(
82 Preferences.Prefs.settings \ 82 Preferences.Prefs.settings.value('DebugInfo/AutoClearShell', True))
83 .value('DebugInfo/IgnoredExceptions').toStringList() 83 self.tracePython = Preferences.toBool(
84 self.exceptions = \ 84 Preferences.Prefs.settings.value('DebugInfo/TracePython', False))
85 Preferences.Prefs.settings.value('DebugInfo/ReportExceptions', 85 self.autoContinue = Preferences.toBool(
86 QVariant(True)).toBool() 86 Preferences.Prefs.settings.value('DebugInfo/AutoContinue', True))
87 self.autoClearShell = Preferences.Prefs.settings.value('DebugInfo/AutoClearShell', 87 self.forkAutomatically = Preferences.toBool(
88 QVariant(True)).toBool() 88 Preferences.Prefs.settings.value('DebugInfo/ForkAutomatically', False))
89 self.tracePython = Preferences.Prefs.settings.value('DebugInfo/TracePython', 89 self.forkIntoChild = Preferences.toBool(
90 QVariant(False)).toBool() 90 Preferences.Prefs.settings.value('DebugInfo/ForkIntoChild', False))
91 self.autoContinue = Preferences.Prefs.settings.value('DebugInfo/AutoContinue',
92 QVariant(True)).toBool()
93 self.forkAutomatically = Preferences.Prefs.settings.value(
94 'DebugInfo/ForkAutomatically', QVariant(False)).toBool()
95 self.forkIntoChild = Preferences.Prefs.settings.value('DebugInfo/ForkIntoChild',
96 QVariant(False)).toBool()
97 91
98 self.evalHistory = [] 92 self.evalHistory = []
99 self.execHistory = [] 93 self.execHistory = []
100 self.lastDebuggedFile = None 94 self.lastDebuggedFile = None
101 self.lastStartAction = 0 # 0=None, 1=Script, 2=Project 95 self.lastStartAction = 0 # 0=None, 1=Script, 2=Project
869 del self.argvHistory[10:] 863 del self.argvHistory[10:]
870 del self.wdHistory[10:] 864 del self.wdHistory[10:]
871 del self.envHistory[10:] 865 del self.envHistory[10:]
872 866
873 Preferences.Prefs.settings.setValue('DebugInfo/ArgumentsHistory', 867 Preferences.Prefs.settings.setValue('DebugInfo/ArgumentsHistory',
874 QVariant(self.argvHistory)) 868 self.argvHistory)
875 Preferences.Prefs.settings.setValue('DebugInfo/WorkingDirectoryHistory', 869 Preferences.Prefs.settings.setValue('DebugInfo/WorkingDirectoryHistory',
876 QVariant(self.wdHistory)) 870 self.wdHistory)
877 Preferences.Prefs.settings.setValue('DebugInfo/EnvironmentHistory', 871 Preferences.Prefs.settings.setValue('DebugInfo/EnvironmentHistory',
878 QVariant(self.envHistory)) 872 self.envHistory)
879 Preferences.Prefs.settings.setValue('DebugInfo/Exceptions', 873 Preferences.Prefs.settings.setValue('DebugInfo/Exceptions',
880 QVariant(self.excList)) 874 self.excList)
881 Preferences.Prefs.settings.setValue('DebugInfo/IgnoredExceptions', 875 Preferences.Prefs.settings.setValue('DebugInfo/IgnoredExceptions',
882 QVariant(self.excIgnoreList)) 876 self.excIgnoreList)
883 Preferences.Prefs.settings.setValue('DebugInfo/ReportExceptions', 877 Preferences.Prefs.settings.setValue('DebugInfo/ReportExceptions',
884 QVariant(self.exceptions)) 878 self.exceptions)
885 Preferences.Prefs.settings.setValue('DebugInfo/AutoClearShell', 879 Preferences.Prefs.settings.setValue('DebugInfo/AutoClearShell',
886 QVariant(self.autoClearShell)) 880 self.autoClearShell)
887 Preferences.Prefs.settings.setValue('DebugInfo/TracePython', 881 Preferences.Prefs.settings.setValue('DebugInfo/TracePython',
888 QVariant(self.tracePython)) 882 self.tracePython)
889 Preferences.Prefs.settings.setValue('DebugInfo/AutoContinue', 883 Preferences.Prefs.settings.setValue('DebugInfo/AutoContinue',
890 QVariant(self.autoContinue)) 884 self.autoContinue)
891 Preferences.Prefs.settings.setValue('DebugInfo/ForkAutomatically', 885 Preferences.Prefs.settings.setValue('DebugInfo/ForkAutomatically',
892 QVariant(self.forkAutomatically)) 886 self.forkAutomatically)
893 Preferences.Prefs.settings.setValue('DebugInfo/ForkIntoChild', 887 Preferences.Prefs.settings.setValue('DebugInfo/ForkIntoChild',
894 QVariant(self.forkIntoChild)) 888 self.forkIntoChild)
895 889
896 def shutdownServer(self): 890 def shutdownServer(self):
897 """ 891 """
898 Public method to shut down the debug server. 892 Public method to shut down the debug server.
899 893
1303 "%s%s" % ( 1297 "%s%s" % (
1304 Utilities.compactPath( 1298 Utilities.compactPath(
1305 filename, 1299 filename,
1306 self.ui.maxMenuFilePathLen - len(bpSuffix)), 1300 self.ui.maxMenuFilePathLen - len(bpSuffix)),
1307 bpSuffix)) 1301 bpSuffix))
1308 act.setData(QVariant([QVariant(filename), QVariant(line)])) 1302 act.setData([filename, line])
1309 1303
1310 def __breakpointSelected(self, act): 1304 def __breakpointSelected(self, act):
1311 """ 1305 """
1312 Private method to handle the breakpoint selected signal. 1306 Private method to handle the breakpoint selected signal.
1313 1307
1314 @param act reference to the action that triggered (QAction) 1308 @param act reference to the action that triggered (QAction)
1315 """ 1309 """
1316 try: 1310 qvList = act.data()
1317 qvList = act.data().toPyObject() 1311 filename = qvList[0]
1318 filename = qvList[0] 1312 line = qvList[1]
1319 line = qvList[1]
1320 except AttributeError:
1321 qvList = act.data().toList()
1322 filename = qvList[0].toString()
1323 line = qvList[1].toInt()[0]
1324 self.viewmanager.openSourceFile(filename, line) 1313 self.viewmanager.openSourceFile(filename, line)
1325 1314
1326 def __compileChangedProjectFiles(self): 1315 def __compileChangedProjectFiles(self):
1327 """ 1316 """
1328 Private method to signal compilation of changed forms and resources 1317 Private method to signal compilation of changed forms and resources

eric ide

mercurial