Debugger/DebugUI.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3345
071afe8be2a1
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
167 Method defining the user interface actions. 167 Method defining the user interface actions.
168 """ 168 """
169 self.actions = [] 169 self.actions = []
170 170
171 self.runAct = E5Action( 171 self.runAct = E5Action(
172 self.trUtf8('Run Script'), 172 self.tr('Run Script'),
173 UI.PixmapCache.getIcon("runScript.png"), 173 UI.PixmapCache.getIcon("runScript.png"),
174 self.trUtf8('&Run Script...'), 174 self.tr('&Run Script...'),
175 Qt.Key_F2, 0, self, 'dbg_run_script') 175 Qt.Key_F2, 0, self, 'dbg_run_script')
176 self.runAct.setStatusTip(self.trUtf8('Run the current Script')) 176 self.runAct.setStatusTip(self.tr('Run the current Script'))
177 self.runAct.setWhatsThis(self.trUtf8( 177 self.runAct.setWhatsThis(self.tr(
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.trUtf8('Run Project'), 187 self.tr('Run Project'),
188 UI.PixmapCache.getIcon("runProject.png"), 188 UI.PixmapCache.getIcon("runProject.png"),
189 self.trUtf8('Run &Project...'), Qt.SHIFT + Qt.Key_F2, 0, self, 189 self.tr('Run &Project...'), Qt.SHIFT + Qt.Key_F2, 0, self,
190 'dbg_run_project') 190 'dbg_run_project')
191 self.runProjectAct.setStatusTip(self.trUtf8('Run the current Project')) 191 self.runProjectAct.setStatusTip(self.tr('Run the current Project'))
192 self.runProjectAct.setWhatsThis(self.trUtf8( 192 self.runProjectAct.setWhatsThis(self.tr(
193 """<b>Run Project</b>""" 193 """<b>Run Project</b>"""
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.trUtf8('Coverage run of Script'), 203 self.tr('Coverage run of Script'),
204 UI.PixmapCache.getIcon("coverageScript.png"), 204 UI.PixmapCache.getIcon("coverageScript.png"),
205 self.trUtf8('Coverage run of Script...'), 0, 0, self, 205 self.tr('Coverage run of Script...'), 0, 0, self,
206 'dbg_coverage_script') 206 'dbg_coverage_script')
207 self.coverageAct.setStatusTip( 207 self.coverageAct.setStatusTip(
208 self.trUtf8('Perform a coverage run of the current Script')) 208 self.tr('Perform a coverage run of the current Script'))
209 self.coverageAct.setWhatsThis(self.trUtf8( 209 self.coverageAct.setWhatsThis(self.tr(
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.trUtf8('Coverage run of Project'), 219 self.tr('Coverage run of Project'),
220 UI.PixmapCache.getIcon("coverageProject.png"), 220 UI.PixmapCache.getIcon("coverageProject.png"),
221 self.trUtf8('Coverage run of Project...'), 0, 0, self, 221 self.tr('Coverage run of Project...'), 0, 0, self,
222 'dbg_coverage_project') 222 'dbg_coverage_project')
223 self.coverageProjectAct.setStatusTip( 223 self.coverageProjectAct.setStatusTip(
224 self.trUtf8('Perform a coverage run of the current Project')) 224 self.tr('Perform a coverage run of the current Project'))
225 self.coverageProjectAct.setWhatsThis(self.trUtf8( 225 self.coverageProjectAct.setWhatsThis(self.tr(
226 """<b>Coverage run of Project</b>""" 226 """<b>Coverage run of Project</b>"""
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.trUtf8('Profile Script'), 236 self.tr('Profile Script'),
237 UI.PixmapCache.getIcon("profileScript.png"), 237 UI.PixmapCache.getIcon("profileScript.png"),
238 self.trUtf8('Profile Script...'), 0, 0, self, 'dbg_profile_script') 238 self.tr('Profile Script...'), 0, 0, self, 'dbg_profile_script')
239 self.profileAct.setStatusTip(self.trUtf8('Profile the current Script')) 239 self.profileAct.setStatusTip(self.tr('Profile the current Script'))
240 self.profileAct.setWhatsThis(self.trUtf8( 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.trUtf8('Profile Project'), 249 self.tr('Profile Project'),
250 UI.PixmapCache.getIcon("profileProject.png"), 250 UI.PixmapCache.getIcon("profileProject.png"),
251 self.trUtf8('Profile Project...'), 0, 0, self, 251 self.tr('Profile Project...'), 0, 0, self,
252 'dbg_profile_project') 252 'dbg_profile_project')
253 self.profileProjectAct.setStatusTip( 253 self.profileProjectAct.setStatusTip(
254 self.trUtf8('Profile the current Project')) 254 self.tr('Profile the current Project'))
255 self.profileProjectAct.setWhatsThis(self.trUtf8( 255 self.profileProjectAct.setWhatsThis(self.tr(
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.trUtf8('Debug Script'), 265 self.tr('Debug Script'),
266 UI.PixmapCache.getIcon("debugScript.png"), 266 UI.PixmapCache.getIcon("debugScript.png"),
267 self.trUtf8('&Debug Script...'), Qt.Key_F5, 0, self, 267 self.tr('&Debug Script...'), Qt.Key_F5, 0, self,
268 'dbg_debug_script') 268 'dbg_debug_script')
269 self.debugAct.setStatusTip(self.trUtf8('Debug the current Script')) 269 self.debugAct.setStatusTip(self.tr('Debug the current Script'))
270 self.debugAct.setWhatsThis(self.trUtf8( 270 self.debugAct.setWhatsThis(self.tr(
271 """<b>Debug Script</b>""" 271 """<b>Debug Script</b>"""
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.trUtf8('Debug Project'), 281 self.tr('Debug Project'),
282 UI.PixmapCache.getIcon("debugProject.png"), 282 UI.PixmapCache.getIcon("debugProject.png"),
283 self.trUtf8('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self, 283 self.tr('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self,
284 'dbg_debug_project') 284 'dbg_debug_project')
285 self.debugProjectAct.setStatusTip(self.trUtf8( 285 self.debugProjectAct.setStatusTip(self.tr(
286 'Debug the current Project')) 286 'Debug the current Project'))
287 self.debugProjectAct.setWhatsThis(self.trUtf8( 287 self.debugProjectAct.setWhatsThis(self.tr(
288 """<b>Debug Project</b>""" 288 """<b>Debug Project</b>"""
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.trUtf8('Restart'), 298 self.tr('Restart'),
299 UI.PixmapCache.getIcon("restart.png"), 299 UI.PixmapCache.getIcon("restart.png"),
300 self.trUtf8('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script') 300 self.tr('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script')
301 self.restartAct.setStatusTip(self.trUtf8( 301 self.restartAct.setStatusTip(self.tr(
302 'Restart the last debugged script')) 302 'Restart the last debugged script'))
303 self.restartAct.setWhatsThis(self.trUtf8( 303 self.restartAct.setWhatsThis(self.tr(
304 """<b>Restart</b>""" 304 """<b>Restart</b>"""
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.trUtf8('Stop'), 314 self.tr('Stop'),
315 UI.PixmapCache.getIcon("stopScript.png"), 315 UI.PixmapCache.getIcon("stopScript.png"),
316 self.trUtf8('Stop'), Qt.SHIFT + Qt.Key_F10, 0, 316 self.tr('Stop'), Qt.SHIFT + Qt.Key_F10, 0,
317 self, 'dbg_stop_script') 317 self, 'dbg_stop_script')
318 self.stopAct.setStatusTip(self.trUtf8("""Stop the running script.""")) 318 self.stopAct.setStatusTip(self.tr("""Stop the running script."""))
319 self.stopAct.setWhatsThis(self.trUtf8( 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(
329 self.trUtf8('Continue'), 329 self.tr('Continue'),
330 UI.PixmapCache.getIcon("continue.png"), 330 UI.PixmapCache.getIcon("continue.png"),
331 self.trUtf8('&Continue'), Qt.Key_F6, 0, 331 self.tr('&Continue'), Qt.Key_F6, 0,
332 self.debugActGrp, 'dbg_continue') 332 self.debugActGrp, 'dbg_continue')
333 act.setStatusTip( 333 act.setStatusTip(
334 self.trUtf8('Continue running the program from the current line')) 334 self.tr('Continue running the program from the current line'))
335 act.setWhatsThis(self.trUtf8( 335 act.setWhatsThis(self.tr(
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.trUtf8('Continue to Cursor'), 345 self.tr('Continue to Cursor'),
346 UI.PixmapCache.getIcon("continueToCursor.png"), 346 UI.PixmapCache.getIcon("continueToCursor.png"),
347 self.trUtf8('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0, 347 self.tr('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0,
348 self.debugActGrp, 'dbg_continue_to_cursor') 348 self.debugActGrp, 'dbg_continue_to_cursor')
349 act.setStatusTip(self.trUtf8( 349 act.setStatusTip(self.tr(
350 """Continue running the program from the""" 350 """Continue running the program from the"""
351 """ current line to the current cursor position""")) 351 """ current line to the current cursor position"""))
352 act.setWhatsThis(self.trUtf8( 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.trUtf8('Single Step'), 361 self.tr('Single Step'),
362 UI.PixmapCache.getIcon("step.png"), 362 UI.PixmapCache.getIcon("step.png"),
363 self.trUtf8('Sin&gle Step'), Qt.Key_F7, 0, 363 self.tr('Sin&gle Step'), Qt.Key_F7, 0,
364 self.debugActGrp, 'dbg_single_step') 364 self.debugActGrp, 'dbg_single_step')
365 act.setStatusTip(self.trUtf8('Execute a single Python statement')) 365 act.setStatusTip(self.tr('Execute a single Python statement'))
366 act.setWhatsThis(self.trUtf8( 366 act.setWhatsThis(self.tr(
367 """<b>Single Step</b>""" 367 """<b>Single Step</b>"""
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.trUtf8('Step Over'), 377 self.tr('Step Over'),
378 UI.PixmapCache.getIcon("stepOver.png"), 378 UI.PixmapCache.getIcon("stepOver.png"),
379 self.trUtf8('Step &Over'), Qt.Key_F8, 0, 379 self.tr('Step &Over'), Qt.Key_F8, 0,
380 self.debugActGrp, 'dbg_step_over') 380 self.debugActGrp, 'dbg_step_over')
381 act.setStatusTip(self.trUtf8( 381 act.setStatusTip(self.tr(
382 """Execute a single Python statement staying""" 382 """Execute a single Python statement staying"""
383 """ in the current frame""")) 383 """ in the current frame"""))
384 act.setWhatsThis(self.trUtf8( 384 act.setWhatsThis(self.tr(
385 """<b>Step Over</b>""" 385 """<b>Step Over</b>"""
386 """<p>Execute a single Python statement staying in the same""" 386 """<p>Execute a single Python statement staying in the same"""
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"""
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.trUtf8('Step Out'), 396 self.tr('Step Out'),
397 UI.PixmapCache.getIcon("stepOut.png"), 397 UI.PixmapCache.getIcon("stepOut.png"),
398 self.trUtf8('Step Ou&t'), Qt.Key_F9, 0, 398 self.tr('Step Ou&t'), Qt.Key_F9, 0,
399 self.debugActGrp, 'dbg_step_out') 399 self.debugActGrp, 'dbg_step_out')
400 act.setStatusTip(self.trUtf8( 400 act.setStatusTip(self.tr(
401 """Execute Python statements until leaving""" 401 """Execute Python statements until leaving"""
402 """ the current frame""")) 402 """ the current frame"""))
403 act.setWhatsThis(self.trUtf8( 403 act.setWhatsThis(self.tr(
404 """<b>Step Out</b>""" 404 """<b>Step Out</b>"""
405 """<p>Execute Python statements until leaving the current""" 405 """<p>Execute Python statements until leaving the current"""
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"""
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.trUtf8('Stop'), 415 self.tr('Stop'),
416 UI.PixmapCache.getIcon("stepQuit.png"), 416 UI.PixmapCache.getIcon("stepQuit.png"),
417 self.trUtf8('&Stop'), Qt.Key_F10, 0, 417 self.tr('&Stop'), Qt.Key_F10, 0,
418 self.debugActGrp, 'dbg_stop') 418 self.debugActGrp, 'dbg_stop')
419 act.setStatusTip(self.trUtf8('Stop debugging')) 419 act.setStatusTip(self.tr('Stop debugging'))
420 act.setWhatsThis(self.trUtf8( 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(
430 self.trUtf8('Evaluate'), 430 self.tr('Evaluate'),
431 self.trUtf8('E&valuate...'), 431 self.tr('E&valuate...'),
432 0, 0, self.debugActGrp2, 'dbg_evaluate') 432 0, 0, self.debugActGrp2, 'dbg_evaluate')
433 act.setStatusTip(self.trUtf8('Evaluate in current context')) 433 act.setStatusTip(self.tr('Evaluate in current context'))
434 act.setWhatsThis(self.trUtf8( 434 act.setWhatsThis(self.tr(
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.trUtf8('Execute'), 444 self.tr('Execute'),
445 self.trUtf8('E&xecute...'), 445 self.tr('E&xecute...'),
446 0, 0, self.debugActGrp2, 'dbg_execute') 446 0, 0, self.debugActGrp2, 'dbg_execute')
447 act.setStatusTip( 447 act.setStatusTip(
448 self.trUtf8('Execute a one line statement in the current context')) 448 self.tr('Execute a one line statement in the current context'))
449 act.setWhatsThis(self.trUtf8( 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.trUtf8('Variables Type Filter'), 458 self.tr('Variables Type Filter'),
459 self.trUtf8('Varia&bles Type Filter...'), 0, 0, self, 459 self.tr('Varia&bles Type Filter...'), 0, 0, self,
460 'dbg_variables_filter') 460 'dbg_variables_filter')
461 self.dbgFilterAct.setStatusTip(self.trUtf8( 461 self.dbgFilterAct.setStatusTip(self.tr(
462 'Configure variables type filter')) 462 'Configure variables type filter'))
463 self.dbgFilterAct.setWhatsThis(self.trUtf8( 463 self.dbgFilterAct.setWhatsThis(self.tr(
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.trUtf8('Exceptions Filter'), 474 self.tr('Exceptions Filter'),
475 self.trUtf8('&Exceptions Filter...'), 0, 0, self, 475 self.tr('&Exceptions Filter...'), 0, 0, self,
476 'dbg_exceptions_filter') 476 'dbg_exceptions_filter')
477 self.excFilterAct.setStatusTip(self.trUtf8( 477 self.excFilterAct.setStatusTip(self.tr(
478 'Configure exceptions filter')) 478 'Configure exceptions filter'))
479 self.excFilterAct.setWhatsThis(self.trUtf8( 479 self.excFilterAct.setWhatsThis(self.tr(
480 """<b>Exceptions Filter</b>""" 480 """<b>Exceptions Filter</b>"""
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>"""
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.trUtf8('Ignored Exceptions'), 491 self.tr('Ignored Exceptions'),
492 self.trUtf8('&Ignored Exceptions...'), 0, 0, 492 self.tr('&Ignored Exceptions...'), 0, 0,
493 self, 'dbg_ignored_exceptions') 493 self, 'dbg_ignored_exceptions')
494 self.excIgnoreFilterAct.setStatusTip(self.trUtf8( 494 self.excIgnoreFilterAct.setStatusTip(self.tr(
495 'Configure ignored exceptions')) 495 'Configure ignored exceptions'))
496 self.excIgnoreFilterAct.setWhatsThis(self.trUtf8( 496 self.excIgnoreFilterAct.setWhatsThis(self.tr(
497 """<b>Ignored Exceptions</b>""" 497 """<b>Ignored Exceptions</b>"""
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>"""
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
509 self.dbgToggleBpAct = E5Action( 509 self.dbgToggleBpAct = E5Action(
510 self.trUtf8('Toggle Breakpoint'), 510 self.tr('Toggle Breakpoint'),
511 UI.PixmapCache.getIcon("breakpointToggle.png"), 511 UI.PixmapCache.getIcon("breakpointToggle.png"),
512 self.trUtf8('Toggle Breakpoint'), 512 self.tr('Toggle Breakpoint'),
513 QKeySequence(self.trUtf8("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.trUtf8('Toggle Breakpoint')) 515 self.dbgToggleBpAct.setStatusTip(self.tr('Toggle Breakpoint'))
516 self.dbgToggleBpAct.setWhatsThis(self.trUtf8( 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.trUtf8('Edit Breakpoint'), 525 self.tr('Edit Breakpoint'),
526 UI.PixmapCache.getIcon("cBreakpointToggle.png"), 526 UI.PixmapCache.getIcon("cBreakpointToggle.png"),
527 self.trUtf8('Edit Breakpoint...'), 527 self.tr('Edit Breakpoint...'),
528 QKeySequence(self.trUtf8("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.trUtf8('Edit Breakpoint')) 530 self.dbgEditBpAct.setStatusTip(self.tr('Edit Breakpoint'))
531 self.dbgEditBpAct.setWhatsThis(self.trUtf8( 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.trUtf8('Next Breakpoint'), 540 self.tr('Next Breakpoint'),
541 UI.PixmapCache.getIcon("breakpointNext.png"), 541 UI.PixmapCache.getIcon("breakpointNext.png"),
542 self.trUtf8('Next Breakpoint'), 542 self.tr('Next Breakpoint'),
543 QKeySequence( 543 QKeySequence(
544 self.trUtf8("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.trUtf8('Next Breakpoint')) 546 self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint'))
547 self.dbgNextBpAct.setWhatsThis(self.trUtf8( 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.trUtf8('Previous Breakpoint'), 555 self.tr('Previous Breakpoint'),
556 UI.PixmapCache.getIcon("breakpointPrevious.png"), 556 UI.PixmapCache.getIcon("breakpointPrevious.png"),
557 self.trUtf8('Previous Breakpoint'), 557 self.tr('Previous Breakpoint'),
558 QKeySequence( 558 QKeySequence(
559 self.trUtf8("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.trUtf8('Previous Breakpoint')) 561 self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint'))
562 self.dbgPrevBpAct.setWhatsThis(self.trUtf8( 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.trUtf8('Clear Breakpoints'), 570 self.tr('Clear Breakpoints'),
571 self.trUtf8('Clear Breakpoints'), 571 self.tr('Clear Breakpoints'),
572 QKeySequence( 572 QKeySequence(
573 self.trUtf8("Ctrl+Shift+C", "Debug|Clear Breakpoints")), 0, 573 self.tr("Ctrl+Shift+C", "Debug|Clear Breakpoints")), 0,
574 self.dbgSetBpActGrp, 'dbg_clear_breakpoint') 574 self.dbgSetBpActGrp, 'dbg_clear_breakpoint')
575 act.setStatusTip(self.trUtf8('Clear Breakpoints')) 575 act.setStatusTip(self.tr('Clear Breakpoints'))
576 act.setWhatsThis(self.trUtf8( 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)
598 """ 598 """
599 Public slot to initialize the project menu. 599 Public slot to initialize the project menu.
600 600
601 @return the generated menu 601 @return the generated menu
602 """ 602 """
603 dmenu = QMenu(self.trUtf8('&Debug'), self.parent()) 603 dmenu = QMenu(self.tr('&Debug'), self.parent())
604 dmenu.setTearOffEnabled(True) 604 dmenu.setTearOffEnabled(True)
605 smenu = QMenu(self.trUtf8('&Start'), self.parent()) 605 smenu = QMenu(self.tr('&Start'), self.parent())
606 smenu.setTearOffEnabled(True) 606 smenu.setTearOffEnabled(True)
607 self.breakpointsMenu = QMenu(self.trUtf8('&Breakpoints'), dmenu) 607 self.breakpointsMenu = QMenu(self.tr('&Breakpoints'), dmenu)
608 608
609 smenu.addAction(self.restartAct) 609 smenu.addAction(self.restartAct)
610 smenu.addAction(self.stopAct) 610 smenu.addAction(self.stopAct)
611 smenu.addSeparator() 611 smenu.addSeparator()
612 smenu.addAction(self.runAct) 612 smenu.addAction(self.runAct)
644 644
645 @param toolbarManager reference to a toolbar manager object 645 @param toolbarManager reference to a toolbar manager object
646 (E5ToolBarManager) 646 (E5ToolBarManager)
647 @return the generated toolbars (list of QToolBar) 647 @return the generated toolbars (list of QToolBar)
648 """ 648 """
649 starttb = QToolBar(self.trUtf8("Start"), self.ui) 649 starttb = QToolBar(self.tr("Start"), self.ui)
650 starttb.setIconSize(UI.Config.ToolBarIconSize) 650 starttb.setIconSize(UI.Config.ToolBarIconSize)
651 starttb.setObjectName("StartToolbar") 651 starttb.setObjectName("StartToolbar")
652 starttb.setToolTip(self.trUtf8('Start')) 652 starttb.setToolTip(self.tr('Start'))
653 653
654 starttb.addAction(self.restartAct) 654 starttb.addAction(self.restartAct)
655 starttb.addAction(self.stopAct) 655 starttb.addAction(self.stopAct)
656 starttb.addSeparator() 656 starttb.addSeparator()
657 starttb.addAction(self.runAct) 657 starttb.addAction(self.runAct)
658 starttb.addAction(self.runProjectAct) 658 starttb.addAction(self.runProjectAct)
659 starttb.addSeparator() 659 starttb.addSeparator()
660 starttb.addAction(self.debugAct) 660 starttb.addAction(self.debugAct)
661 starttb.addAction(self.debugProjectAct) 661 starttb.addAction(self.debugProjectAct)
662 662
663 debugtb = QToolBar(self.trUtf8("Debug"), self.ui) 663 debugtb = QToolBar(self.tr("Debug"), self.ui)
664 debugtb.setIconSize(UI.Config.ToolBarIconSize) 664 debugtb.setIconSize(UI.Config.ToolBarIconSize)
665 debugtb.setObjectName("DebugToolbar") 665 debugtb.setObjectName("DebugToolbar")
666 debugtb.setToolTip(self.trUtf8('Debug')) 666 debugtb.setToolTip(self.tr('Debug'))
667 667
668 debugtb.addActions(self.debugActGrp.actions()) 668 debugtb.addActions(self.debugActGrp.actions())
669 debugtb.addSeparator() 669 debugtb.addSeparator()
670 debugtb.addAction(self.dbgToggleBpAct) 670 debugtb.addAction(self.dbgToggleBpAct)
671 debugtb.addAction(self.dbgEditBpAct) 671 debugtb.addAction(self.dbgEditBpAct)
1008 1008
1009 if not Preferences.getDebugger("SuppressClientExit") or status != 0: 1009 if not Preferences.getDebugger("SuppressClientExit") or status != 0:
1010 if self.ui.currentProg is None: 1010 if self.ui.currentProg is None:
1011 E5MessageBox.information( 1011 E5MessageBox.information(
1012 self.ui, Program, 1012 self.ui, Program,
1013 self.trUtf8('<p>The program has terminated with an exit' 1013 self.tr('<p>The program has terminated with an exit'
1014 ' status of {0}.</p>').format(status)) 1014 ' status of {0}.</p>').format(status))
1015 else: 1015 else:
1016 E5MessageBox.information( 1016 E5MessageBox.information(
1017 self.ui, Program, 1017 self.ui, Program,
1018 self.trUtf8('<p><b>{0}</b> has terminated with an exit' 1018 self.tr('<p><b>{0}</b> has terminated with an exit'
1019 ' status of {1}.</p>') 1019 ' status of {1}.</p>')
1020 .format(Utilities.normabspath(self.ui.currentProg), 1020 .format(Utilities.normabspath(self.ui.currentProg),
1021 status)) 1021 status))
1022 else: 1022 else:
1023 if self.ui.notificationsEnabled(): 1023 if self.ui.notificationsEnabled():
1024 if self.ui.currentProg is None: 1024 if self.ui.currentProg is None:
1025 msg = self.trUtf8('The program has terminated with an exit' 1025 msg = self.tr('The program has terminated with an exit'
1026 ' status of {0}.').format(status) 1026 ' status of {0}.').format(status)
1027 else: 1027 else:
1028 msg = self.trUtf8('"{0}" has terminated with an exit' 1028 msg = self.tr('"{0}" has terminated with an exit'
1029 ' status of {1}.')\ 1029 ' status of {1}.')\
1030 .format(os.path.basename(self.ui.currentProg), 1030 .format(os.path.basename(self.ui.currentProg),
1031 status) 1031 status)
1032 self.ui.showNotification( 1032 self.ui.showNotification(
1033 UI.PixmapCache.getPixmap("debug48.png"), 1033 UI.PixmapCache.getPixmap("debug48.png"),
1034 self.trUtf8("Program terminated"), msg) 1034 self.tr("Program terminated"), msg)
1035 else: 1035 else:
1036 if self.ui.currentProg is None: 1036 if self.ui.currentProg is None:
1037 self.appendStdout.emit( 1037 self.appendStdout.emit(
1038 self.trUtf8('The program has terminated with an exit' 1038 self.tr('The program has terminated with an exit'
1039 ' status of {0}.\n').format(status)) 1039 ' status of {0}.\n').format(status))
1040 else: 1040 else:
1041 self.appendStdout.emit( 1041 self.appendStdout.emit(
1042 self.trUtf8('"{0}" has terminated with an exit' 1042 self.tr('"{0}" has terminated with an exit'
1043 ' status of {1}.\n') 1043 ' status of {1}.\n')
1044 .format(Utilities.normabspath(self.ui.currentProg), 1044 .format(Utilities.normabspath(self.ui.currentProg),
1045 status)) 1045 status))
1046 1046
1047 def __clientSyntaxError(self, message, filename, lineNo, characterNo): 1047 def __clientSyntaxError(self, message, filename, lineNo, characterNo):
1048 """ 1048 """
1060 self.ui.activateWindow() 1060 self.ui.activateWindow()
1061 1061
1062 if message is None: 1062 if message is None:
1063 E5MessageBox.critical( 1063 E5MessageBox.critical(
1064 self.ui, Program, 1064 self.ui, Program,
1065 self.trUtf8( 1065 self.tr(
1066 'The program being debugged contains an unspecified' 1066 'The program being debugged contains an unspecified'
1067 ' syntax error.')) 1067 ' syntax error.'))
1068 return 1068 return
1069 1069
1070 if not os.path.isabs(filename): 1070 if not os.path.isabs(filename):
1078 if os.path.exists(os.path.join(d, filename)): 1078 if os.path.exists(os.path.join(d, filename)):
1079 filename = os.path.join(d, filename) 1079 filename = os.path.join(d, filename)
1080 self.viewmanager.setFileLine(filename, lineNo, True, True) 1080 self.viewmanager.setFileLine(filename, lineNo, True, True)
1081 E5MessageBox.critical( 1081 E5MessageBox.critical(
1082 self.ui, Program, 1082 self.ui, Program,
1083 self.trUtf8('<p>The file <b>{0}</b> contains the syntax error' 1083 self.tr('<p>The file <b>{0}</b> contains the syntax error'
1084 ' <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>.' 1084 ' <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>.'
1085 '</p>') 1085 '</p>')
1086 .format(filename, message, lineNo, characterNo)) 1086 .format(filename, message, lineNo, characterNo))
1087 1087
1088 def __clientException(self, exceptionType, exceptionMessage, stackTrace): 1088 def __clientException(self, exceptionType, exceptionMessage, stackTrace):
1089 """ 1089 """
1090 Private method to handle an exception of the debugged program. 1090 Private method to handle an exception of the debugged program.
1097 self.ui.activateWindow() 1097 self.ui.activateWindow()
1098 QApplication.processEvents() 1098 QApplication.processEvents()
1099 if exceptionType is None: 1099 if exceptionType is None:
1100 E5MessageBox.critical( 1100 E5MessageBox.critical(
1101 self.ui, Program, 1101 self.ui, Program,
1102 self.trUtf8('An unhandled exception occured.' 1102 self.tr('An unhandled exception occured.'
1103 ' See the shell window for details.')) 1103 ' See the shell window for details.'))
1104 return 1104 return
1105 1105
1106 if (self.exceptions and 1106 if (self.exceptions and
1107 exceptionType not in self.excIgnoreList and 1107 exceptionType not in self.excIgnoreList and
1108 (not len(self.excList) or 1108 (not len(self.excList) or
1137 E5MessageBox.No | 1137 E5MessageBox.No |
1138 E5MessageBox.Yes | 1138 E5MessageBox.Yes |
1139 E5MessageBox.Ignore) 1139 E5MessageBox.Ignore)
1140 res = E5MessageBox.critical( 1140 res = E5MessageBox.critical(
1141 self.ui, Program, 1141 self.ui, Program,
1142 self.trUtf8( 1142 self.tr(
1143 '<p>The debugged program raised the exception' 1143 '<p>The debugged program raised the exception'
1144 ' <b>{0}</b><br>"<b>{1}</b>"<br>' 1144 ' <b>{0}</b><br>"<b>{1}</b>"<br>'
1145 'File: <b>{2}</b>, Line: <b>{3}</b></p>' 1145 'File: <b>{2}</b>, Line: <b>{3}</b></p>'
1146 '<p>Break here?</p>') 1146 '<p>Break here?</p>')
1147 .format( 1147 .format(
1152 buttons, 1152 buttons,
1153 E5MessageBox.No) 1153 E5MessageBox.No)
1154 else: 1154 else:
1155 res = E5MessageBox.critical( 1155 res = E5MessageBox.critical(
1156 self.ui, Program, 1156 self.ui, Program,
1157 self.trUtf8( 1157 self.tr(
1158 '<p>The debugged program raised the exception' 1158 '<p>The debugged program raised the exception'
1159 ' <b>{0}</b><br>"<b>{1}</b>"</p>') 1159 ' <b>{0}</b><br>"<b>{1}</b>"</p>')
1160 .format( 1160 .format(
1161 exceptionType, 1161 exceptionType,
1162 Utilities.html_encode(exceptionMessage))) 1162 Utilities.html_encode(exceptionMessage)))
1189 """ 1189 """
1190 self.__resetUI() 1190 self.__resetUI()
1191 if unplanned: 1191 if unplanned:
1192 E5MessageBox.information( 1192 E5MessageBox.information(
1193 self.ui, Program, 1193 self.ui, Program,
1194 self.trUtf8('The program being debugged has terminated' 1194 self.tr('The program being debugged has terminated'
1195 ' unexpectedly.')) 1195 ' unexpectedly.'))
1196 1196
1197 def __getThreadList(self): 1197 def __getThreadList(self):
1198 """ 1198 """
1199 Private method to get the list of threads from the client. 1199 Private method to get the list of threads from the client.
1200 """ 1200 """
1262 @param filename filename of the breakpoint (string) 1262 @param filename filename of the breakpoint (string)
1263 @param lineno linenumber of the breakpoint (integer) 1263 @param lineno linenumber of the breakpoint (integer)
1264 """ 1264 """
1265 E5MessageBox.critical( 1265 E5MessageBox.critical(
1266 self.ui, 1266 self.ui,
1267 self.trUtf8("Breakpoint Condition Error"), 1267 self.tr("Breakpoint Condition Error"),
1268 self.trUtf8( 1268 self.tr(
1269 """<p>The condition of the breakpoint <b>{0}, {1}</b>""" 1269 """<p>The condition of the breakpoint <b>{0}, {1}</b>"""
1270 """ contains a syntax error.</p>""") 1270 """ contains a syntax error.</p>""")
1271 .format(filename, lineno)) 1271 .format(filename, lineno))
1272 1272
1273 model = self.debugServer.getBreakPointModel() 1273 model = self.debugServer.getBreakPointModel()
1298 1298
1299 @param cond expression of the watch expression (string) 1299 @param cond expression of the watch expression (string)
1300 """ 1300 """
1301 E5MessageBox.critical( 1301 E5MessageBox.critical(
1302 self.ui, 1302 self.ui,
1303 self.trUtf8("Watch Expression Error"), 1303 self.tr("Watch Expression Error"),
1304 self.trUtf8("""<p>The watch expression <b>{0}</b>""" 1304 self.tr("""<p>The watch expression <b>{0}</b>"""
1305 """ contains a syntax error.</p>""") 1305 """ contains a syntax error.</p>""")
1306 .format(cond)) 1306 .format(cond))
1307 1307
1308 model = self.debugServer.getWatchPointModel() 1308 model = self.debugServer.getWatchPointModel()
1309 index = model.getWatchPointIndex(cond) 1309 index = model.getWatchPointIndex(cond)
1310 if not index.isValid(): 1310 if not index.isValid():
1326 idx = self.__model.getWatchPointIndex(cond, special) 1326 idx = self.__model.getWatchPointIndex(cond, special)
1327 duplicate = idx.isValid() and \ 1327 duplicate = idx.isValid() and \
1328 idx.internalPointer() != index.internalPointer() 1328 idx.internalPointer() != index.internalPointer()
1329 if duplicate: 1329 if duplicate:
1330 if not special: 1330 if not special:
1331 msg = self.trUtf8("""<p>A watch expression '<b>{0}</b>'""" 1331 msg = self.tr("""<p>A watch expression '<b>{0}</b>'"""
1332 """ already exists.</p>""")\ 1332 """ already exists.</p>""")\
1333 .format(Utilities.html_encode(cond)) 1333 .format(Utilities.html_encode(cond))
1334 else: 1334 else:
1335 msg = self.trUtf8( 1335 msg = self.tr(
1336 """<p>A watch expression '<b>{0}</b>'""" 1336 """<p>A watch expression '<b>{0}</b>'"""
1337 """ for the variable <b>{1}</b> already""" 1337 """ for the variable <b>{1}</b> already"""
1338 """ exists.</p>""")\ 1338 """ exists.</p>""")\
1339 .format(special, 1339 .format(special,
1340 Utilities.html_encode(cond)) 1340 Utilities.html_encode(cond))
1341 E5MessageBox.warning( 1341 E5MessageBox.warning(
1342 self.ui, 1342 self.ui,
1343 self.trUtf8("Watch expression already exists"), 1343 self.tr("Watch expression already exists"),
1344 msg) 1344 msg)
1345 model.deleteWatchPointByIndex(index) 1345 model.deleteWatchPointByIndex(index)
1346 else: 1346 else:
1347 model.setWatchPointByIndex(index, cond, special, 1347 model.setWatchPointByIndex(index, cond, special,
1348 (temp, enabled, count)) 1348 (temp, enabled, count))
1485 doNotStart = False 1485 doNotStart = False
1486 1486
1487 # Get the command line arguments, the working directory and the 1487 # Get the command line arguments, the working directory and the
1488 # exception reporting flag. 1488 # exception reporting flag.
1489 if runProject: 1489 if runProject:
1490 cap = self.trUtf8("Coverage of Project") 1490 cap = self.tr("Coverage of Project")
1491 else: 1491 else:
1492 cap = self.trUtf8("Coverage of Script") 1492 cap = self.tr("Coverage of Script")
1493 dlg = StartDialog( 1493 dlg = StartDialog(
1494 cap, self.argvHistory, self.wdHistory, 1494 cap, self.argvHistory, self.wdHistory,
1495 self.envHistory, self.exceptions, self.ui, 2, 1495 self.envHistory, self.exceptions, self.ui, 2,
1496 autoClearShell=self.autoClearShell) 1496 autoClearShell=self.autoClearShell)
1497 if dlg.exec_() == QDialog.Accepted: 1497 if dlg.exec_() == QDialog.Accepted:
1502 if runProject: 1502 if runProject:
1503 fn = self.project.getMainScript(True) 1503 fn = self.project.getMainScript(True)
1504 if fn is None: 1504 if fn is None:
1505 E5MessageBox.critical( 1505 E5MessageBox.critical(
1506 self.ui, 1506 self.ui,
1507 self.trUtf8("Coverage of Project"), 1507 self.tr("Coverage of Project"),
1508 self.trUtf8( 1508 self.tr(
1509 "There is no main script defined for the" 1509 "There is no main script defined for the"
1510 " current project. Aborting")) 1510 " current project. Aborting"))
1511 return 1511 return
1512 1512
1513 if Preferences.getDebugger("Autosave") and \ 1513 if Preferences.getDebugger("Autosave") and \
1603 doNotStart = False 1603 doNotStart = False
1604 1604
1605 # Get the command line arguments, the working directory and the 1605 # Get the command line arguments, the working directory and the
1606 # exception reporting flag. 1606 # exception reporting flag.
1607 if runProject: 1607 if runProject:
1608 cap = self.trUtf8("Profile of Project") 1608 cap = self.tr("Profile of Project")
1609 else: 1609 else:
1610 cap = self.trUtf8("Profile of Script") 1610 cap = self.tr("Profile of Script")
1611 dlg = StartDialog( 1611 dlg = StartDialog(
1612 cap, self.argvHistory, self.wdHistory, self.envHistory, 1612 cap, self.argvHistory, self.wdHistory, self.envHistory,
1613 self.exceptions, self.ui, 3, 1613 self.exceptions, self.ui, 3,
1614 autoClearShell=self.autoClearShell) 1614 autoClearShell=self.autoClearShell)
1615 if dlg.exec_() == QDialog.Accepted: 1615 if dlg.exec_() == QDialog.Accepted:
1620 if runProject: 1620 if runProject:
1621 fn = self.project.getMainScript(True) 1621 fn = self.project.getMainScript(True)
1622 if fn is None: 1622 if fn is None:
1623 E5MessageBox.critical( 1623 E5MessageBox.critical(
1624 self.ui, 1624 self.ui,
1625 self.trUtf8("Profile of Project"), 1625 self.tr("Profile of Project"),
1626 self.trUtf8( 1626 self.tr(
1627 "There is no main script defined for the" 1627 "There is no main script defined for the"
1628 " current project. Aborting")) 1628 " current project. Aborting"))
1629 return 1629 return
1630 1630
1631 if Preferences.getDebugger("Autosave") and \ 1631 if Preferences.getDebugger("Autosave") and \
1721 doNotStart = False 1721 doNotStart = False
1722 1722
1723 # Get the command line arguments, the working directory and the 1723 # Get the command line arguments, the working directory and the
1724 # exception reporting flag. 1724 # exception reporting flag.
1725 if runProject: 1725 if runProject:
1726 cap = self.trUtf8("Run Project") 1726 cap = self.tr("Run Project")
1727 else: 1727 else:
1728 cap = self.trUtf8("Run Script") 1728 cap = self.tr("Run Script")
1729 dlg = StartDialog( 1729 dlg = StartDialog(
1730 cap, self.argvHistory, self.wdHistory, self.envHistory, 1730 cap, self.argvHistory, self.wdHistory, self.envHistory,
1731 self.exceptions, self.ui, 1, 1731 self.exceptions, self.ui, 1,
1732 autoClearShell=self.autoClearShell, 1732 autoClearShell=self.autoClearShell,
1733 autoFork=self.forkAutomatically, 1733 autoFork=self.forkAutomatically,
1740 if runProject: 1740 if runProject:
1741 fn = self.project.getMainScript(True) 1741 fn = self.project.getMainScript(True)
1742 if fn is None: 1742 if fn is None:
1743 E5MessageBox.critical( 1743 E5MessageBox.critical(
1744 self.ui, 1744 self.ui,
1745 self.trUtf8("Run Project"), 1745 self.tr("Run Project"),
1746 self.trUtf8( 1746 self.tr(
1747 "There is no main script defined for the" 1747 "There is no main script defined for the"
1748 " current project. Aborting")) 1748 " current project. Aborting"))
1749 return 1749 return
1750 1750
1751 if Preferences.getDebugger("Autosave") and \ 1751 if Preferences.getDebugger("Autosave") and \
1842 doNotStart = False 1842 doNotStart = False
1843 1843
1844 # Get the command line arguments, the working directory and the 1844 # Get the command line arguments, the working directory and the
1845 # exception reporting flag. 1845 # exception reporting flag.
1846 if debugProject: 1846 if debugProject:
1847 cap = self.trUtf8("Debug Project") 1847 cap = self.tr("Debug Project")
1848 else: 1848 else:
1849 cap = self.trUtf8("Debug Script") 1849 cap = self.tr("Debug Script")
1850 dlg = StartDialog( 1850 dlg = StartDialog(
1851 cap, self.argvHistory, self.wdHistory, self.envHistory, 1851 cap, self.argvHistory, self.wdHistory, self.envHistory,
1852 self.exceptions, self.ui, 0, tracePython=self.tracePython, 1852 self.exceptions, self.ui, 0, tracePython=self.tracePython,
1853 autoClearShell=self.autoClearShell, autoContinue=self.autoContinue, 1853 autoClearShell=self.autoClearShell, autoContinue=self.autoContinue,
1854 autoFork=self.forkAutomatically, forkChild=self.forkIntoChild) 1854 autoFork=self.forkAutomatically, forkChild=self.forkIntoChild)
1861 if debugProject: 1861 if debugProject:
1862 fn = self.project.getMainScript(True) 1862 fn = self.project.getMainScript(True)
1863 if fn is None: 1863 if fn is None:
1864 E5MessageBox.critical( 1864 E5MessageBox.critical(
1865 self.ui, 1865 self.ui,
1866 self.trUtf8("Debug Project"), 1866 self.tr("Debug Project"),
1867 self.trUtf8( 1867 self.tr(
1868 "There is no main script defined for the" 1868 "There is no main script defined for the"
1869 " current project. No debugging possible.")) 1869 " current project. No debugging possible."))
1870 return 1870 return
1871 1871
1872 if Preferences.getDebugger("Autosave") and \ 1872 if Preferences.getDebugger("Autosave") and \
2152 else: 2152 else:
2153 curr = -1 2153 curr = -1
2154 2154
2155 arg, ok = QInputDialog.getItem( 2155 arg, ok = QInputDialog.getItem(
2156 self.ui, 2156 self.ui,
2157 self.trUtf8("Evaluate"), 2157 self.tr("Evaluate"),
2158 self.trUtf8("Enter the statement to evaluate"), 2158 self.tr("Enter the statement to evaluate"),
2159 self.evalHistory, 2159 self.evalHistory,
2160 curr, True) 2160 curr, True)
2161 2161
2162 if ok: 2162 if ok:
2163 if not arg: 2163 if not arg:
2181 else: 2181 else:
2182 curr = -1 2182 curr = -1
2183 2183
2184 stmt, ok = QInputDialog.getItem( 2184 stmt, ok = QInputDialog.getItem(
2185 self.ui, 2185 self.ui,
2186 self.trUtf8("Execute"), 2186 self.tr("Execute"),
2187 self.trUtf8("Enter the statement to execute"), 2187 self.tr("Enter the statement to execute"),
2188 self.execHistory, 2188 self.execHistory,
2189 curr, True) 2189 curr, True)
2190 2190
2191 if ok: 2191 if ok:
2192 if not stmt: 2192 if not stmt:

eric ide

mercurial