Debugger/DebugUI.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3456
96232974dcdb
parent 3446
5a670e55adbb
child 3591
2f2a4a76dd22
--- a/Debugger/DebugUI.py	Sun Mar 30 22:00:14 2014 +0200
+++ b/Debugger/DebugUI.py	Thu Apr 03 23:05:31 2014 +0200
@@ -171,219 +171,219 @@
         self.actions = []
         
         self.runAct = E5Action(
-            self.trUtf8('Run Script'),
+            self.tr('Run Script'),
             UI.PixmapCache.getIcon("runScript.png"),
-            self.trUtf8('&Run Script...'),
+            self.tr('&Run Script...'),
             Qt.Key_F2, 0, self, 'dbg_run_script')
-        self.runAct.setStatusTip(self.trUtf8('Run the current Script'))
-        self.runAct.setWhatsThis(self.trUtf8(
+        self.runAct.setStatusTip(self.tr('Run the current Script'))
+        self.runAct.setWhatsThis(self.tr(
             """<b>Run Script</b>"""
             """<p>Set the command line arguments and run the script outside"""
             """ the debugger. If the file has unsaved changes it may be"""
             """ saved first.</p>"""
         ))
-        self.runAct.triggered[()].connect(self.__runScript)
+        self.runAct.triggered.connect(self.__runScript)
         self.actions.append(self.runAct)
 
         self.runProjectAct = E5Action(
-            self.trUtf8('Run Project'),
+            self.tr('Run Project'),
             UI.PixmapCache.getIcon("runProject.png"),
-            self.trUtf8('Run &Project...'), Qt.SHIFT + Qt.Key_F2, 0, self,
+            self.tr('Run &Project...'), Qt.SHIFT + Qt.Key_F2, 0, self,
             'dbg_run_project')
-        self.runProjectAct.setStatusTip(self.trUtf8('Run the current Project'))
-        self.runProjectAct.setWhatsThis(self.trUtf8(
+        self.runProjectAct.setStatusTip(self.tr('Run the current Project'))
+        self.runProjectAct.setWhatsThis(self.tr(
             """<b>Run Project</b>"""
             """<p>Set the command line arguments and run the current project"""
             """ outside the debugger."""
             """ If files of the current project have unsaved changes they"""
             """ may be saved first.</p>"""
         ))
-        self.runProjectAct.triggered[()].connect(self.__runProject)
+        self.runProjectAct.triggered.connect(self.__runProject)
         self.actions.append(self.runProjectAct)
 
         self.coverageAct = E5Action(
-            self.trUtf8('Coverage run of Script'),
+            self.tr('Coverage run of Script'),
             UI.PixmapCache.getIcon("coverageScript.png"),
-            self.trUtf8('Coverage run of Script...'), 0, 0, self,
+            self.tr('Coverage run of Script...'), 0, 0, self,
             'dbg_coverage_script')
         self.coverageAct.setStatusTip(
-            self.trUtf8('Perform a coverage run of the current Script'))
-        self.coverageAct.setWhatsThis(self.trUtf8(
+            self.tr('Perform a coverage run of the current Script'))
+        self.coverageAct.setWhatsThis(self.tr(
             """<b>Coverage run of Script</b>"""
             """<p>Set the command line arguments and run the script under"""
             """ the control of a coverage analysis tool. If the file has"""
             """ unsaved changes it may be saved first.</p>"""
         ))
-        self.coverageAct.triggered[()].connect(self.__coverageScript)
+        self.coverageAct.triggered.connect(self.__coverageScript)
         self.actions.append(self.coverageAct)
 
         self.coverageProjectAct = E5Action(
-            self.trUtf8('Coverage run of Project'),
+            self.tr('Coverage run of Project'),
             UI.PixmapCache.getIcon("coverageProject.png"),
-            self.trUtf8('Coverage run of Project...'), 0, 0, self,
+            self.tr('Coverage run of Project...'), 0, 0, self,
             'dbg_coverage_project')
         self.coverageProjectAct.setStatusTip(
-            self.trUtf8('Perform a coverage run of the current Project'))
-        self.coverageProjectAct.setWhatsThis(self.trUtf8(
+            self.tr('Perform a coverage run of the current Project'))
+        self.coverageProjectAct.setWhatsThis(self.tr(
             """<b>Coverage run of Project</b>"""
             """<p>Set the command line arguments and run the current project"""
             """ under the control of a coverage analysis tool."""
             """ If files of the current project have unsaved changes"""
             """ they may be saved first.</p>"""
         ))
-        self.coverageProjectAct.triggered[()].connect(self.__coverageProject)
+        self.coverageProjectAct.triggered.connect(self.__coverageProject)
         self.actions.append(self.coverageProjectAct)
 
         self.profileAct = E5Action(
-            self.trUtf8('Profile Script'),
+            self.tr('Profile Script'),
             UI.PixmapCache.getIcon("profileScript.png"),
-            self.trUtf8('Profile Script...'), 0, 0, self, 'dbg_profile_script')
-        self.profileAct.setStatusTip(self.trUtf8('Profile the current Script'))
-        self.profileAct.setWhatsThis(self.trUtf8(
+            self.tr('Profile Script...'), 0, 0, self, 'dbg_profile_script')
+        self.profileAct.setStatusTip(self.tr('Profile the current Script'))
+        self.profileAct.setWhatsThis(self.tr(
             """<b>Profile Script</b>"""
             """<p>Set the command line arguments and profile the script."""
             """ If the file has unsaved changes it may be saved first.</p>"""
         ))
-        self.profileAct.triggered[()].connect(self.__profileScript)
+        self.profileAct.triggered.connect(self.__profileScript)
         self.actions.append(self.profileAct)
 
         self.profileProjectAct = E5Action(
-            self.trUtf8('Profile Project'),
+            self.tr('Profile Project'),
             UI.PixmapCache.getIcon("profileProject.png"),
-            self.trUtf8('Profile Project...'), 0, 0, self,
+            self.tr('Profile Project...'), 0, 0, self,
             'dbg_profile_project')
         self.profileProjectAct.setStatusTip(
-            self.trUtf8('Profile the current Project'))
-        self.profileProjectAct.setWhatsThis(self.trUtf8(
+            self.tr('Profile the current Project'))
+        self.profileProjectAct.setWhatsThis(self.tr(
             """<b>Profile Project</b>"""
             """<p>Set the command line arguments and profile the current"""
             """ project. If files of the current project have unsaved"""
             """ changes they may be saved first.</p>"""
         ))
-        self.profileProjectAct.triggered[()].connect(self.__profileProject)
+        self.profileProjectAct.triggered.connect(self.__profileProject)
         self.actions.append(self.profileProjectAct)
 
         self.debugAct = E5Action(
-            self.trUtf8('Debug Script'),
+            self.tr('Debug Script'),
             UI.PixmapCache.getIcon("debugScript.png"),
-            self.trUtf8('&Debug Script...'), Qt.Key_F5, 0, self,
+            self.tr('&Debug Script...'), Qt.Key_F5, 0, self,
             'dbg_debug_script')
-        self.debugAct.setStatusTip(self.trUtf8('Debug the current Script'))
-        self.debugAct.setWhatsThis(self.trUtf8(
+        self.debugAct.setStatusTip(self.tr('Debug the current Script'))
+        self.debugAct.setWhatsThis(self.tr(
             """<b>Debug Script</b>"""
             """<p>Set the command line arguments and set the current line"""
             """ to be the first executable Python statement of the current"""
             """ editor window. If the file has unsaved changes it may be"""
             """ saved first.</p>"""
         ))
-        self.debugAct.triggered[()].connect(self.__debugScript)
+        self.debugAct.triggered.connect(self.__debugScript)
         self.actions.append(self.debugAct)
 
         self.debugProjectAct = E5Action(
-            self.trUtf8('Debug Project'),
+            self.tr('Debug Project'),
             UI.PixmapCache.getIcon("debugProject.png"),
-            self.trUtf8('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self,
+            self.tr('Debug &Project...'), Qt.SHIFT + Qt.Key_F5, 0, self,
             'dbg_debug_project')
-        self.debugProjectAct.setStatusTip(self.trUtf8(
+        self.debugProjectAct.setStatusTip(self.tr(
             'Debug the current Project'))
-        self.debugProjectAct.setWhatsThis(self.trUtf8(
+        self.debugProjectAct.setWhatsThis(self.tr(
             """<b>Debug Project</b>"""
             """<p>Set the command line arguments and set the current line"""
             """ to be the first executable Python statement of the main"""
             """ script of the current project. If files of the current"""
             """ project have unsaved changes they may be saved first.</p>"""
         ))
-        self.debugProjectAct.triggered[()].connect(self.__debugProject)
+        self.debugProjectAct.triggered.connect(self.__debugProject)
         self.actions.append(self.debugProjectAct)
 
         self.restartAct = E5Action(
-            self.trUtf8('Restart'),
+            self.tr('Restart'),
             UI.PixmapCache.getIcon("restart.png"),
-            self.trUtf8('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script')
-        self.restartAct.setStatusTip(self.trUtf8(
+            self.tr('Restart'), Qt.Key_F4, 0, self, 'dbg_restart_script')
+        self.restartAct.setStatusTip(self.tr(
             'Restart the last debugged script'))
-        self.restartAct.setWhatsThis(self.trUtf8(
+        self.restartAct.setWhatsThis(self.tr(
             """<b>Restart</b>"""
             """<p>Set the command line arguments and set the current line"""
             """ to be the first executable Python statement of the script"""
             """ that was debugged last. If there are unsaved changes, they"""
             """ may be saved first.</p>"""
         ))
-        self.restartAct.triggered[()].connect(self.__doRestart)
+        self.restartAct.triggered.connect(self.__doRestart)
         self.actions.append(self.restartAct)
 
         self.stopAct = E5Action(
-            self.trUtf8('Stop'),
+            self.tr('Stop'),
             UI.PixmapCache.getIcon("stopScript.png"),
-            self.trUtf8('Stop'), Qt.SHIFT + Qt.Key_F10, 0,
+            self.tr('Stop'), Qt.SHIFT + Qt.Key_F10, 0,
             self, 'dbg_stop_script')
-        self.stopAct.setStatusTip(self.trUtf8("""Stop the running script."""))
-        self.stopAct.setWhatsThis(self.trUtf8(
+        self.stopAct.setStatusTip(self.tr("""Stop the running script."""))
+        self.stopAct.setWhatsThis(self.tr(
             """<b>Stop</b>"""
             """<p>This stops the script running in the debugger backend.</p>"""
         ))
-        self.stopAct.triggered[()].connect(self.__stopScript)
+        self.stopAct.triggered.connect(self.__stopScript)
         self.actions.append(self.stopAct)
 
         self.debugActGrp = createActionGroup(self)
 
         act = E5Action(
-            self.trUtf8('Continue'),
+            self.tr('Continue'),
             UI.PixmapCache.getIcon("continue.png"),
-            self.trUtf8('&Continue'), Qt.Key_F6, 0,
+            self.tr('&Continue'), Qt.Key_F6, 0,
             self.debugActGrp, 'dbg_continue')
         act.setStatusTip(
-            self.trUtf8('Continue running the program from the current line'))
-        act.setWhatsThis(self.trUtf8(
+            self.tr('Continue running the program from the current line'))
+        act.setWhatsThis(self.tr(
             """<b>Continue</b>"""
             """<p>Continue running the program from the current line. The"""
             """ program will stop when it terminates or when a breakpoint"""
             """ is reached.</p>"""
         ))
-        act.triggered[()].connect(self.__continue)
+        act.triggered.connect(self.__continue)
         self.actions.append(act)
 
         act = E5Action(
-            self.trUtf8('Continue to Cursor'),
+            self.tr('Continue to Cursor'),
             UI.PixmapCache.getIcon("continueToCursor.png"),
-            self.trUtf8('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0,
+            self.tr('Continue &To Cursor'), Qt.SHIFT + Qt.Key_F6, 0,
             self.debugActGrp, 'dbg_continue_to_cursor')
-        act.setStatusTip(self.trUtf8(
+        act.setStatusTip(self.tr(
             """Continue running the program from the"""
             """ current line to the current cursor position"""))
-        act.setWhatsThis(self.trUtf8(
+        act.setWhatsThis(self.tr(
             """<b>Continue To Cursor</b>"""
             """<p>Continue running the program from the current line to the"""
             """ current cursor position.</p>"""
         ))
-        act.triggered[()].connect(self.__runToCursor)
+        act.triggered.connect(self.__runToCursor)
         self.actions.append(act)
 
         act = E5Action(
-            self.trUtf8('Single Step'),
+            self.tr('Single Step'),
             UI.PixmapCache.getIcon("step.png"),
-            self.trUtf8('Sin&gle Step'), Qt.Key_F7, 0,
+            self.tr('Sin&gle Step'), Qt.Key_F7, 0,
             self.debugActGrp, 'dbg_single_step')
-        act.setStatusTip(self.trUtf8('Execute a single Python statement'))
-        act.setWhatsThis(self.trUtf8(
+        act.setStatusTip(self.tr('Execute a single Python statement'))
+        act.setWhatsThis(self.tr(
             """<b>Single Step</b>"""
             """<p>Execute a single Python statement. If the statement"""
             """ is an <tt>import</tt> statement, a class constructor, or a"""
             """ method or function call then control is returned to the"""
             """ debugger at the next statement.</p>"""
         ))
-        act.triggered[()].connect(self.__step)
+        act.triggered.connect(self.__step)
         self.actions.append(act)
 
         act = E5Action(
-            self.trUtf8('Step Over'),
+            self.tr('Step Over'),
             UI.PixmapCache.getIcon("stepOver.png"),
-            self.trUtf8('Step &Over'), Qt.Key_F8, 0,
+            self.tr('Step &Over'), Qt.Key_F8, 0,
             self.debugActGrp, 'dbg_step_over')
-        act.setStatusTip(self.trUtf8(
+        act.setStatusTip(self.tr(
             """Execute a single Python statement staying"""
             """ in the current frame"""))
-        act.setWhatsThis(self.trUtf8(
+        act.setWhatsThis(self.tr(
             """<b>Step Over</b>"""
             """<p>Execute a single Python statement staying in the same"""
             """ frame. If the statement is an <tt>import</tt> statement,"""
@@ -391,18 +391,18 @@
             """ control is returned to the debugger after the statement"""
             """ has completed.</p>"""
         ))
-        act.triggered[()].connect(self.__stepOver)
+        act.triggered.connect(self.__stepOver)
         self.actions.append(act)
 
         act = E5Action(
-            self.trUtf8('Step Out'),
+            self.tr('Step Out'),
             UI.PixmapCache.getIcon("stepOut.png"),
-            self.trUtf8('Step Ou&t'), Qt.Key_F9, 0,
+            self.tr('Step Ou&t'), Qt.Key_F9, 0,
             self.debugActGrp, 'dbg_step_out')
-        act.setStatusTip(self.trUtf8(
+        act.setStatusTip(self.tr(
             """Execute Python statements until leaving"""
             """ the current frame"""))
-        act.setWhatsThis(self.trUtf8(
+        act.setWhatsThis(self.tr(
             """<b>Step Out</b>"""
             """<p>Execute Python statements until leaving the current"""
             """ frame. If the statements are inside an <tt>import</tt>"""
@@ -410,176 +410,176 @@
             """ call then control is returned to the debugger after the"""
             """ current frame has been left.</p>"""
         ))
-        act.triggered[()].connect(self.__stepOut)
+        act.triggered.connect(self.__stepOut)
         self.actions.append(act)
 
         act = E5Action(
-            self.trUtf8('Stop'),
+            self.tr('Stop'),
             UI.PixmapCache.getIcon("stepQuit.png"),
-            self.trUtf8('&Stop'), Qt.Key_F10, 0,
+            self.tr('&Stop'), Qt.Key_F10, 0,
             self.debugActGrp, 'dbg_stop')
-        act.setStatusTip(self.trUtf8('Stop debugging'))
-        act.setWhatsThis(self.trUtf8(
+        act.setStatusTip(self.tr('Stop debugging'))
+        act.setWhatsThis(self.tr(
             """<b>Stop</b>"""
             """<p>Stop the running debugging session.</p>"""
         ))
-        act.triggered[()].connect(self.__stepQuit)
+        act.triggered.connect(self.__stepQuit)
         self.actions.append(act)
         
         self.debugActGrp2 = createActionGroup(self)
 
         act = E5Action(
-            self.trUtf8('Evaluate'),
-            self.trUtf8('E&valuate...'),
+            self.tr('Evaluate'),
+            self.tr('E&valuate...'),
             0, 0, self.debugActGrp2, 'dbg_evaluate')
-        act.setStatusTip(self.trUtf8('Evaluate in current context'))
-        act.setWhatsThis(self.trUtf8(
+        act.setStatusTip(self.tr('Evaluate in current context'))
+        act.setWhatsThis(self.tr(
             """<b>Evaluate</b>"""
             """<p>Evaluate an expression in the current context of the"""
             """ debugged program. The result is displayed in the"""
             """ shell window.</p>"""
         ))
-        act.triggered[()].connect(self.__eval)
+        act.triggered.connect(self.__eval)
         self.actions.append(act)
         
         act = E5Action(
-            self.trUtf8('Execute'),
-            self.trUtf8('E&xecute...'),
+            self.tr('Execute'),
+            self.tr('E&xecute...'),
             0, 0, self.debugActGrp2, 'dbg_execute')
         act.setStatusTip(
-            self.trUtf8('Execute a one line statement in the current context'))
-        act.setWhatsThis(self.trUtf8(
+            self.tr('Execute a one line statement in the current context'))
+        act.setWhatsThis(self.tr(
             """<b>Execute</b>"""
             """<p>Execute a one line statement in the current context"""
             """ of the debugged program.</p>"""
         ))
-        act.triggered[()].connect(self.__exec)
+        act.triggered.connect(self.__exec)
         self.actions.append(act)
         
         self.dbgFilterAct = E5Action(
-            self.trUtf8('Variables Type Filter'),
-            self.trUtf8('Varia&bles Type Filter...'), 0, 0, self,
+            self.tr('Variables Type Filter'),
+            self.tr('Varia&bles Type Filter...'), 0, 0, self,
             'dbg_variables_filter')
-        self.dbgFilterAct.setStatusTip(self.trUtf8(
+        self.dbgFilterAct.setStatusTip(self.tr(
             'Configure variables type filter'))
-        self.dbgFilterAct.setWhatsThis(self.trUtf8(
+        self.dbgFilterAct.setWhatsThis(self.tr(
             """<b>Variables Type Filter</b>"""
             """<p>Configure the variables type filter. Only variable types"""
             """ that are not selected are displayed in the global or local"""
             """ variables window during a debugging session.</p>"""
         ))
-        self.dbgFilterAct.triggered[()].connect(
+        self.dbgFilterAct.triggered.connect(
             self.__configureVariablesFilters)
         self.actions.append(self.dbgFilterAct)
 
         self.excFilterAct = E5Action(
-            self.trUtf8('Exceptions Filter'),
-            self.trUtf8('&Exceptions Filter...'), 0, 0, self,
+            self.tr('Exceptions Filter'),
+            self.tr('&Exceptions Filter...'), 0, 0, self,
             'dbg_exceptions_filter')
-        self.excFilterAct.setStatusTip(self.trUtf8(
+        self.excFilterAct.setStatusTip(self.tr(
             'Configure exceptions filter'))
-        self.excFilterAct.setWhatsThis(self.trUtf8(
+        self.excFilterAct.setWhatsThis(self.tr(
             """<b>Exceptions Filter</b>"""
             """<p>Configure the exceptions filter. Only exception types"""
             """ that are listed are highlighted during a debugging"""
             """ session.</p><p>Please note, that all unhandled exceptions"""
             """ are highlighted indepent from the filter list.</p>"""
         ))
-        self.excFilterAct.triggered[()].connect(
+        self.excFilterAct.triggered.connect(
             self.__configureExceptionsFilter)
         self.actions.append(self.excFilterAct)
         
         self.excIgnoreFilterAct = E5Action(
-            self.trUtf8('Ignored Exceptions'),
-            self.trUtf8('&Ignored Exceptions...'), 0, 0,
+            self.tr('Ignored Exceptions'),
+            self.tr('&Ignored Exceptions...'), 0, 0,
             self, 'dbg_ignored_exceptions')
-        self.excIgnoreFilterAct.setStatusTip(self.trUtf8(
+        self.excIgnoreFilterAct.setStatusTip(self.tr(
             'Configure ignored exceptions'))
-        self.excIgnoreFilterAct.setWhatsThis(self.trUtf8(
+        self.excIgnoreFilterAct.setWhatsThis(self.tr(
             """<b>Ignored Exceptions</b>"""
             """<p>Configure the ignored exceptions. Only exception types"""
             """ that are not listed are highlighted during a debugging"""
             """ session.</p><p>Please note, that unhandled exceptions"""
             """ cannot be ignored.</p>"""
         ))
-        self.excIgnoreFilterAct.triggered[()].connect(
+        self.excIgnoreFilterAct.triggered.connect(
             self.__configureIgnoredExceptions)
         self.actions.append(self.excIgnoreFilterAct)
 
         self.dbgSetBpActGrp = createActionGroup(self)
 
         self.dbgToggleBpAct = E5Action(
-            self.trUtf8('Toggle Breakpoint'),
+            self.tr('Toggle Breakpoint'),
             UI.PixmapCache.getIcon("breakpointToggle.png"),
-            self.trUtf8('Toggle Breakpoint'),
-            QKeySequence(self.trUtf8("Shift+F11", "Debug|Toggle Breakpoint")),
+            self.tr('Toggle Breakpoint'),
+            QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")),
             0, self.dbgSetBpActGrp, 'dbg_toggle_breakpoint')
-        self.dbgToggleBpAct.setStatusTip(self.trUtf8('Toggle Breakpoint'))
-        self.dbgToggleBpAct.setWhatsThis(self.trUtf8(
+        self.dbgToggleBpAct.setStatusTip(self.tr('Toggle Breakpoint'))
+        self.dbgToggleBpAct.setWhatsThis(self.tr(
             """<b>Toggle Breakpoint</b>"""
             """<p>Toggles a breakpoint at the current line of the"""
             """ current editor.</p>"""
         ))
-        self.dbgToggleBpAct.triggered[()].connect(self.__toggleBreakpoint)
+        self.dbgToggleBpAct.triggered.connect(self.__toggleBreakpoint)
         self.actions.append(self.dbgToggleBpAct)
         
         self.dbgEditBpAct = E5Action(
-            self.trUtf8('Edit Breakpoint'),
+            self.tr('Edit Breakpoint'),
             UI.PixmapCache.getIcon("cBreakpointToggle.png"),
-            self.trUtf8('Edit Breakpoint...'),
-            QKeySequence(self.trUtf8("Shift+F12", "Debug|Edit Breakpoint")), 0,
+            self.tr('Edit Breakpoint...'),
+            QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")), 0,
             self.dbgSetBpActGrp, 'dbg_edit_breakpoint')
-        self.dbgEditBpAct.setStatusTip(self.trUtf8('Edit Breakpoint'))
-        self.dbgEditBpAct.setWhatsThis(self.trUtf8(
+        self.dbgEditBpAct.setStatusTip(self.tr('Edit Breakpoint'))
+        self.dbgEditBpAct.setWhatsThis(self.tr(
             """<b>Edit Breakpoint</b>"""
             """<p>Opens a dialog to edit the breakpoints properties."""
             """ It works at the current line of the current editor.</p>"""
         ))
-        self.dbgEditBpAct.triggered[()].connect(self.__editBreakpoint)
+        self.dbgEditBpAct.triggered.connect(self.__editBreakpoint)
         self.actions.append(self.dbgEditBpAct)
 
         self.dbgNextBpAct = E5Action(
-            self.trUtf8('Next Breakpoint'),
+            self.tr('Next Breakpoint'),
             UI.PixmapCache.getIcon("breakpointNext.png"),
-            self.trUtf8('Next Breakpoint'),
+            self.tr('Next Breakpoint'),
             QKeySequence(
-                self.trUtf8("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0,
+                self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0,
             self.dbgSetBpActGrp, 'dbg_next_breakpoint')
-        self.dbgNextBpAct.setStatusTip(self.trUtf8('Next Breakpoint'))
-        self.dbgNextBpAct.setWhatsThis(self.trUtf8(
+        self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint'))
+        self.dbgNextBpAct.setWhatsThis(self.tr(
             """<b>Next Breakpoint</b>"""
             """<p>Go to next breakpoint of the current editor.</p>"""
         ))
-        self.dbgNextBpAct.triggered[()].connect(self.__nextBreakpoint)
+        self.dbgNextBpAct.triggered.connect(self.__nextBreakpoint)
         self.actions.append(self.dbgNextBpAct)
 
         self.dbgPrevBpAct = E5Action(
-            self.trUtf8('Previous Breakpoint'),
+            self.tr('Previous Breakpoint'),
             UI.PixmapCache.getIcon("breakpointPrevious.png"),
-            self.trUtf8('Previous Breakpoint'),
+            self.tr('Previous Breakpoint'),
             QKeySequence(
-                self.trUtf8("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")),
+                self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")),
             0, self.dbgSetBpActGrp, 'dbg_previous_breakpoint')
-        self.dbgPrevBpAct.setStatusTip(self.trUtf8('Previous Breakpoint'))
-        self.dbgPrevBpAct.setWhatsThis(self.trUtf8(
+        self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint'))
+        self.dbgPrevBpAct.setWhatsThis(self.tr(
             """<b>Previous Breakpoint</b>"""
             """<p>Go to previous breakpoint of the current editor.</p>"""
         ))
-        self.dbgPrevBpAct.triggered[()].connect(self.__previousBreakpoint)
+        self.dbgPrevBpAct.triggered.connect(self.__previousBreakpoint)
         self.actions.append(self.dbgPrevBpAct)
 
         act = E5Action(
-            self.trUtf8('Clear Breakpoints'),
-            self.trUtf8('Clear Breakpoints'),
+            self.tr('Clear Breakpoints'),
+            self.tr('Clear Breakpoints'),
             QKeySequence(
-                self.trUtf8("Ctrl+Shift+C", "Debug|Clear Breakpoints")), 0,
+                self.tr("Ctrl+Shift+C", "Debug|Clear Breakpoints")), 0,
             self.dbgSetBpActGrp, 'dbg_clear_breakpoint')
-        act.setStatusTip(self.trUtf8('Clear Breakpoints'))
-        act.setWhatsThis(self.trUtf8(
+        act.setStatusTip(self.tr('Clear Breakpoints'))
+        act.setWhatsThis(self.tr(
             """<b>Clear Breakpoints</b>"""
             """<p>Clear breakpoints of all editors.</p>"""
         ))
-        act.triggered[()].connect(self.__clearBreakpoints)
+        act.triggered.connect(self.__clearBreakpoints)
         self.actions.append(act)
 
         self.debugActGrp.setEnabled(False)
@@ -602,11 +602,11 @@
         
         @return the generated menu
         """
-        dmenu = QMenu(self.trUtf8('&Debug'), self.parent())
+        dmenu = QMenu(self.tr('&Debug'), self.parent())
         dmenu.setTearOffEnabled(True)
-        smenu = QMenu(self.trUtf8('&Start'), self.parent())
+        smenu = QMenu(self.tr('&Start'), self.parent())
         smenu.setTearOffEnabled(True)
-        self.breakpointsMenu = QMenu(self.trUtf8('&Breakpoints'), dmenu)
+        self.breakpointsMenu = QMenu(self.tr('&Breakpoints'), dmenu)
         
         smenu.addAction(self.restartAct)
         smenu.addAction(self.stopAct)
@@ -648,10 +648,10 @@
             (E5ToolBarManager)
         @return the generated toolbars (list of QToolBar)
         """
-        starttb = QToolBar(self.trUtf8("Start"), self.ui)
+        starttb = QToolBar(self.tr("Start"), self.ui)
         starttb.setIconSize(UI.Config.ToolBarIconSize)
         starttb.setObjectName("StartToolbar")
-        starttb.setToolTip(self.trUtf8('Start'))
+        starttb.setToolTip(self.tr('Start'))
         
         starttb.addAction(self.restartAct)
         starttb.addAction(self.stopAct)
@@ -662,10 +662,10 @@
         starttb.addAction(self.debugAct)
         starttb.addAction(self.debugProjectAct)
         
-        debugtb = QToolBar(self.trUtf8("Debug"), self.ui)
+        debugtb = QToolBar(self.tr("Debug"), self.ui)
         debugtb.setIconSize(UI.Config.ToolBarIconSize)
         debugtb.setObjectName("DebugToolbar")
-        debugtb.setToolTip(self.trUtf8('Debug'))
+        debugtb.setToolTip(self.tr('Debug'))
         
         debugtb.addActions(self.debugActGrp.actions())
         debugtb.addSeparator()
@@ -833,7 +833,7 @@
                     break
             else:
                 if editor.isPy2File():
-                    cap = self.debugServer.getClientCapabilities('Python')
+                    cap = self.debugServer.getClientCapabilities('Python2')
                 elif editor.isPy3File():
                     cap = self.debugServer.getClientCapabilities('Python3')
                 elif editor.isRubyFile():
@@ -871,7 +871,7 @@
         if editor is None:
             return
         
-        if editor.getPyVersion() or editor.isRubyFile():
+        if editor.isPyFile() or editor.isRubyFile():
             if editor.curLineHasBreakpoint():
                 self.dbgEditBpAct.setEnabled(True)
             else:
@@ -1012,37 +1012,37 @@
             if self.ui.currentProg is None:
                 E5MessageBox.information(
                     self.ui, Program,
-                    self.trUtf8('<p>The program has terminated with an exit'
-                                ' status of {0}.</p>').format(status))
+                    self.tr('<p>The program has terminated with an exit'
+                            ' status of {0}.</p>').format(status))
             else:
                 E5MessageBox.information(
                     self.ui, Program,
-                    self.trUtf8('<p><b>{0}</b> has terminated with an exit'
-                                ' status of {1}.</p>')
+                    self.tr('<p><b>{0}</b> has terminated with an exit'
+                            ' status of {1}.</p>')
                         .format(Utilities.normabspath(self.ui.currentProg),
                                 status))
         else:
             if self.ui.notificationsEnabled():
                 if self.ui.currentProg is None:
-                    msg = self.trUtf8('The program has terminated with an exit'
-                                      ' status of {0}.').format(status)
+                    msg = self.tr('The program has terminated with an exit'
+                                  ' status of {0}.').format(status)
                 else:
-                    msg = self.trUtf8('"{0}" has terminated with an exit'
-                                      ' status of {1}.')\
+                    msg = self.tr('"{0}" has terminated with an exit'
+                                  ' status of {1}.')\
                         .format(os.path.basename(self.ui.currentProg),
                                 status)
                 self.ui.showNotification(
                     UI.PixmapCache.getPixmap("debug48.png"),
-                    self.trUtf8("Program terminated"), msg)
+                    self.tr("Program terminated"), msg)
             else:
                 if self.ui.currentProg is None:
                     self.appendStdout.emit(
-                        self.trUtf8('The program has terminated with an exit'
-                                    ' status of {0}.\n').format(status))
+                        self.tr('The program has terminated with an exit'
+                                ' status of {0}.\n').format(status))
                 else:
                     self.appendStdout.emit(
-                        self.trUtf8('"{0}" has terminated with an exit'
-                                    ' status of {1}.\n')
+                        self.tr('"{0}" has terminated with an exit'
+                                ' status of {1}.\n')
                             .format(Utilities.normabspath(self.ui.currentProg),
                                     status))
 
@@ -1064,7 +1064,7 @@
         if message is None:
             E5MessageBox.critical(
                 self.ui, Program,
-                self.trUtf8(
+                self.tr(
                     'The program being debugged contains an unspecified'
                     ' syntax error.'))
             return
@@ -1082,9 +1082,9 @@
         self.viewmanager.setFileLine(filename, lineNo, True, True)
         E5MessageBox.critical(
             self.ui, Program,
-            self.trUtf8('<p>The file <b>{0}</b> contains the syntax error'
-                        ' <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>.'
-                        '</p>')
+            self.tr('<p>The file <b>{0}</b> contains the syntax error'
+                    ' <b>{1}</b> at line <b>{2}</b>, character <b>{3}</b>.'
+                    '</p>')
                 .format(filename, message, lineNo, characterNo))
         
     def __clientException(self, exceptionType, exceptionMessage, stackTrace):
@@ -1101,8 +1101,8 @@
         if exceptionType is None:
             E5MessageBox.critical(
                 self.ui, Program,
-                self.trUtf8('An unhandled exception occured.'
-                            ' See the shell window for details.'))
+                self.tr('An unhandled exception occured.'
+                        ' See the shell window for details.'))
             return
         
         if (self.exceptions and
@@ -1141,7 +1141,7 @@
                                 E5MessageBox.Ignore)
                         res = E5MessageBox.critical(
                             self.ui, Program,
-                            self.trUtf8(
+                            self.tr(
                                 '<p>The debugged program raised the exception'
                                 ' <b>{0}</b><br>"<b>{1}</b>"<br>'
                                 'File: <b>{2}</b>, Line: <b>{3}</b></p>'
@@ -1156,7 +1156,7 @@
                     else:
                         res = E5MessageBox.critical(
                             self.ui, Program,
-                            self.trUtf8(
+                            self.tr(
                                 '<p>The debugged program raised the exception'
                                 ' <b>{0}</b><br>"<b>{1}</b>"</p>')
                             .format(
@@ -1193,8 +1193,8 @@
         if unplanned:
             E5MessageBox.information(
                 self.ui, Program,
-                self.trUtf8('The program being debugged has terminated'
-                            ' unexpectedly.'))
+                self.tr('The program being debugged has terminated'
+                        ' unexpectedly.'))
         
     def __getThreadList(self):
         """
@@ -1266,8 +1266,8 @@
         """
         E5MessageBox.critical(
             self.ui,
-            self.trUtf8("Breakpoint Condition Error"),
-            self.trUtf8(
+            self.tr("Breakpoint Condition Error"),
+            self.tr(
                 """<p>The condition of the breakpoint <b>{0}, {1}</b>"""
                 """ contains a syntax error.</p>""")
             .format(filename, lineno))
@@ -1302,9 +1302,9 @@
         """
         E5MessageBox.critical(
             self.ui,
-            self.trUtf8("Watch Expression Error"),
-            self.trUtf8("""<p>The watch expression <b>{0}</b>"""
-                        """ contains a syntax error.</p>""")
+            self.tr("Watch Expression Error"),
+            self.tr("""<p>The watch expression <b>{0}</b>"""
+                    """ contains a syntax error.</p>""")
             .format(cond))
         
         model = self.debugServer.getWatchPointModel()
@@ -1330,11 +1330,11 @@
                 idx.internalPointer() != index.internalPointer()
             if duplicate:
                 if not special:
-                    msg = self.trUtf8("""<p>A watch expression '<b>{0}</b>'"""
-                                      """ already exists.</p>""")\
+                    msg = self.tr("""<p>A watch expression '<b>{0}</b>'"""
+                                  """ already exists.</p>""")\
                         .format(Utilities.html_encode(cond))
                 else:
-                    msg = self.trUtf8(
+                    msg = self.tr(
                         """<p>A watch expression '<b>{0}</b>'"""
                         """ for the variable <b>{1}</b> already"""
                         """ exists.</p>""")\
@@ -1342,7 +1342,7 @@
                                 Utilities.html_encode(cond))
                 E5MessageBox.warning(
                     self.ui,
-                    self.trUtf8("Watch expression already exists"),
+                    self.tr("Watch expression already exists"),
                     msg)
                 model.deleteWatchPointByIndex(index)
             else:
@@ -1489,9 +1489,9 @@
         # Get the command line arguments, the working directory and the
         # exception reporting flag.
         if runProject:
-            cap = self.trUtf8("Coverage of Project")
+            cap = self.tr("Coverage of Project")
         else:
-            cap = self.trUtf8("Coverage of Script")
+            cap = self.tr("Coverage of Script")
         dlg = StartDialog(
             cap, self.argvHistory, self.wdHistory,
             self.envHistory, self.exceptions, self.ui, 2,
@@ -1506,8 +1506,8 @@
                 if fn is None:
                     E5MessageBox.critical(
                         self.ui,
-                        self.trUtf8("Coverage of Project"),
-                        self.trUtf8(
+                        self.tr("Coverage of Project"),
+                        self.tr(
                             "There is no main script defined for the"
                             " current project. Aborting"))
                     return
@@ -1607,9 +1607,9 @@
         # Get the command line arguments, the working directory and the
         # exception reporting flag.
         if runProject:
-            cap = self.trUtf8("Profile of Project")
+            cap = self.tr("Profile of Project")
         else:
-            cap = self.trUtf8("Profile of Script")
+            cap = self.tr("Profile of Script")
         dlg = StartDialog(
             cap, self.argvHistory, self.wdHistory, self.envHistory,
             self.exceptions, self.ui, 3,
@@ -1624,8 +1624,8 @@
                 if fn is None:
                     E5MessageBox.critical(
                         self.ui,
-                        self.trUtf8("Profile of Project"),
-                        self.trUtf8(
+                        self.tr("Profile of Project"),
+                        self.tr(
                             "There is no main script defined for the"
                             " current project. Aborting"))
                     return
@@ -1725,9 +1725,9 @@
         # Get the command line arguments, the working directory and the
         # exception reporting flag.
         if runProject:
-            cap = self.trUtf8("Run Project")
+            cap = self.tr("Run Project")
         else:
-            cap = self.trUtf8("Run Script")
+            cap = self.tr("Run Script")
         dlg = StartDialog(
             cap, self.argvHistory, self.wdHistory, self.envHistory,
             self.exceptions, self.ui, 1,
@@ -1744,8 +1744,8 @@
                 if fn is None:
                     E5MessageBox.critical(
                         self.ui,
-                        self.trUtf8("Run Project"),
-                        self.trUtf8(
+                        self.tr("Run Project"),
+                        self.tr(
                             "There is no main script defined for the"
                             " current project. Aborting"))
                     return
@@ -1846,9 +1846,9 @@
         # Get the command line arguments, the working directory and the
         # exception reporting flag.
         if debugProject:
-            cap = self.trUtf8("Debug Project")
+            cap = self.tr("Debug Project")
         else:
-            cap = self.trUtf8("Debug Script")
+            cap = self.tr("Debug Script")
         dlg = StartDialog(
             cap, self.argvHistory, self.wdHistory, self.envHistory,
             self.exceptions, self.ui, 0, tracePython=self.tracePython,
@@ -1865,8 +1865,8 @@
                 if fn is None:
                     E5MessageBox.critical(
                         self.ui,
-                        self.trUtf8("Debug Project"),
-                        self.trUtf8(
+                        self.tr("Debug Project"),
+                        self.tr(
                             "There is no main script defined for the"
                             " current project. No debugging possible."))
                     return
@@ -2156,8 +2156,8 @@
 
         arg, ok = QInputDialog.getItem(
             self.ui,
-            self.trUtf8("Evaluate"),
-            self.trUtf8("Enter the statement to evaluate"),
+            self.tr("Evaluate"),
+            self.tr("Enter the statement to evaluate"),
             self.evalHistory,
             curr, True)
 
@@ -2185,8 +2185,8 @@
 
         stmt, ok = QInputDialog.getItem(
             self.ui,
-            self.trUtf8("Execute"),
-            self.trUtf8("Enter the statement to execute"),
+            self.tr("Execute"),
+            self.tr("Enter the statement to execute"),
             self.execHistory,
             curr, True)
 

eric ide

mercurial