Debugger/DebugUI.py

changeset 3345
071afe8be2a1
parent 3190
a9a94491c4fd
child 3446
5a670e55adbb
equal deleted inserted replaced
3343:f7a6d271bb40 3345:071afe8be2a1
178 """<b>Run Script</b>""" 178 """<b>Run Script</b>"""
179 """<p>Set the command line arguments and run the script outside""" 179 """<p>Set the command line arguments and run the script outside"""
180 """ the debugger. If the file has unsaved changes it may be""" 180 """ the debugger. If the file has unsaved changes it may be"""
181 """ saved first.</p>""" 181 """ saved first.</p>"""
182 )) 182 ))
183 self.runAct.triggered[()].connect(self.__runScript) 183 self.runAct.triggered.connect(self.__runScript)
184 self.actions.append(self.runAct) 184 self.actions.append(self.runAct)
185 185
186 self.runProjectAct = E5Action( 186 self.runProjectAct = E5Action(
187 self.tr('Run Project'), 187 self.tr('Run Project'),
188 UI.PixmapCache.getIcon("runProject.png"), 188 UI.PixmapCache.getIcon("runProject.png"),
194 """<p>Set the command line arguments and run the current project""" 194 """<p>Set the command line arguments and run the current project"""
195 """ outside the debugger.""" 195 """ outside the debugger."""
196 """ If files of the current project have unsaved changes they""" 196 """ If files of the current project have unsaved changes they"""
197 """ may be saved first.</p>""" 197 """ may be saved first.</p>"""
198 )) 198 ))
199 self.runProjectAct.triggered[()].connect(self.__runProject) 199 self.runProjectAct.triggered.connect(self.__runProject)
200 self.actions.append(self.runProjectAct) 200 self.actions.append(self.runProjectAct)
201 201
202 self.coverageAct = E5Action( 202 self.coverageAct = E5Action(
203 self.tr('Coverage run of Script'), 203 self.tr('Coverage run of Script'),
204 UI.PixmapCache.getIcon("coverageScript.png"), 204 UI.PixmapCache.getIcon("coverageScript.png"),
210 """<b>Coverage run of Script</b>""" 210 """<b>Coverage run of Script</b>"""
211 """<p>Set the command line arguments and run the script under""" 211 """<p>Set the command line arguments and run the script under"""
212 """ the control of a coverage analysis tool. If the file has""" 212 """ the control of a coverage analysis tool. If the file has"""
213 """ unsaved changes it may be saved first.</p>""" 213 """ unsaved changes it may be saved first.</p>"""
214 )) 214 ))
215 self.coverageAct.triggered[()].connect(self.__coverageScript) 215 self.coverageAct.triggered.connect(self.__coverageScript)
216 self.actions.append(self.coverageAct) 216 self.actions.append(self.coverageAct)
217 217
218 self.coverageProjectAct = E5Action( 218 self.coverageProjectAct = E5Action(
219 self.tr('Coverage run of Project'), 219 self.tr('Coverage run of Project'),
220 UI.PixmapCache.getIcon("coverageProject.png"), 220 UI.PixmapCache.getIcon("coverageProject.png"),
227 """<p>Set the command line arguments and run the current project""" 227 """<p>Set the command line arguments and run the current project"""
228 """ under the control of a coverage analysis tool.""" 228 """ under the control of a coverage analysis tool."""
229 """ If files of the current project have unsaved changes""" 229 """ If files of the current project have unsaved changes"""
230 """ they may be saved first.</p>""" 230 """ they may be saved first.</p>"""
231 )) 231 ))
232 self.coverageProjectAct.triggered[()].connect(self.__coverageProject) 232 self.coverageProjectAct.triggered.connect(self.__coverageProject)
233 self.actions.append(self.coverageProjectAct) 233 self.actions.append(self.coverageProjectAct)
234 234
235 self.profileAct = E5Action( 235 self.profileAct = E5Action(
236 self.tr('Profile Script'), 236 self.tr('Profile Script'),
237 UI.PixmapCache.getIcon("profileScript.png"), 237 UI.PixmapCache.getIcon("profileScript.png"),
240 self.profileAct.setWhatsThis(self.tr( 240 self.profileAct.setWhatsThis(self.tr(
241 """<b>Profile Script</b>""" 241 """<b>Profile Script</b>"""
242 """<p>Set the command line arguments and profile the script.""" 242 """<p>Set the command line arguments and profile the script."""
243 """ If the file has unsaved changes it may be saved first.</p>""" 243 """ If the file has unsaved changes it may be saved first.</p>"""
244 )) 244 ))
245 self.profileAct.triggered[()].connect(self.__profileScript) 245 self.profileAct.triggered.connect(self.__profileScript)
246 self.actions.append(self.profileAct) 246 self.actions.append(self.profileAct)
247 247
248 self.profileProjectAct = E5Action( 248 self.profileProjectAct = E5Action(
249 self.tr('Profile Project'), 249 self.tr('Profile Project'),
250 UI.PixmapCache.getIcon("profileProject.png"), 250 UI.PixmapCache.getIcon("profileProject.png"),
256 """<b>Profile Project</b>""" 256 """<b>Profile Project</b>"""
257 """<p>Set the command line arguments and profile the current""" 257 """<p>Set the command line arguments and profile the current"""
258 """ project. If files of the current project have unsaved""" 258 """ project. If files of the current project have unsaved"""
259 """ changes they may be saved first.</p>""" 259 """ changes they may be saved first.</p>"""
260 )) 260 ))
261 self.profileProjectAct.triggered[()].connect(self.__profileProject) 261 self.profileProjectAct.triggered.connect(self.__profileProject)
262 self.actions.append(self.profileProjectAct) 262 self.actions.append(self.profileProjectAct)
263 263
264 self.debugAct = E5Action( 264 self.debugAct = E5Action(
265 self.tr('Debug Script'), 265 self.tr('Debug Script'),
266 UI.PixmapCache.getIcon("debugScript.png"), 266 UI.PixmapCache.getIcon("debugScript.png"),
272 """<p>Set the command line arguments and set the current line""" 272 """<p>Set the command line arguments and set the current line"""
273 """ to be the first executable Python statement of the current""" 273 """ to be the first executable Python statement of the current"""
274 """ editor window. If the file has unsaved changes it may be""" 274 """ editor window. If the file has unsaved changes it may be"""
275 """ saved first.</p>""" 275 """ saved first.</p>"""
276 )) 276 ))
277 self.debugAct.triggered[()].connect(self.__debugScript) 277 self.debugAct.triggered.connect(self.__debugScript)
278 self.actions.append(self.debugAct) 278 self.actions.append(self.debugAct)
279 279
280 self.debugProjectAct = E5Action( 280 self.debugProjectAct = E5Action(
281 self.tr('Debug Project'), 281 self.tr('Debug Project'),
282 UI.PixmapCache.getIcon("debugProject.png"), 282 UI.PixmapCache.getIcon("debugProject.png"),
289 """<p>Set the command line arguments and set the current line""" 289 """<p>Set the command line arguments and set the current line"""
290 """ to be the first executable Python statement of the main""" 290 """ to be the first executable Python statement of the main"""
291 """ script of the current project. If files of the current""" 291 """ script of the current project. If files of the current"""
292 """ project have unsaved changes they may be saved first.</p>""" 292 """ project have unsaved changes they may be saved first.</p>"""
293 )) 293 ))
294 self.debugProjectAct.triggered[()].connect(self.__debugProject) 294 self.debugProjectAct.triggered.connect(self.__debugProject)
295 self.actions.append(self.debugProjectAct) 295 self.actions.append(self.debugProjectAct)
296 296
297 self.restartAct = E5Action( 297 self.restartAct = E5Action(
298 self.tr('Restart'), 298 self.tr('Restart'),
299 UI.PixmapCache.getIcon("restart.png"), 299 UI.PixmapCache.getIcon("restart.png"),
305 """<p>Set the command line arguments and set the current line""" 305 """<p>Set the command line arguments and set the current line"""
306 """ to be the first executable Python statement of the script""" 306 """ to be the first executable Python statement of the script"""
307 """ that was debugged last. If there are unsaved changes, they""" 307 """ that was debugged last. If there are unsaved changes, they"""
308 """ may be saved first.</p>""" 308 """ may be saved first.</p>"""
309 )) 309 ))
310 self.restartAct.triggered[()].connect(self.__doRestart) 310 self.restartAct.triggered.connect(self.__doRestart)
311 self.actions.append(self.restartAct) 311 self.actions.append(self.restartAct)
312 312
313 self.stopAct = E5Action( 313 self.stopAct = E5Action(
314 self.tr('Stop'), 314 self.tr('Stop'),
315 UI.PixmapCache.getIcon("stopScript.png"), 315 UI.PixmapCache.getIcon("stopScript.png"),
318 self.stopAct.setStatusTip(self.tr("""Stop the running script.""")) 318 self.stopAct.setStatusTip(self.tr("""Stop the running script."""))
319 self.stopAct.setWhatsThis(self.tr( 319 self.stopAct.setWhatsThis(self.tr(
320 """<b>Stop</b>""" 320 """<b>Stop</b>"""
321 """<p>This stops the script running in the debugger backend.</p>""" 321 """<p>This stops the script running in the debugger backend.</p>"""
322 )) 322 ))
323 self.stopAct.triggered[()].connect(self.__stopScript) 323 self.stopAct.triggered.connect(self.__stopScript)
324 self.actions.append(self.stopAct) 324 self.actions.append(self.stopAct)
325 325
326 self.debugActGrp = createActionGroup(self) 326 self.debugActGrp = createActionGroup(self)
327 327
328 act = E5Action( 328 act = E5Action(
336 """<b>Continue</b>""" 336 """<b>Continue</b>"""
337 """<p>Continue running the program from the current line. The""" 337 """<p>Continue running the program from the current line. The"""
338 """ program will stop when it terminates or when a breakpoint""" 338 """ program will stop when it terminates or when a breakpoint"""
339 """ is reached.</p>""" 339 """ is reached.</p>"""
340 )) 340 ))
341 act.triggered[()].connect(self.__continue) 341 act.triggered.connect(self.__continue)
342 self.actions.append(act) 342 self.actions.append(act)
343 343
344 act = E5Action( 344 act = E5Action(
345 self.tr('Continue to Cursor'), 345 self.tr('Continue to Cursor'),
346 UI.PixmapCache.getIcon("continueToCursor.png"), 346 UI.PixmapCache.getIcon("continueToCursor.png"),
352 act.setWhatsThis(self.tr( 352 act.setWhatsThis(self.tr(
353 """<b>Continue To Cursor</b>""" 353 """<b>Continue To Cursor</b>"""
354 """<p>Continue running the program from the current line to the""" 354 """<p>Continue running the program from the current line to the"""
355 """ current cursor position.</p>""" 355 """ current cursor position.</p>"""
356 )) 356 ))
357 act.triggered[()].connect(self.__runToCursor) 357 act.triggered.connect(self.__runToCursor)
358 self.actions.append(act) 358 self.actions.append(act)
359 359
360 act = E5Action( 360 act = E5Action(
361 self.tr('Single Step'), 361 self.tr('Single Step'),
362 UI.PixmapCache.getIcon("step.png"), 362 UI.PixmapCache.getIcon("step.png"),
368 """<p>Execute a single Python statement. If the statement""" 368 """<p>Execute a single Python statement. If the statement"""
369 """ is an <tt>import</tt> statement, a class constructor, or a""" 369 """ is an <tt>import</tt> statement, a class constructor, or a"""
370 """ method or function call then control is returned to the""" 370 """ method or function call then control is returned to the"""
371 """ debugger at the next statement.</p>""" 371 """ debugger at the next statement.</p>"""
372 )) 372 ))
373 act.triggered[()].connect(self.__step) 373 act.triggered.connect(self.__step)
374 self.actions.append(act) 374 self.actions.append(act)
375 375
376 act = E5Action( 376 act = E5Action(
377 self.tr('Step Over'), 377 self.tr('Step Over'),
378 UI.PixmapCache.getIcon("stepOver.png"), 378 UI.PixmapCache.getIcon("stepOver.png"),
387 """ frame. If the statement is an <tt>import</tt> statement,""" 387 """ frame. If the statement is an <tt>import</tt> statement,"""
388 """ a class constructor, or a method or function call then""" 388 """ a class constructor, or a method or function call then"""
389 """ control is returned to the debugger after the statement""" 389 """ control is returned to the debugger after the statement"""
390 """ has completed.</p>""" 390 """ has completed.</p>"""
391 )) 391 ))
392 act.triggered[()].connect(self.__stepOver) 392 act.triggered.connect(self.__stepOver)
393 self.actions.append(act) 393 self.actions.append(act)
394 394
395 act = E5Action( 395 act = E5Action(
396 self.tr('Step Out'), 396 self.tr('Step Out'),
397 UI.PixmapCache.getIcon("stepOut.png"), 397 UI.PixmapCache.getIcon("stepOut.png"),
406 """ frame. If the statements are inside an <tt>import</tt>""" 406 """ frame. If the statements are inside an <tt>import</tt>"""
407 """ statement, a class constructor, or a method or function""" 407 """ statement, a class constructor, or a method or function"""
408 """ call then control is returned to the debugger after the""" 408 """ call then control is returned to the debugger after the"""
409 """ current frame has been left.</p>""" 409 """ current frame has been left.</p>"""
410 )) 410 ))
411 act.triggered[()].connect(self.__stepOut) 411 act.triggered.connect(self.__stepOut)
412 self.actions.append(act) 412 self.actions.append(act)
413 413
414 act = E5Action( 414 act = E5Action(
415 self.tr('Stop'), 415 self.tr('Stop'),
416 UI.PixmapCache.getIcon("stepQuit.png"), 416 UI.PixmapCache.getIcon("stepQuit.png"),
419 act.setStatusTip(self.tr('Stop debugging')) 419 act.setStatusTip(self.tr('Stop debugging'))
420 act.setWhatsThis(self.tr( 420 act.setWhatsThis(self.tr(
421 """<b>Stop</b>""" 421 """<b>Stop</b>"""
422 """<p>Stop the running debugging session.</p>""" 422 """<p>Stop the running debugging session.</p>"""
423 )) 423 ))
424 act.triggered[()].connect(self.__stepQuit) 424 act.triggered.connect(self.__stepQuit)
425 self.actions.append(act) 425 self.actions.append(act)
426 426
427 self.debugActGrp2 = createActionGroup(self) 427 self.debugActGrp2 = createActionGroup(self)
428 428
429 act = E5Action( 429 act = E5Action(
435 """<b>Evaluate</b>""" 435 """<b>Evaluate</b>"""
436 """<p>Evaluate an expression in the current context of the""" 436 """<p>Evaluate an expression in the current context of the"""
437 """ debugged program. The result is displayed in the""" 437 """ debugged program. The result is displayed in the"""
438 """ shell window.</p>""" 438 """ shell window.</p>"""
439 )) 439 ))
440 act.triggered[()].connect(self.__eval) 440 act.triggered.connect(self.__eval)
441 self.actions.append(act) 441 self.actions.append(act)
442 442
443 act = E5Action( 443 act = E5Action(
444 self.tr('Execute'), 444 self.tr('Execute'),
445 self.tr('E&xecute...'), 445 self.tr('E&xecute...'),
449 act.setWhatsThis(self.tr( 449 act.setWhatsThis(self.tr(
450 """<b>Execute</b>""" 450 """<b>Execute</b>"""
451 """<p>Execute a one line statement in the current context""" 451 """<p>Execute a one line statement in the current context"""
452 """ of the debugged program.</p>""" 452 """ of the debugged program.</p>"""
453 )) 453 ))
454 act.triggered[()].connect(self.__exec) 454 act.triggered.connect(self.__exec)
455 self.actions.append(act) 455 self.actions.append(act)
456 456
457 self.dbgFilterAct = E5Action( 457 self.dbgFilterAct = E5Action(
458 self.tr('Variables Type Filter'), 458 self.tr('Variables Type Filter'),
459 self.tr('Varia&bles Type Filter...'), 0, 0, self, 459 self.tr('Varia&bles Type Filter...'), 0, 0, self,
464 """<b>Variables Type Filter</b>""" 464 """<b>Variables Type Filter</b>"""
465 """<p>Configure the variables type filter. Only variable types""" 465 """<p>Configure the variables type filter. Only variable types"""
466 """ that are not selected are displayed in the global or local""" 466 """ that are not selected are displayed in the global or local"""
467 """ variables window during a debugging session.</p>""" 467 """ variables window during a debugging session.</p>"""
468 )) 468 ))
469 self.dbgFilterAct.triggered[()].connect( 469 self.dbgFilterAct.triggered.connect(
470 self.__configureVariablesFilters) 470 self.__configureVariablesFilters)
471 self.actions.append(self.dbgFilterAct) 471 self.actions.append(self.dbgFilterAct)
472 472
473 self.excFilterAct = E5Action( 473 self.excFilterAct = E5Action(
474 self.tr('Exceptions Filter'), 474 self.tr('Exceptions Filter'),
481 """<p>Configure the exceptions filter. Only exception types""" 481 """<p>Configure the exceptions filter. Only exception types"""
482 """ that are listed are highlighted during a debugging""" 482 """ that are listed are highlighted during a debugging"""
483 """ session.</p><p>Please note, that all unhandled exceptions""" 483 """ session.</p><p>Please note, that all unhandled exceptions"""
484 """ are highlighted indepent from the filter list.</p>""" 484 """ are highlighted indepent from the filter list.</p>"""
485 )) 485 ))
486 self.excFilterAct.triggered[()].connect( 486 self.excFilterAct.triggered.connect(
487 self.__configureExceptionsFilter) 487 self.__configureExceptionsFilter)
488 self.actions.append(self.excFilterAct) 488 self.actions.append(self.excFilterAct)
489 489
490 self.excIgnoreFilterAct = E5Action( 490 self.excIgnoreFilterAct = E5Action(
491 self.tr('Ignored Exceptions'), 491 self.tr('Ignored Exceptions'),
498 """<p>Configure the ignored exceptions. Only exception types""" 498 """<p>Configure the ignored exceptions. Only exception types"""
499 """ that are not listed are highlighted during a debugging""" 499 """ that are not listed are highlighted during a debugging"""
500 """ session.</p><p>Please note, that unhandled exceptions""" 500 """ session.</p><p>Please note, that unhandled exceptions"""
501 """ cannot be ignored.</p>""" 501 """ cannot be ignored.</p>"""
502 )) 502 ))
503 self.excIgnoreFilterAct.triggered[()].connect( 503 self.excIgnoreFilterAct.triggered.connect(
504 self.__configureIgnoredExceptions) 504 self.__configureIgnoredExceptions)
505 self.actions.append(self.excIgnoreFilterAct) 505 self.actions.append(self.excIgnoreFilterAct)
506 506
507 self.dbgSetBpActGrp = createActionGroup(self) 507 self.dbgSetBpActGrp = createActionGroup(self)
508 508
516 self.dbgToggleBpAct.setWhatsThis(self.tr( 516 self.dbgToggleBpAct.setWhatsThis(self.tr(
517 """<b>Toggle Breakpoint</b>""" 517 """<b>Toggle Breakpoint</b>"""
518 """<p>Toggles a breakpoint at the current line of the""" 518 """<p>Toggles a breakpoint at the current line of the"""
519 """ current editor.</p>""" 519 """ current editor.</p>"""
520 )) 520 ))
521 self.dbgToggleBpAct.triggered[()].connect(self.__toggleBreakpoint) 521 self.dbgToggleBpAct.triggered.connect(self.__toggleBreakpoint)
522 self.actions.append(self.dbgToggleBpAct) 522 self.actions.append(self.dbgToggleBpAct)
523 523
524 self.dbgEditBpAct = E5Action( 524 self.dbgEditBpAct = E5Action(
525 self.tr('Edit Breakpoint'), 525 self.tr('Edit Breakpoint'),
526 UI.PixmapCache.getIcon("cBreakpointToggle.png"), 526 UI.PixmapCache.getIcon("cBreakpointToggle.png"),
531 self.dbgEditBpAct.setWhatsThis(self.tr( 531 self.dbgEditBpAct.setWhatsThis(self.tr(
532 """<b>Edit Breakpoint</b>""" 532 """<b>Edit Breakpoint</b>"""
533 """<p>Opens a dialog to edit the breakpoints properties.""" 533 """<p>Opens a dialog to edit the breakpoints properties."""
534 """ It works at the current line of the current editor.</p>""" 534 """ It works at the current line of the current editor.</p>"""
535 )) 535 ))
536 self.dbgEditBpAct.triggered[()].connect(self.__editBreakpoint) 536 self.dbgEditBpAct.triggered.connect(self.__editBreakpoint)
537 self.actions.append(self.dbgEditBpAct) 537 self.actions.append(self.dbgEditBpAct)
538 538
539 self.dbgNextBpAct = E5Action( 539 self.dbgNextBpAct = E5Action(
540 self.tr('Next Breakpoint'), 540 self.tr('Next Breakpoint'),
541 UI.PixmapCache.getIcon("breakpointNext.png"), 541 UI.PixmapCache.getIcon("breakpointNext.png"),
546 self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint')) 546 self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint'))
547 self.dbgNextBpAct.setWhatsThis(self.tr( 547 self.dbgNextBpAct.setWhatsThis(self.tr(
548 """<b>Next Breakpoint</b>""" 548 """<b>Next Breakpoint</b>"""
549 """<p>Go to next breakpoint of the current editor.</p>""" 549 """<p>Go to next breakpoint of the current editor.</p>"""
550 )) 550 ))
551 self.dbgNextBpAct.triggered[()].connect(self.__nextBreakpoint) 551 self.dbgNextBpAct.triggered.connect(self.__nextBreakpoint)
552 self.actions.append(self.dbgNextBpAct) 552 self.actions.append(self.dbgNextBpAct)
553 553
554 self.dbgPrevBpAct = E5Action( 554 self.dbgPrevBpAct = E5Action(
555 self.tr('Previous Breakpoint'), 555 self.tr('Previous Breakpoint'),
556 UI.PixmapCache.getIcon("breakpointPrevious.png"), 556 UI.PixmapCache.getIcon("breakpointPrevious.png"),
561 self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint')) 561 self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint'))
562 self.dbgPrevBpAct.setWhatsThis(self.tr( 562 self.dbgPrevBpAct.setWhatsThis(self.tr(
563 """<b>Previous Breakpoint</b>""" 563 """<b>Previous Breakpoint</b>"""
564 """<p>Go to previous breakpoint of the current editor.</p>""" 564 """<p>Go to previous breakpoint of the current editor.</p>"""
565 )) 565 ))
566 self.dbgPrevBpAct.triggered[()].connect(self.__previousBreakpoint) 566 self.dbgPrevBpAct.triggered.connect(self.__previousBreakpoint)
567 self.actions.append(self.dbgPrevBpAct) 567 self.actions.append(self.dbgPrevBpAct)
568 568
569 act = E5Action( 569 act = E5Action(
570 self.tr('Clear Breakpoints'), 570 self.tr('Clear Breakpoints'),
571 self.tr('Clear Breakpoints'), 571 self.tr('Clear Breakpoints'),
575 act.setStatusTip(self.tr('Clear Breakpoints')) 575 act.setStatusTip(self.tr('Clear Breakpoints'))
576 act.setWhatsThis(self.tr( 576 act.setWhatsThis(self.tr(
577 """<b>Clear Breakpoints</b>""" 577 """<b>Clear Breakpoints</b>"""
578 """<p>Clear breakpoints of all editors.</p>""" 578 """<p>Clear breakpoints of all editors.</p>"""
579 )) 579 ))
580 act.triggered[()].connect(self.__clearBreakpoints) 580 act.triggered.connect(self.__clearBreakpoints)
581 self.actions.append(act) 581 self.actions.append(act)
582 582
583 self.debugActGrp.setEnabled(False) 583 self.debugActGrp.setEnabled(False)
584 self.debugActGrp2.setEnabled(False) 584 self.debugActGrp2.setEnabled(False)
585 self.dbgSetBpActGrp.setEnabled(False) 585 self.dbgSetBpActGrp.setEnabled(False)

eric ide

mercurial