12 from PyQt4.QtCore import pyqtSignal, QObject, Qt |
12 from PyQt4.QtCore import pyqtSignal, QObject, Qt |
13 from PyQt4.QtGui import QKeySequence, QMenu, QToolBar, QApplication, QDialog, \ |
13 from PyQt4.QtGui import QKeySequence, QMenu, QToolBar, QApplication, QDialog, \ |
14 QInputDialog |
14 QInputDialog |
15 |
15 |
16 from UI.Info import Program |
16 from UI.Info import Program |
17 from .VariablesFilterDialog import VariablesFilterDialog |
|
18 from .ExceptionsFilterDialog import ExceptionsFilterDialog |
|
19 from .StartDialog import StartDialog |
|
20 from .EditBreakpointDialog import EditBreakpointDialog |
|
21 from .EditWatchpointDialog import EditWatchpointDialog |
|
22 |
17 |
23 from .DebugClientCapabilities import HasDebugger, HasInterpreter, HasProfiler, \ |
18 from .DebugClientCapabilities import HasDebugger, HasInterpreter, HasProfiler, \ |
24 HasCoverage |
19 HasCoverage |
25 import Preferences |
20 import Preferences |
26 import Utilities |
21 import Utilities |
75 |
70 |
76 # Clear some variables |
71 # Clear some variables |
77 self.projectOpen = False |
72 self.projectOpen = False |
78 self.editorOpen = False |
73 self.editorOpen = False |
79 |
74 |
80 # Generate the variables filter dialog |
|
81 self.dbgFilterDialog = VariablesFilterDialog(self.ui, 'Filter Dialog', True) |
|
82 |
|
83 # read the saved debug info values |
75 # read the saved debug info values |
84 self.argvHistory = Preferences.toList( |
76 self.argvHistory = Preferences.toList( |
85 Preferences.Prefs.settings.value('DebugInfo/ArgumentsHistory')) |
77 Preferences.Prefs.settings.value('DebugInfo/ArgumentsHistory')) |
86 self.wdHistory = Preferences.toList( |
78 self.wdHistory = Preferences.toList( |
87 Preferences.Prefs.settings.value('DebugInfo/WorkingDirectoryHistory')) |
79 Preferences.Prefs.settings.value('DebugInfo/WorkingDirectoryHistory')) |
1184 if not bp: |
1176 if not bp: |
1185 return |
1177 return |
1186 |
1178 |
1187 fn, line, cond, temp, enabled, count = bp[:6] |
1179 fn, line, cond, temp, enabled, count = bp[:6] |
1188 |
1180 |
|
1181 from .EditBreakpointDialog import EditBreakpointDialog |
1189 dlg = EditBreakpointDialog((fn, line), (cond, temp, enabled, count), |
1182 dlg = EditBreakpointDialog((fn, line), (cond, temp, enabled, count), |
1190 [], self.ui, modal=True) |
1183 [], self.ui, modal=True) |
1191 if dlg.exec_() == QDialog.Accepted: |
1184 if dlg.exec_() == QDialog.Accepted: |
1192 cond, temp, enabled, count = dlg.getData() |
1185 cond, temp, enabled, count = dlg.getData() |
1193 model.setBreakPointByIndex(index, fn, line, (cond, temp, enabled, count)) |
1186 model.setBreakPointByIndex(index, fn, line, (cond, temp, enabled, count)) |
1215 if not wp: |
1208 if not wp: |
1216 return |
1209 return |
1217 |
1210 |
1218 cond, special, temp, enabled, count = wp[:5] |
1211 cond, special, temp, enabled, count = wp[:5] |
1219 |
1212 |
|
1213 from .EditWatchpointDialog import EditWatchpointDialog |
1220 dlg = EditWatchpointDialog( |
1214 dlg = EditWatchpointDialog( |
1221 (cond, temp, enabled, count, special), self) |
1215 (cond, temp, enabled, count, special), self) |
1222 if dlg.exec_() == QDialog.Accepted: |
1216 if dlg.exec_() == QDialog.Accepted: |
1223 cond, temp, enabled, count, special = dlg.getData() |
1217 cond, temp, enabled, count, special = dlg.getData() |
1224 |
1218 |
1245 |
1239 |
1246 def __configureVariablesFilters(self): |
1240 def __configureVariablesFilters(self): |
1247 """ |
1241 """ |
1248 Private slot for displaying the variables filter configuration dialog. |
1242 Private slot for displaying the variables filter configuration dialog. |
1249 """ |
1243 """ |
1250 result = self.dbgFilterDialog.exec_() |
1244 from .VariablesFilterDialog import VariablesFilterDialog |
1251 if result == QDialog.Accepted: |
1245 dlg = VariablesFilterDialog(self.ui, 'Filter Dialog', True) |
1252 self.localsVarFilter, self.globalsVarFilter = \ |
1246 dlg.setSelection(self.localsVarFilter, self.globalsVarFilter) |
1253 self.dbgFilterDialog.getSelection() |
1247 if dlg.exec_() == QDialog.Accepted: |
1254 else: |
1248 self.localsVarFilter, self.globalsVarFilter = dlg.getSelection() |
1255 self.dbgFilterDialog.setSelection( |
1249 self.debugViewer.setVariablesFilter( |
1256 self.localsVarFilter, self.globalsVarFilter) |
1250 self.globalsVarFilter, self.localsVarFilter) |
1257 self.debugViewer.setVariablesFilter(self.globalsVarFilter, self.localsVarFilter) |
|
1258 |
1251 |
1259 def __configureExceptionsFilter(self): |
1252 def __configureExceptionsFilter(self): |
1260 """ |
1253 """ |
1261 Private slot for displaying the exception filter dialog. |
1254 Private slot for displaying the exception filter dialog. |
1262 """ |
1255 """ |
|
1256 from .ExceptionsFilterDialog import ExceptionsFilterDialog |
1263 dlg = ExceptionsFilterDialog(self.excList, ignore=False) |
1257 dlg = ExceptionsFilterDialog(self.excList, ignore=False) |
1264 if dlg.exec_() == QDialog.Accepted: |
1258 if dlg.exec_() == QDialog.Accepted: |
1265 self.excList = dlg.getExceptionsList()[:] # keep a copy |
1259 self.excList = dlg.getExceptionsList()[:] # keep a copy |
1266 |
1260 |
1267 def __configureIgnoredExceptions(self): |
1261 def __configureIgnoredExceptions(self): |
1268 """ |
1262 """ |
1269 Private slot for displaying the ignored exceptions dialog. |
1263 Private slot for displaying the ignored exceptions dialog. |
1270 """ |
1264 """ |
|
1265 from .ExceptionsFilterDialog import ExceptionsFilterDialog |
1271 dlg = ExceptionsFilterDialog(self.excIgnoreList, ignore=True) |
1266 dlg = ExceptionsFilterDialog(self.excIgnoreList, ignore=True) |
1272 if dlg.exec_() == QDialog.Accepted: |
1267 if dlg.exec_() == QDialog.Accepted: |
1273 self.excIgnoreList = dlg.getExceptionsList()[:] # keep a copy |
1268 self.excIgnoreList = dlg.getExceptionsList()[:] # keep a copy |
1274 |
1269 |
1275 def __toggleBreakpoint(self): |
1270 def __toggleBreakpoint(self): |
1372 Private method to handle the coverage actions. |
1367 Private method to handle the coverage actions. |
1373 |
1368 |
1374 @param runProject flag indicating coverage of the current project (True) |
1369 @param runProject flag indicating coverage of the current project (True) |
1375 or script (false) |
1370 or script (false) |
1376 """ |
1371 """ |
|
1372 from .StartDialog import StartDialog |
|
1373 |
1377 self.__resetUI() |
1374 self.__resetUI() |
1378 doNotStart = False |
1375 doNotStart = False |
1379 |
1376 |
1380 # Get the command line arguments, the working directory and the |
1377 # Get the command line arguments, the working directory and the |
1381 # exception reporting flag. |
1378 # exception reporting flag. |
1478 Private method to handle the profile actions. |
1475 Private method to handle the profile actions. |
1479 |
1476 |
1480 @param runProject flag indicating profiling of the current project (True) |
1477 @param runProject flag indicating profiling of the current project (True) |
1481 or script (False) |
1478 or script (False) |
1482 """ |
1479 """ |
|
1480 from .StartDialog import StartDialog |
|
1481 |
1483 self.__resetUI() |
1482 self.__resetUI() |
1484 doNotStart = False |
1483 doNotStart = False |
1485 |
1484 |
1486 # Get the command line arguments, the working directory and the |
1485 # Get the command line arguments, the working directory and the |
1487 # exception reporting flag. |
1486 # exception reporting flag. |
1585 Private method to handle the run actions. |
1584 Private method to handle the run actions. |
1586 |
1585 |
1587 @param runProject flag indicating running the current project (True) |
1586 @param runProject flag indicating running the current project (True) |
1588 or script (False) |
1587 or script (False) |
1589 """ |
1588 """ |
|
1589 from .StartDialog import StartDialog |
|
1590 |
1590 self.__resetUI() |
1591 self.__resetUI() |
1591 doNotStart = False |
1592 doNotStart = False |
1592 |
1593 |
1593 # Get the command line arguments, the working directory and the |
1594 # Get the command line arguments, the working directory and the |
1594 # exception reporting flag. |
1595 # exception reporting flag. |
1695 Private method to handle the debug actions. |
1696 Private method to handle the debug actions. |
1696 |
1697 |
1697 @param debugProject flag indicating debugging the current project (True) |
1698 @param debugProject flag indicating debugging the current project (True) |
1698 or script (False) |
1699 or script (False) |
1699 """ |
1700 """ |
|
1701 from .StartDialog import StartDialog |
|
1702 |
1700 self.__resetUI() |
1703 self.__resetUI() |
1701 doNotStart = False |
1704 doNotStart = False |
1702 |
1705 |
1703 # Get the command line arguments, the working directory and the |
1706 # Get the command line arguments, the working directory and the |
1704 # exception reporting flag. |
1707 # exception reporting flag. |