eric6/Debugger/DebugUI.py

branch
multi_processing
changeset 7564
787684e6f2f3
parent 7421
4a9900aef04e
parent 7533
88261c96484b
child 7646
39e3db2b4936
equal deleted inserted replaced
7563:b0d6b63f2843 7564:787684e6f2f3
178 """ 178 """
179 self.actions = [] 179 self.actions = []
180 180
181 self.runAct = E5Action( 181 self.runAct = E5Action(
182 self.tr('Run Script'), 182 self.tr('Run Script'),
183 UI.PixmapCache.getIcon("runScript.png"), 183 UI.PixmapCache.getIcon("runScript"),
184 self.tr('&Run Script...'), 184 self.tr('&Run Script...'),
185 Qt.Key_F2, 0, self, 'dbg_run_script') 185 Qt.Key_F2, 0, self, 'dbg_run_script')
186 self.runAct.setStatusTip(self.tr('Run the current Script')) 186 self.runAct.setStatusTip(self.tr('Run the current Script'))
187 self.runAct.setWhatsThis(self.tr( 187 self.runAct.setWhatsThis(self.tr(
188 """<b>Run Script</b>""" 188 """<b>Run Script</b>"""
193 self.runAct.triggered.connect(self.__runScript) 193 self.runAct.triggered.connect(self.__runScript)
194 self.actions.append(self.runAct) 194 self.actions.append(self.runAct)
195 195
196 self.runProjectAct = E5Action( 196 self.runProjectAct = E5Action(
197 self.tr('Run Project'), 197 self.tr('Run Project'),
198 UI.PixmapCache.getIcon("runProject.png"), 198 UI.PixmapCache.getIcon("runProject"),
199 self.tr('Run &Project...'), Qt.SHIFT + Qt.Key_F2, 0, self, 199 self.tr('Run &Project...'), Qt.SHIFT + Qt.Key_F2, 0, self,
200 'dbg_run_project') 200 'dbg_run_project')
201 self.runProjectAct.setStatusTip(self.tr('Run the current Project')) 201 self.runProjectAct.setStatusTip(self.tr('Run the current Project'))
202 self.runProjectAct.setWhatsThis(self.tr( 202 self.runProjectAct.setWhatsThis(self.tr(
203 """<b>Run Project</b>""" 203 """<b>Run Project</b>"""
209 self.runProjectAct.triggered.connect(self.__runProject) 209 self.runProjectAct.triggered.connect(self.__runProject)
210 self.actions.append(self.runProjectAct) 210 self.actions.append(self.runProjectAct)
211 211
212 self.coverageAct = E5Action( 212 self.coverageAct = E5Action(
213 self.tr('Coverage run of Script'), 213 self.tr('Coverage run of Script'),
214 UI.PixmapCache.getIcon("coverageScript.png"), 214 UI.PixmapCache.getIcon("coverageScript"),
215 self.tr('Coverage run of Script...'), 0, 0, self, 215 self.tr('Coverage run of Script...'), 0, 0, self,
216 'dbg_coverage_script') 216 'dbg_coverage_script')
217 self.coverageAct.setStatusTip( 217 self.coverageAct.setStatusTip(
218 self.tr('Perform a coverage run of the current Script')) 218 self.tr('Perform a coverage run of the current Script'))
219 self.coverageAct.setWhatsThis(self.tr( 219 self.coverageAct.setWhatsThis(self.tr(
225 self.coverageAct.triggered.connect(self.__coverageScript) 225 self.coverageAct.triggered.connect(self.__coverageScript)
226 self.actions.append(self.coverageAct) 226 self.actions.append(self.coverageAct)
227 227
228 self.coverageProjectAct = E5Action( 228 self.coverageProjectAct = E5Action(
229 self.tr('Coverage run of Project'), 229 self.tr('Coverage run of Project'),
230 UI.PixmapCache.getIcon("coverageProject.png"), 230 UI.PixmapCache.getIcon("coverageProject"),
231 self.tr('Coverage run of Project...'), 0, 0, self, 231 self.tr('Coverage run of Project...'), 0, 0, self,
232 'dbg_coverage_project') 232 'dbg_coverage_project')
233 self.coverageProjectAct.setStatusTip( 233 self.coverageProjectAct.setStatusTip(
234 self.tr('Perform a coverage run of the current Project')) 234 self.tr('Perform a coverage run of the current Project'))
235 self.coverageProjectAct.setWhatsThis(self.tr( 235 self.coverageProjectAct.setWhatsThis(self.tr(
242 self.coverageProjectAct.triggered.connect(self.__coverageProject) 242 self.coverageProjectAct.triggered.connect(self.__coverageProject)
243 self.actions.append(self.coverageProjectAct) 243 self.actions.append(self.coverageProjectAct)
244 244
245 self.profileAct = E5Action( 245 self.profileAct = E5Action(
246 self.tr('Profile Script'), 246 self.tr('Profile Script'),
247 UI.PixmapCache.getIcon("profileScript.png"), 247 UI.PixmapCache.getIcon("profileScript"),
248 self.tr('Profile Script...'), 0, 0, self, 'dbg_profile_script') 248 self.tr('Profile Script...'), 0, 0, self, 'dbg_profile_script')
249 self.profileAct.setStatusTip(self.tr('Profile the current Script')) 249 self.profileAct.setStatusTip(self.tr('Profile the current Script'))
250 self.profileAct.setWhatsThis(self.tr( 250 self.profileAct.setWhatsThis(self.tr(
251 """<b>Profile Script</b>""" 251 """<b>Profile Script</b>"""
252 """<p>Set the command line arguments and profile the script.""" 252 """<p>Set the command line arguments and profile the script."""
255 self.profileAct.triggered.connect(self.__profileScript) 255 self.profileAct.triggered.connect(self.__profileScript)
256 self.actions.append(self.profileAct) 256 self.actions.append(self.profileAct)
257 257
258 self.profileProjectAct = E5Action( 258 self.profileProjectAct = E5Action(
259 self.tr('Profile Project'), 259 self.tr('Profile Project'),
260 UI.PixmapCache.getIcon("profileProject.png"), 260 UI.PixmapCache.getIcon("profileProject"),
261 self.tr('Profile Project...'), 0, 0, self, 261 self.tr('Profile Project...'), 0, 0, self,
262 'dbg_profile_project') 262 'dbg_profile_project')
263 self.profileProjectAct.setStatusTip( 263 self.profileProjectAct.setStatusTip(
264 self.tr('Profile the current Project')) 264 self.tr('Profile the current Project'))
265 self.profileProjectAct.setWhatsThis(self.tr( 265 self.profileProjectAct.setWhatsThis(self.tr(
271 self.profileProjectAct.triggered.connect(self.__profileProject) 271 self.profileProjectAct.triggered.connect(self.__profileProject)
272 self.actions.append(self.profileProjectAct) 272 self.actions.append(self.profileProjectAct)
273 273
274 self.debugAct = E5Action( 274 self.debugAct = E5Action(
275 self.tr('Debug Script'), 275 self.tr('Debug Script'),
276 UI.PixmapCache.getIcon("debugScript.png"), 276 UI.PixmapCache.getIcon("debugScript"),
277 self.tr('&Debug Script...'), Qt.Key_F5, 0, self, 277 self.tr('&Debug Script...'), Qt.Key_F5, 0, self,
278 'dbg_debug_script') 278 'dbg_debug_script')
279 self.debugAct.setStatusTip(self.tr('Debug the current Script')) 279 self.debugAct.setStatusTip(self.tr('Debug the current Script'))
280 self.debugAct.setWhatsThis(self.tr( 280 self.debugAct.setWhatsThis(self.tr(
281 """<b>Debug Script</b>""" 281 """<b>Debug Script</b>"""
287 self.debugAct.triggered.connect(self.__debugScript) 287 self.debugAct.triggered.connect(self.__debugScript)
288 self.actions.append(self.debugAct) 288 self.actions.append(self.debugAct)
289 289
290 self.debugProjectAct = E5Action( 290 self.debugProjectAct = E5Action(
291 self.tr('Debug Project'), 291 self.tr('Debug Project'),
292 UI.PixmapCache.getIcon("debugProject.png"), 292 UI.PixmapCache.getIcon("debugProject"),
293 self.tr('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self, 293 self.tr('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self,
294 'dbg_debug_project') 294 'dbg_debug_project')
295 self.debugProjectAct.setStatusTip(self.tr( 295 self.debugProjectAct.setStatusTip(self.tr(
296 'Debug the current Project')) 296 'Debug the current Project'))
297 self.debugProjectAct.setWhatsThis(self.tr( 297 self.debugProjectAct.setWhatsThis(self.tr(
304 self.debugProjectAct.triggered.connect(self.__debugProject) 304 self.debugProjectAct.triggered.connect(self.__debugProject)
305 self.actions.append(self.debugProjectAct) 305 self.actions.append(self.debugProjectAct)
306 306
307 self.restartAct = E5Action( 307 self.restartAct = E5Action(
308 self.tr('Restart'), 308 self.tr('Restart'),
309 UI.PixmapCache.getIcon("debugRestart.png"), 309 UI.PixmapCache.getIcon("debugRestart"),
310 self.tr('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script') 310 self.tr('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script')
311 self.restartAct.setStatusTip(self.tr( 311 self.restartAct.setStatusTip(self.tr(
312 'Restart the last debugged script')) 312 'Restart the last debugged script'))
313 self.restartAct.setWhatsThis(self.tr( 313 self.restartAct.setWhatsThis(self.tr(
314 """<b>Restart</b>""" 314 """<b>Restart</b>"""
320 self.restartAct.triggered.connect(self.__doRestart) 320 self.restartAct.triggered.connect(self.__doRestart)
321 self.actions.append(self.restartAct) 321 self.actions.append(self.restartAct)
322 322
323 self.stopAct = E5Action( 323 self.stopAct = E5Action(
324 self.tr('Stop'), 324 self.tr('Stop'),
325 UI.PixmapCache.getIcon("stopScript.png"), 325 UI.PixmapCache.getIcon("stopScript"),
326 self.tr('Stop'), Qt.SHIFT + Qt.Key_F10, 0, 326 self.tr('Stop'), Qt.SHIFT + Qt.Key_F10, 0,
327 self, 'dbg_stop_script') 327 self, 'dbg_stop_script')
328 self.stopAct.setStatusTip(self.tr("""Stop the running script.""")) 328 self.stopAct.setStatusTip(self.tr("""Stop the running script."""))
329 self.stopAct.setWhatsThis(self.tr( 329 self.stopAct.setWhatsThis(self.tr(
330 """<b>Stop</b>""" 330 """<b>Stop</b>"""
335 335
336 self.debugActGrp = createActionGroup(self) 336 self.debugActGrp = createActionGroup(self)
337 337
338 act = E5Action( 338 act = E5Action(
339 self.tr('Continue'), 339 self.tr('Continue'),
340 UI.PixmapCache.getIcon("continue.png"), 340 UI.PixmapCache.getIcon("continue"),
341 self.tr('&Continue'), Qt.Key_F6, 0, 341 self.tr('&Continue'), Qt.Key_F6, 0,
342 self.debugActGrp, 'dbg_continue') 342 self.debugActGrp, 'dbg_continue')
343 act.setStatusTip( 343 act.setStatusTip(
344 self.tr('Continue running the program from the current line')) 344 self.tr('Continue running the program from the current line'))
345 act.setWhatsThis(self.tr( 345 act.setWhatsThis(self.tr(
351 act.triggered.connect(self.__continue) 351 act.triggered.connect(self.__continue)
352 self.actions.append(act) 352 self.actions.append(act)
353 353
354 act = E5Action( 354 act = E5Action(
355 self.tr('Continue to Cursor'), 355 self.tr('Continue to Cursor'),
356 UI.PixmapCache.getIcon("continueToCursor.png"), 356 UI.PixmapCache.getIcon("continueToCursor"),
357 self.tr('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0, 357 self.tr('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0,
358 self.debugActGrp, 'dbg_continue_to_cursor') 358 self.debugActGrp, 'dbg_continue_to_cursor')
359 act.setStatusTip(self.tr( 359 act.setStatusTip(self.tr(
360 """Continue running the program from the""" 360 """Continue running the program from the"""
361 """ current line to the current cursor position""")) 361 """ current line to the current cursor position"""))
367 act.triggered.connect(self.__runToCursor) 367 act.triggered.connect(self.__runToCursor)
368 self.actions.append(act) 368 self.actions.append(act)
369 369
370 act = E5Action( 370 act = E5Action(
371 self.tr('Move Instruction Pointer to Cursor'), 371 self.tr('Move Instruction Pointer to Cursor'),
372 UI.PixmapCache.getIcon("moveInstructionPointer.png"), 372 UI.PixmapCache.getIcon("moveInstructionPointer"),
373 self.tr('&Jump To Cursor'), Qt.Key_F12, 0, 373 self.tr('&Jump To Cursor'), Qt.Key_F12, 0,
374 self.debugActGrp, 'dbg_jump_to_cursor') 374 self.debugActGrp, 'dbg_jump_to_cursor')
375 act.setStatusTip(self.tr( 375 act.setStatusTip(self.tr(
376 """Skip the code from the""" 376 """Skip the code from the"""
377 """ current line to the current cursor position""")) 377 """ current line to the current cursor position"""))
387 act.triggered.connect(self.__moveInstructionPointer) 387 act.triggered.connect(self.__moveInstructionPointer)
388 self.actions.append(act) 388 self.actions.append(act)
389 389
390 act = E5Action( 390 act = E5Action(
391 self.tr('Single Step'), 391 self.tr('Single Step'),
392 UI.PixmapCache.getIcon("step.png"), 392 UI.PixmapCache.getIcon("step"),
393 self.tr('Sin&gle Step'), Qt.Key_F7, 0, 393 self.tr('Sin&gle Step'), Qt.Key_F7, 0,
394 self.debugActGrp, 'dbg_single_step') 394 self.debugActGrp, 'dbg_single_step')
395 act.setStatusTip(self.tr('Execute a single Python statement')) 395 act.setStatusTip(self.tr('Execute a single Python statement'))
396 act.setWhatsThis(self.tr( 396 act.setWhatsThis(self.tr(
397 """<b>Single Step</b>""" 397 """<b>Single Step</b>"""
403 act.triggered.connect(self.__step) 403 act.triggered.connect(self.__step)
404 self.actions.append(act) 404 self.actions.append(act)
405 405
406 act = E5Action( 406 act = E5Action(
407 self.tr('Step Over'), 407 self.tr('Step Over'),
408 UI.PixmapCache.getIcon("stepOver.png"), 408 UI.PixmapCache.getIcon("stepOver"),
409 self.tr('Step &Over'), Qt.Key_F8, 0, 409 self.tr('Step &Over'), Qt.Key_F8, 0,
410 self.debugActGrp, 'dbg_step_over') 410 self.debugActGrp, 'dbg_step_over')
411 act.setStatusTip(self.tr( 411 act.setStatusTip(self.tr(
412 """Execute a single Python statement staying""" 412 """Execute a single Python statement staying"""
413 """ in the current frame""")) 413 """ in the current frame"""))
422 act.triggered.connect(self.__stepOver) 422 act.triggered.connect(self.__stepOver)
423 self.actions.append(act) 423 self.actions.append(act)
424 424
425 act = E5Action( 425 act = E5Action(
426 self.tr('Step Out'), 426 self.tr('Step Out'),
427 UI.PixmapCache.getIcon("stepOut.png"), 427 UI.PixmapCache.getIcon("stepOut"),
428 self.tr('Step Ou&t'), Qt.Key_F9, 0, 428 self.tr('Step Ou&t'), Qt.Key_F9, 0,
429 self.debugActGrp, 'dbg_step_out') 429 self.debugActGrp, 'dbg_step_out')
430 act.setStatusTip(self.tr( 430 act.setStatusTip(self.tr(
431 """Execute Python statements until leaving""" 431 """Execute Python statements until leaving"""
432 """ the current frame""")) 432 """ the current frame"""))
441 act.triggered.connect(self.__stepOut) 441 act.triggered.connect(self.__stepOut)
442 self.actions.append(act) 442 self.actions.append(act)
443 443
444 act = E5Action( 444 act = E5Action(
445 self.tr('Stop'), 445 self.tr('Stop'),
446 UI.PixmapCache.getIcon("stepQuit.png"), 446 UI.PixmapCache.getIcon("stepQuit"),
447 self.tr('&Stop'), Qt.Key_F10, 0, 447 self.tr('&Stop'), Qt.Key_F10, 0,
448 self.debugActGrp, 'dbg_stop') 448 self.debugActGrp, 'dbg_stop')
449 act.setStatusTip(self.tr('Stop debugging')) 449 act.setStatusTip(self.tr('Stop debugging'))
450 act.setWhatsThis(self.tr( 450 act.setWhatsThis(self.tr(
451 """<b>Stop</b>""" 451 """<b>Stop</b>"""
506 506
507 self.dbgSetBpActGrp = createActionGroup(self) 507 self.dbgSetBpActGrp = createActionGroup(self)
508 508
509 self.dbgToggleBpAct = E5Action( 509 self.dbgToggleBpAct = E5Action(
510 self.tr('Toggle Breakpoint'), 510 self.tr('Toggle Breakpoint'),
511 UI.PixmapCache.getIcon("breakpointToggle.png"), 511 UI.PixmapCache.getIcon("breakpointToggle"),
512 self.tr('Toggle Breakpoint'), 512 self.tr('Toggle Breakpoint'),
513 QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")), 513 QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")),
514 0, self.dbgSetBpActGrp, 'dbg_toggle_breakpoint') 514 0, self.dbgSetBpActGrp, 'dbg_toggle_breakpoint')
515 self.dbgToggleBpAct.setStatusTip(self.tr('Toggle Breakpoint')) 515 self.dbgToggleBpAct.setStatusTip(self.tr('Toggle Breakpoint'))
516 self.dbgToggleBpAct.setWhatsThis(self.tr( 516 self.dbgToggleBpAct.setWhatsThis(self.tr(
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"),
527 self.tr('Edit Breakpoint...'), 527 self.tr('Edit Breakpoint...'),
528 QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")), 0, 528 QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")), 0,
529 self.dbgSetBpActGrp, 'dbg_edit_breakpoint') 529 self.dbgSetBpActGrp, 'dbg_edit_breakpoint')
530 self.dbgEditBpAct.setStatusTip(self.tr('Edit Breakpoint')) 530 self.dbgEditBpAct.setStatusTip(self.tr('Edit Breakpoint'))
531 self.dbgEditBpAct.setWhatsThis(self.tr( 531 self.dbgEditBpAct.setWhatsThis(self.tr(
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"),
542 self.tr('Next Breakpoint'), 542 self.tr('Next Breakpoint'),
543 QKeySequence( 543 QKeySequence(
544 self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0, 544 self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0,
545 self.dbgSetBpActGrp, 'dbg_next_breakpoint') 545 self.dbgSetBpActGrp, 'dbg_next_breakpoint')
546 self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint')) 546 self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint'))
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"),
557 self.tr('Previous Breakpoint'), 557 self.tr('Previous Breakpoint'),
558 QKeySequence( 558 QKeySequence(
559 self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")), 559 self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")),
560 0, self.dbgSetBpActGrp, 'dbg_previous_breakpoint') 560 0, self.dbgSetBpActGrp, 'dbg_previous_breakpoint')
561 self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint')) 561 self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint'))
1088 msg = self.tr( 1088 msg = self.tr(
1089 '"{0}" has terminated with an exit status of' 1089 '"{0}" has terminated with an exit status of'
1090 ' {1}.\n{2}').format( 1090 ' {1}.\n{2}').format(
1091 os.path.basename(program), status, info) 1091 os.path.basename(program), status, info)
1092 self.ui.showNotification( 1092 self.ui.showNotification(
1093 UI.PixmapCache.getPixmap("debug48.png"), 1093 UI.PixmapCache.getPixmap("debug48"),
1094 self.tr("Program terminated"), msg) 1094 self.tr("Program terminated"), msg)
1095 else: 1095 else:
1096 if program is None: 1096 if program is None:
1097 self.appendStdout.emit(self.tr( 1097 self.appendStdout.emit(self.tr(
1098 'The program has terminated with an exit status' 1098 'The program has terminated with an exit status'

eric ide

mercurial