RefactoringRope/Refactoring.py

branch
eric5
changeset 88
e71619898d0f
parent 86
3339c75dc777
--- a/RefactoringRope/Refactoring.py	Sun Jul 06 14:17:24 2014 +0200
+++ b/RefactoringRope/Refactoring.py	Sun Jul 06 14:27:51 2014 +0200
@@ -24,9 +24,9 @@
 import rope.base.libutils
 import rope.base.exceptions
 
-from PyQt5.QtCore import QObject
-from PyQt5.QtWidgets import QMenu, QApplication, QDialog, QAction
-from PyQt5.Qsci import QsciScintilla
+from PyQt4.QtCore import QObject
+from PyQt4.QtGui import QMenu, QApplication, QDialog, QAction
+from PyQt4.Qsci import QsciScintilla
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -75,63 +75,63 @@
         #####################################################
         
         self.refactoringRenameAct = E5Action(
-            self.tr('Rename'),
-            self.tr('&Rename'),
+            self.trUtf8('Rename'),
+            self.trUtf8('&Rename'),
             0, 0,
             self, 'refactoring_rename')
-        self.refactoringRenameAct.setStatusTip(self.tr(
+        self.refactoringRenameAct.setStatusTip(self.trUtf8(
             'Rename the highlighted object'))
-        self.refactoringRenameAct.setWhatsThis(self.tr(
+        self.refactoringRenameAct.setWhatsThis(self.trUtf8(
             """<b>Rename</b>"""
             """<p>Rename the highlighted Python object.</p>"""
         ))
-        self.refactoringRenameAct.triggered.connect(
+        self.refactoringRenameAct.triggered[()].connect(
             self.__rename)
         self.actions.append(self.refactoringRenameAct)
         
         self.refactoringRenameLocalAct = E5Action(
-            self.tr('Local Rename'),
-            self.tr('&Local Rename'),
+            self.trUtf8('Local Rename'),
+            self.trUtf8('&Local Rename'),
             0, 0,
             self, 'refactoring_rename_local')
-        self.refactoringRenameLocalAct.setStatusTip(self.tr(
+        self.refactoringRenameLocalAct.setStatusTip(self.trUtf8(
             'Rename the highlighted object in the current module only'))
-        self.refactoringRenameLocalAct.setWhatsThis(self.tr(
+        self.refactoringRenameLocalAct.setWhatsThis(self.trUtf8(
             """<b>Local Rename</b>"""
             """<p>Rename the highlighted Python object in the current"""
             """ module only.</p>"""
         ))
-        self.refactoringRenameLocalAct.triggered.connect(
+        self.refactoringRenameLocalAct.triggered[()].connect(
             self.__renameLocal)
         self.actions.append(self.refactoringRenameLocalAct)
         
         self.refactoringRenameModuleAct = E5Action(
-            self.tr('Rename Current Module'),
-            self.tr('Rename Current Module'),
+            self.trUtf8('Rename Current Module'),
+            self.trUtf8('Rename Current Module'),
             0, 0,
             self, 'refactoring_rename_module')
-        self.refactoringRenameModuleAct.setStatusTip(self.tr(
+        self.refactoringRenameModuleAct.setStatusTip(self.trUtf8(
             'Rename the current module'))
-        self.refactoringRenameModuleAct.setWhatsThis(self.tr(
+        self.refactoringRenameModuleAct.setWhatsThis(self.trUtf8(
             """<b>Rename Current Module</b>"""
             """<p>Rename the current module.</p>"""
         ))
-        self.refactoringRenameModuleAct.triggered.connect(
+        self.refactoringRenameModuleAct.triggered[()].connect(
             self.__renameModule)
         self.actions.append(self.refactoringRenameModuleAct)
         
         self.refactoringChangeOccurrencesAct = E5Action(
-            self.tr('Change Occurrences'),
-            self.tr('Change &Occurrences'),
+            self.trUtf8('Change Occurrences'),
+            self.trUtf8('Change &Occurrences'),
             0, 0,
             self, 'refactoring_change_occurrences')
-        self.refactoringChangeOccurrencesAct.setStatusTip(self.tr(
+        self.refactoringChangeOccurrencesAct.setStatusTip(self.trUtf8(
             'Change all occurrences in the local scope'))
-        self.refactoringChangeOccurrencesAct.setWhatsThis(self.tr(
+        self.refactoringChangeOccurrencesAct.setWhatsThis(self.trUtf8(
             """<b>Change Occurrences</b>"""
             """<p>Change all occurrences in the local scope.</p>"""
         ))
-        self.refactoringChangeOccurrencesAct.triggered.connect(
+        self.refactoringChangeOccurrencesAct.triggered[()].connect(
             self.__changeOccurrences)
         self.actions.append(self.refactoringChangeOccurrencesAct)
         
@@ -140,32 +140,32 @@
         #####################################################
         
         self.refactoringExtractMethodAct = E5Action(
-            self.tr('Extract method'),
-            self.tr('Extract &Method'),
+            self.trUtf8('Extract method'),
+            self.trUtf8('Extract &Method'),
             0, 0,
             self, 'refactoring_extract_method')
-        self.refactoringExtractMethodAct.setStatusTip(self.tr(
+        self.refactoringExtractMethodAct.setStatusTip(self.trUtf8(
             'Extract the highlighted area as a method'))
-        self.refactoringExtractMethodAct.setWhatsThis(self.tr(
+        self.refactoringExtractMethodAct.setWhatsThis(self.trUtf8(
             """<b>Extract method</b>"""
             """<p>Extract the highlighted area as a method or function.</p>"""
         ))
-        self.refactoringExtractMethodAct.triggered.connect(
+        self.refactoringExtractMethodAct.triggered[()].connect(
             self.__extractMethod)
         self.actions.append(self.refactoringExtractMethodAct)
         
         self.refactoringExtractLocalVariableAct = E5Action(
-            self.tr('Extract local variable'),
-            self.tr('&Extract Local Variable'),
+            self.trUtf8('Extract local variable'),
+            self.trUtf8('&Extract Local Variable'),
             0, 0,
             self, 'refactoring_extract_variable')
-        self.refactoringExtractLocalVariableAct.setStatusTip(self.tr(
+        self.refactoringExtractLocalVariableAct.setStatusTip(self.trUtf8(
             'Extract the highlighted area as a local variable'))
-        self.refactoringExtractLocalVariableAct.setWhatsThis(self.tr(
+        self.refactoringExtractLocalVariableAct.setWhatsThis(self.trUtf8(
             """<b>Extract local variable</b>"""
             """<p>Extract the highlighted area as a local variable.</p>"""
         ))
-        self.refactoringExtractLocalVariableAct.triggered.connect(
+        self.refactoringExtractLocalVariableAct.triggered[()].connect(
             self.__extractLocalVariable)
         self.actions.append(self.refactoringExtractLocalVariableAct)
         
@@ -174,17 +174,17 @@
         #####################################################
         
         self.refactoringInlineAct = E5Action(
-            self.tr('Inline'),
-            self.tr('&Inline'),
+            self.trUtf8('Inline'),
+            self.trUtf8('&Inline'),
             0, 0,
             self, 'refactoring_inline')
-        self.refactoringInlineAct.setStatusTip(self.tr(
+        self.refactoringInlineAct.setStatusTip(self.trUtf8(
             'Inlines the selected local variable or method'))
-        self.refactoringInlineAct.setWhatsThis(self.tr(
+        self.refactoringInlineAct.setWhatsThis(self.trUtf8(
             """<b>Inline</b>"""
             """<p>Inlines the selected local variable or method.</p>"""
         ))
-        self.refactoringInlineAct.triggered.connect(
+        self.refactoringInlineAct.triggered[()].connect(
             self.__inline)
         self.actions.append(self.refactoringInlineAct)
         
@@ -193,32 +193,32 @@
         #####################################################
         
         self.refactoringMoveMethodAct = E5Action(
-            self.tr('Move method'),
-            self.tr('Mo&ve Method'),
+            self.trUtf8('Move method'),
+            self.trUtf8('Mo&ve Method'),
             0, 0,
             self, 'refactoring_move_method')
-        self.refactoringMoveMethodAct.setStatusTip(self.tr(
+        self.refactoringMoveMethodAct.setStatusTip(self.trUtf8(
             'Move the highlighted method to another class'))
-        self.refactoringMoveMethodAct.setWhatsThis(self.tr(
+        self.refactoringMoveMethodAct.setWhatsThis(self.trUtf8(
             """<b>Move method</b>"""
             """<p>Move the highlighted method to another class.</p>"""
         ))
-        self.refactoringMoveMethodAct.triggered.connect(
+        self.refactoringMoveMethodAct.triggered[()].connect(
             self.__moveMethod)
         self.actions.append(self.refactoringMoveMethodAct)
         
         self.refactoringMoveModuleAct = E5Action(
-            self.tr('Move current module'),
-            self.tr('Move Current Module'),
+            self.trUtf8('Move current module'),
+            self.trUtf8('Move Current Module'),
             0, 0,
             self, 'refactoring_move_module')
-        self.refactoringMoveModuleAct.setStatusTip(self.tr(
+        self.refactoringMoveModuleAct.setStatusTip(self.trUtf8(
             'Move the current module to another package'))
-        self.refactoringMoveModuleAct.setWhatsThis(self.tr(
+        self.refactoringMoveModuleAct.setWhatsThis(self.trUtf8(
             """<b>Move current module</b>"""
             """<p>Move the current module to another package.</p>"""
         ))
-        self.refactoringMoveModuleAct.triggered.connect(
+        self.refactoringMoveModuleAct.triggered[()].connect(
             self.__moveModule)
         self.actions.append(self.refactoringMoveModuleAct)
         
@@ -227,17 +227,17 @@
         #####################################################
         
         self.refactoringUseFunctionAct = E5Action(
-            self.tr('Use Function'),
-            self.tr('Use Function'),
+            self.trUtf8('Use Function'),
+            self.trUtf8('Use Function'),
             0, 0,
             self, 'refactoring_use_function')
-        self.refactoringUseFunctionAct.setStatusTip(self.tr(
+        self.refactoringUseFunctionAct.setStatusTip(self.trUtf8(
             'Use a function wherever possible.'))
-        self.refactoringUseFunctionAct.setWhatsThis(self.tr(
+        self.refactoringUseFunctionAct.setWhatsThis(self.trUtf8(
             """<b>Use function</b>"""
             """<p>Tries to use a function wherever possible.</p>"""
         ))
-        self.refactoringUseFunctionAct.triggered.connect(
+        self.refactoringUseFunctionAct.triggered[()].connect(
             self.__useFunction)
         self.actions.append(self.refactoringUseFunctionAct)
         
@@ -246,32 +246,32 @@
         #####################################################
         
         self.refactoringIntroduceFactoryAct = E5Action(
-            self.tr('Introduce Factory Method'),
-            self.tr('Introduce &Factory Method'),
+            self.trUtf8('Introduce Factory Method'),
+            self.trUtf8('Introduce &Factory Method'),
             0, 0,
             self, 'refactoring_introduce_factory_method')
-        self.refactoringIntroduceFactoryAct.setStatusTip(self.tr(
+        self.refactoringIntroduceFactoryAct.setStatusTip(self.trUtf8(
             'Introduce a factory method or function'))
-        self.refactoringIntroduceFactoryAct.setWhatsThis(self.tr(
+        self.refactoringIntroduceFactoryAct.setWhatsThis(self.trUtf8(
             """<b>Introduce Factory Method</b>"""
             """<p>Introduce a factory method or function.</p>"""
         ))
-        self.refactoringIntroduceFactoryAct.triggered.connect(
+        self.refactoringIntroduceFactoryAct.triggered[()].connect(
             self.__introduceFactoryMethod)
         self.actions.append(self.refactoringIntroduceFactoryAct)
         
         self.refactoringIntroduceParameterAct = E5Action(
-            self.tr('Introduce Parameter'),
-            self.tr('Introduce &Parameter'),
+            self.trUtf8('Introduce Parameter'),
+            self.trUtf8('Introduce &Parameter'),
             0, 0,
             self, 'refactoring_introduce_parameter_method')
-        self.refactoringIntroduceParameterAct.setStatusTip(self.tr(
+        self.refactoringIntroduceParameterAct.setStatusTip(self.trUtf8(
             'Introduce a parameter in a function'))
-        self.refactoringIntroduceParameterAct.setWhatsThis(self.tr(
+        self.refactoringIntroduceParameterAct.setWhatsThis(self.trUtf8(
             """<b>Introduce Parameter</b>"""
             """<p>Introduce a parameter in a function.</p>"""
         ))
-        self.refactoringIntroduceParameterAct.triggered.connect(
+        self.refactoringIntroduceParameterAct.triggered[()].connect(
             self.__introduceParameter)
         self.actions.append(self.refactoringIntroduceParameterAct)
         
@@ -280,85 +280,85 @@
         #####################################################
         
         self.refactoringImportsOrganizeAct = E5Action(
-            self.tr('Organize Imports'),
-            self.tr('&Organize Imports'),
+            self.trUtf8('Organize Imports'),
+            self.trUtf8('&Organize Imports'),
             0, 0,
             self, 'refactoring_organize_imports')
-        self.refactoringImportsOrganizeAct.setStatusTip(self.tr(
+        self.refactoringImportsOrganizeAct.setStatusTip(self.trUtf8(
             'Sort imports according to PEP-8'))
-        self.refactoringImportsOrganizeAct.setWhatsThis(self.tr(
+        self.refactoringImportsOrganizeAct.setWhatsThis(self.trUtf8(
             """<b>Organize Imports</b>"""
             """<p>Sort imports according to PEP-8.</p>"""
         ))
-        self.refactoringImportsOrganizeAct.triggered.connect(
+        self.refactoringImportsOrganizeAct.triggered[()].connect(
             self.__importsOrganize)
         self.actions.append(self.refactoringImportsOrganizeAct)
         
         self.refactoringImportsStarExpandAct = E5Action(
-            self.tr('Expand Star Imports'),
-            self.tr('E&xpand Star Imports'),
+            self.trUtf8('Expand Star Imports'),
+            self.trUtf8('E&xpand Star Imports'),
             0, 0,
             self, 'refactoring_expand_star_imports')
-        self.refactoringImportsStarExpandAct.setStatusTip(self.tr(
+        self.refactoringImportsStarExpandAct.setStatusTip(self.trUtf8(
             'Expand imports like "from xxx import *"'))
-        self.refactoringImportsStarExpandAct.setWhatsThis(self.tr(
+        self.refactoringImportsStarExpandAct.setWhatsThis(self.trUtf8(
             """<b>Expand Star Imports</b>"""
             """<p>Expand imports like "from xxx import *".</p>"""
             """<p>Select the import to act on or none to do all."""
             """ Unused imports are deleted.</p>"""
         ))
-        self.refactoringImportsStarExpandAct.triggered.connect(
+        self.refactoringImportsStarExpandAct.triggered[()].connect(
             self.__importsExpandStar)
         self.actions.append(self.refactoringImportsStarExpandAct)
         
         self.refactoringImportsRelativeToAbsoluteAct = E5Action(
-            self.tr('Relative to Absolute'),
-            self.tr('Relative to &Absolute'),
+            self.trUtf8('Relative to Absolute'),
+            self.trUtf8('Relative to &Absolute'),
             0, 0,
             self, 'refactoring_relative_to_absolute_imports')
-        self.refactoringImportsRelativeToAbsoluteAct.setStatusTip(self.tr(
+        self.refactoringImportsRelativeToAbsoluteAct.setStatusTip(self.trUtf8(
             'Transform relative imports to absolute ones'))
-        self.refactoringImportsRelativeToAbsoluteAct.setWhatsThis(self.tr(
+        self.refactoringImportsRelativeToAbsoluteAct.setWhatsThis(self.trUtf8(
             """<b>Relative to Absolute</b>"""
             """<p>Transform relative imports to absolute ones.</p>"""
             """<p>Select the import to act on or none to do all."""
             """ Unused imports are deleted.</p>"""
         ))
-        self.refactoringImportsRelativeToAbsoluteAct.triggered.connect(
+        self.refactoringImportsRelativeToAbsoluteAct.triggered[()].connect(
             self.__importsRelativeToAbsolute)
         self.actions.append(self.refactoringImportsRelativeToAbsoluteAct)
         
         self.refactoringImportsFromsToImportsAct = E5Action(
-            self.tr('Froms to Imports'),
-            self.tr('Froms to &Imports'),
+            self.trUtf8('Froms to Imports'),
+            self.trUtf8('Froms to &Imports'),
             0, 0,
             self, 'refactoring_froms_to_imports')
-        self.refactoringImportsFromsToImportsAct.setStatusTip(self.tr(
+        self.refactoringImportsFromsToImportsAct.setStatusTip(self.trUtf8(
             'Transform From imports to plain imports'))
-        self.refactoringImportsFromsToImportsAct.setWhatsThis(self.tr(
+        self.refactoringImportsFromsToImportsAct.setWhatsThis(self.trUtf8(
             """<b>Froms to Imports</b>"""
             """<p>Transform From imports to plain imports.</p>"""
             """<p>Select the import to act on or none to do all."""
             """ Unused imports are deleted.</p>"""
         ))
-        self.refactoringImportsFromsToImportsAct.triggered.connect(
+        self.refactoringImportsFromsToImportsAct.triggered[()].connect(
             self.__importsFromToImport)
         self.actions.append(self.refactoringImportsFromsToImportsAct)
         
         self.refactoringImportsHandleLongAct = E5Action(
-            self.tr('Handle Long Imports'),
-            self.tr('Handle &Long Imports'),
+            self.trUtf8('Handle Long Imports'),
+            self.trUtf8('Handle &Long Imports'),
             0, 0,
             self, 'refactoring_organize_imports')
-        self.refactoringImportsHandleLongAct.setStatusTip(self.tr(
+        self.refactoringImportsHandleLongAct.setStatusTip(self.trUtf8(
             'Transform long import statements to look better'))
-        self.refactoringImportsHandleLongAct.setWhatsThis(self.tr(
+        self.refactoringImportsHandleLongAct.setWhatsThis(self.trUtf8(
             """<b>Handle Long Imports</b>"""
             """<p>Transform long import statements to look better.</p>"""
             """<p>Select the import to act on or none to do all."""
             """ Unused imports are deleted.</p>"""
         ))
-        self.refactoringImportsHandleLongAct.triggered.connect(
+        self.refactoringImportsHandleLongAct.triggered[()].connect(
             self.__importsHandleLong)
         self.actions.append(self.refactoringImportsHandleLongAct)
         
@@ -367,109 +367,109 @@
         #####################################################
         
         self.refactoringRestructureAct = E5Action(
-            self.tr('Restructure'),
-            self.tr('Res&tructure'),
+            self.trUtf8('Restructure'),
+            self.trUtf8('Res&tructure'),
             0, 0,
             self, 'refactoring_restructure')
-        self.refactoringRestructureAct.setStatusTip(self.tr(
+        self.refactoringRestructureAct.setStatusTip(self.trUtf8(
             'Restructure code'))
-        self.refactoringRestructureAct.setWhatsThis(self.tr(
+        self.refactoringRestructureAct.setWhatsThis(self.trUtf8(
             """<b>Restructure</b>"""
             """<p>Restructure code. See "Rope Help" for examples.</p>"""
         ))
-        self.refactoringRestructureAct.triggered.connect(
+        self.refactoringRestructureAct.triggered[()].connect(
             self.__restructure)
         self.actions.append(self.refactoringRestructureAct)
         
         self.refactoringChangeSignatureAct = E5Action(
-            self.tr('Change Method Signature'),
-            self.tr('&Change Method Signature'),
+            self.trUtf8('Change Method Signature'),
+            self.trUtf8('&Change Method Signature'),
             0, 0,
             self, 'refactoring_change_method_signature')
-        self.refactoringChangeSignatureAct.setStatusTip(self.tr(
+        self.refactoringChangeSignatureAct.setStatusTip(self.trUtf8(
             'Change the signature of the selected method or function'))
-        self.refactoringChangeSignatureAct.setWhatsThis(self.tr(
+        self.refactoringChangeSignatureAct.setWhatsThis(self.trUtf8(
             """<b>Change Method Signature</b>"""
             """<p>Change the signature of the selected method"""
             """ or function.</p>"""
         ))
-        self.refactoringChangeSignatureAct.triggered.connect(
+        self.refactoringChangeSignatureAct.triggered[()].connect(
             self.__changeSignature)
         self.actions.append(self.refactoringChangeSignatureAct)
         
         self.refactoringInlineArgumentDefaultAct = E5Action(
-            self.tr('Inline Argument Default'),
-            self.tr('Inline &Argument Default'),
+            self.trUtf8('Inline Argument Default'),
+            self.trUtf8('Inline &Argument Default'),
             0, 0,
             self, 'refactoring_inline_argument_default')
-        self.refactoringInlineArgumentDefaultAct.setStatusTip(self.tr(
+        self.refactoringInlineArgumentDefaultAct.setStatusTip(self.trUtf8(
             'Inline a parameters default value'))
-        self.refactoringInlineArgumentDefaultAct.setWhatsThis(self.tr(
+        self.refactoringInlineArgumentDefaultAct.setWhatsThis(self.trUtf8(
             """<b>Inline Argument Default</b>"""
             """<p>Inline a parameters default value.</p>"""
         ))
-        self.refactoringInlineArgumentDefaultAct.triggered.connect(
+        self.refactoringInlineArgumentDefaultAct.triggered[()].connect(
             self.__inlineArgumentDefault)
         self.actions.append(self.refactoringInlineArgumentDefaultAct)
         
         self.refactoringTransformModuleAct = E5Action(
-            self.tr('Transform Module to Package'),
-            self.tr('Transform Module to Package'),
+            self.trUtf8('Transform Module to Package'),
+            self.trUtf8('Transform Module to Package'),
             0, 0,
             self, 'refactoring_transform_module_to_package')
-        self.refactoringTransformModuleAct.setStatusTip(self.tr(
+        self.refactoringTransformModuleAct.setStatusTip(self.trUtf8(
             'Transform the current module to a package'))
-        self.refactoringTransformModuleAct.setWhatsThis(self.tr(
+        self.refactoringTransformModuleAct.setWhatsThis(self.trUtf8(
             """<b>Transform Module to Package</b>"""
             """<p>Transform the current module to a package.</p>"""
         ))
-        self.refactoringTransformModuleAct.triggered.connect(
+        self.refactoringTransformModuleAct.triggered[()].connect(
             self.__transformModuleToPackage)
         self.actions.append(self.refactoringTransformModuleAct)
         
         self.refactoringEncapsulateAttributeAct = E5Action(
-            self.tr('Encapsulate Attribute'),
-            self.tr('Encap&sulate Attribute'),
+            self.trUtf8('Encapsulate Attribute'),
+            self.trUtf8('Encap&sulate Attribute'),
             0, 0,
             self, 'refactoring_encapsulate_attribute')
-        self.refactoringEncapsulateAttributeAct.setStatusTip(self.tr(
+        self.refactoringEncapsulateAttributeAct.setStatusTip(self.trUtf8(
             'Generate a getter/setter for an attribute'))
-        self.refactoringEncapsulateAttributeAct.setWhatsThis(self.tr(
+        self.refactoringEncapsulateAttributeAct.setWhatsThis(self.trUtf8(
             """<b>Encapsulate Attribute</b>"""
             """<p>Generate a getter/setter for an attribute and changes"""
             """ its occurrences to use them.</p>"""
         ))
-        self.refactoringEncapsulateAttributeAct.triggered.connect(
+        self.refactoringEncapsulateAttributeAct.triggered[()].connect(
             self.__encapsulateAttribute)
         self.actions.append(self.refactoringEncapsulateAttributeAct)
         
         self.refactoringLocalVariableToAttributeAct = E5Action(
-            self.tr('Local Variable to Attribute'),
-            self.tr('Local Varia&ble to Attribute'),
+            self.trUtf8('Local Variable to Attribute'),
+            self.trUtf8('Local Varia&ble to Attribute'),
             0, 0,
             self, 'refactoring_local_variable_to_attribute')
-        self.refactoringLocalVariableToAttributeAct.setStatusTip(self.tr(
+        self.refactoringLocalVariableToAttributeAct.setStatusTip(self.trUtf8(
             'Change a local variable to an attribute'))
-        self.refactoringLocalVariableToAttributeAct.setWhatsThis(self.tr(
+        self.refactoringLocalVariableToAttributeAct.setWhatsThis(self.trUtf8(
             """<b>Local Variable to Attribute</b>"""
             """<p>Change a local variable to an attribute.</p>"""
         ))
-        self.refactoringLocalVariableToAttributeAct.triggered.connect(
+        self.refactoringLocalVariableToAttributeAct.triggered[()].connect(
             self.__convertLocalToAttribute)
         self.actions.append(self.refactoringLocalVariableToAttributeAct)
         
         self.refactoringMethodToMethodObjectAct = E5Action(
-            self.tr('Method To Method Object'),
-            self.tr('Method To Method Ob&ject'),
+            self.trUtf8('Method To Method Object'),
+            self.trUtf8('Method To Method Ob&ject'),
             0, 0,
             self, 'refactoring_method_to_methodobject')
-        self.refactoringMethodToMethodObjectAct.setStatusTip(self.tr(
+        self.refactoringMethodToMethodObjectAct.setStatusTip(self.trUtf8(
             'Transform a function or a method to a method object'))
-        self.refactoringMethodToMethodObjectAct.setWhatsThis(self.tr(
+        self.refactoringMethodToMethodObjectAct.setWhatsThis(self.trUtf8(
             """<b>Method To Method Object</b>"""
             """<p>Transform a function or a method to a method object.</p>"""
         ))
-        self.refactoringMethodToMethodObjectAct.triggered.connect(
+        self.refactoringMethodToMethodObjectAct.triggered[()].connect(
             self.__methodToMethodObject)
         self.actions.append(self.refactoringMethodToMethodObjectAct)
         
@@ -478,111 +478,111 @@
         #####################################################
         
         self.refactoringUndoAct = E5Action(
-            self.tr('Undo'),
-            self.tr('&Undo'),
+            self.trUtf8('Undo'),
+            self.trUtf8('&Undo'),
             0, 0,
             self, 'refactoring_undo')
-        self.refactoringUndoAct.setStatusTip(self.tr(
+        self.refactoringUndoAct.setStatusTip(self.trUtf8(
             'Undo the last refactoring'))
-        self.refactoringUndoAct.setWhatsThis(self.tr(
+        self.refactoringUndoAct.setWhatsThis(self.trUtf8(
             """<b>Undo</b>"""
             """<p>Undo the last refactoring.</p>"""
         ))
-        self.refactoringUndoAct.triggered.connect(
+        self.refactoringUndoAct.triggered[()].connect(
             self.__undo)
         self.actions.append(self.refactoringUndoAct)
         
         self.refactoringRedoAct = E5Action(
-            self.tr('Redo'),
-            self.tr('Re&do'),
+            self.trUtf8('Redo'),
+            self.trUtf8('Re&do'),
             0, 0,
             self, 'refactoring_redo')
-        self.refactoringRedoAct.setStatusTip(self.tr(
+        self.refactoringRedoAct.setStatusTip(self.trUtf8(
             'Redo the last refactoring'))
-        self.refactoringRedoAct.setWhatsThis(self.tr(
+        self.refactoringRedoAct.setWhatsThis(self.trUtf8(
             """<b>Redo</b>"""
             """<p>Redo the last refactoring.</p>"""
         ))
-        self.refactoringRedoAct.triggered.connect(
+        self.refactoringRedoAct.triggered[()].connect(
             self.__redo)
         self.actions.append(self.refactoringRedoAct)
         
         self.refactoringUndoHistoryAct = E5Action(
-            self.tr('Show Project Undo History'),
-            self.tr('Show Project Undo History'),
+            self.trUtf8('Show Project Undo History'),
+            self.trUtf8('Show Project Undo History'),
             0, 0,
             self, 'refactoring_show_project_undo_history')
-        self.refactoringUndoHistoryAct.setStatusTip(self.tr(
+        self.refactoringUndoHistoryAct.setStatusTip(self.trUtf8(
             'Show the undo history of the project'))
-        self.refactoringUndoHistoryAct.setWhatsThis(self.tr(
+        self.refactoringUndoHistoryAct.setWhatsThis(self.trUtf8(
             """<b>Show Project Undo History</b>"""
             """<p>Opens a dialog to show the undo history list of"""
             """ the project.</p>"""
         ))
-        self.refactoringUndoHistoryAct.triggered.connect(
+        self.refactoringUndoHistoryAct.triggered[()].connect(
             self.__showProjectUndoHistory)
         self.actions.append(self.refactoringUndoHistoryAct)
         
         self.refactoringRedoHistoryAct = E5Action(
-            self.tr('Show Project Redo History'),
-            self.tr('Show Project Redo History'),
+            self.trUtf8('Show Project Redo History'),
+            self.trUtf8('Show Project Redo History'),
             0, 0,
             self, 'refactoring_show_project_redo_history')
-        self.refactoringRedoHistoryAct.setStatusTip(self.tr(
+        self.refactoringRedoHistoryAct.setStatusTip(self.trUtf8(
             'Show the redo history of the project'))
-        self.refactoringRedoHistoryAct.setWhatsThis(self.tr(
+        self.refactoringRedoHistoryAct.setWhatsThis(self.trUtf8(
             """<b>Show Project Redo History</b>"""
             """<p>Opens a dialog to show the redo history list of"""
             """ the project.</p>"""
         ))
-        self.refactoringRedoHistoryAct.triggered.connect(
+        self.refactoringRedoHistoryAct.triggered[()].connect(
             self.__showProjectRedoHistory)
         self.actions.append(self.refactoringRedoHistoryAct)
         
         self.refactoringUndoFileHistoryAct = E5Action(
-            self.tr('Show Current File Undo History'),
-            self.tr('Show Current File Undo History'),
+            self.trUtf8('Show Current File Undo History'),
+            self.trUtf8('Show Current File Undo History'),
             0, 0,
             self, 'refactoring_show_file_undo_history')
-        self.refactoringUndoFileHistoryAct.setStatusTip(self.tr(
+        self.refactoringUndoFileHistoryAct.setStatusTip(self.trUtf8(
             'Show the undo history of the current file'))
-        self.refactoringUndoFileHistoryAct.setWhatsThis(self.tr(
+        self.refactoringUndoFileHistoryAct.setWhatsThis(self.trUtf8(
             """<b>Show Current File Undo History</b>"""
             """<p>Opens a dialog to show the undo history list of"""
             """ the current file.</p>"""
         ))
-        self.refactoringUndoFileHistoryAct.triggered.connect(
+        self.refactoringUndoFileHistoryAct.triggered[()].connect(
             self.__showFileUndoHistory)
         self.actions.append(self.refactoringUndoFileHistoryAct)
         
         self.refactoringRedoFileHistoryAct = E5Action(
-            self.tr('Show Current File Redo History'),
-            self.tr('Show Current File Redo History'),
+            self.trUtf8('Show Current File Redo History'),
+            self.trUtf8('Show Current File Redo History'),
             0, 0,
             self, 'refactoring_show_file_redo_history')
-        self.refactoringRedoFileHistoryAct.setStatusTip(self.tr(
+        self.refactoringRedoFileHistoryAct.setStatusTip(self.trUtf8(
             'Show the redo history of the current file'))
-        self.refactoringRedoFileHistoryAct.setWhatsThis(self.tr(
+        self.refactoringRedoFileHistoryAct.setWhatsThis(self.trUtf8(
             """<b>Show Current File Redo History</b>"""
             """<p>Opens a dialog to show the redo history list of"""
             """ the current file.</p>"""
         ))
-        self.refactoringRedoFileHistoryAct.triggered.connect(
+        self.refactoringRedoFileHistoryAct.triggered[()].connect(
             self.__showFileRedoHistory)
         self.actions.append(self.refactoringRedoFileHistoryAct)
         
         self.refactoringClearHistoryAct = E5Action(
-            self.tr('Clear History'),
-            self.tr('Clear History'),
+            self.trUtf8('Clear History'),
+            self.trUtf8('Clear History'),
             0, 0,
             self, 'refactoring_clear_history')
-        self.refactoringClearHistoryAct.setStatusTip(self.tr(
+        self.refactoringClearHistoryAct.setStatusTip(self.trUtf8(
             'Clear the refactoring history'))
-        self.refactoringClearHistoryAct.setWhatsThis(self.tr(
+        self.refactoringClearHistoryAct.setWhatsThis(self.trUtf8(
             """<b>Clear History</b>"""
             """<p>Clears the refactoring history.</p>"""
         ))
-        self.refactoringClearHistoryAct.triggered.connect(
+        self.refactoringClearHistoryAct.triggered[()].connect(
             self.__clearHistory)
         self.actions.append(self.refactoringClearHistoryAct)
         
@@ -591,49 +591,49 @@
         #####################################################
         
         self.queryReferencesAct = E5Action(
-            self.tr('Find occurrences'),
-            self.tr('Find &Occurrences'),
+            self.trUtf8('Find occurrences'),
+            self.trUtf8('Find &Occurrences'),
             0, 0,
             self, 'refactoring_find_occurrences')
-        self.queryReferencesAct.setStatusTip(self.tr(
+        self.queryReferencesAct.setStatusTip(self.trUtf8(
             'Find occurrences of the highlighted object'))
-        self.queryReferencesAct.setWhatsThis(self.tr(
+        self.queryReferencesAct.setWhatsThis(self.trUtf8(
             """<b>Find occurrences</b>"""
             """<p>Find occurrences of the highlighted class, method,"""
             """ function or variable.</p>"""
         ))
-        self.queryReferencesAct.triggered.connect(
+        self.queryReferencesAct.triggered[()].connect(
             self.__queryReferences)
         self.actions.append(self.queryReferencesAct)
         
         self.queryDefinitionAct = E5Action(
-            self.tr('Find definition'),
-            self.tr('Find &Definition'),
+            self.trUtf8('Find definition'),
+            self.trUtf8('Find &Definition'),
             0, 0,
             self, 'refactoring_find_definition')
-        self.queryDefinitionAct.setStatusTip(self.tr(
+        self.queryDefinitionAct.setStatusTip(self.trUtf8(
             'Find definition of the highlighted item'))
-        self.queryDefinitionAct.setWhatsThis(self.tr(
+        self.queryDefinitionAct.setWhatsThis(self.trUtf8(
             """<b>Find definition</b>"""
             """<p>Find the definition of the highlighted class, method,"""
             """ function or variable.</p>"""
         ))
-        self.queryDefinitionAct.triggered.connect(
+        self.queryDefinitionAct.triggered[()].connect(
             self.__queryDefinition)
         self.actions.append(self.queryDefinitionAct)
         
         self.queryImplementationsAct = E5Action(
-            self.tr('Find implementations'),
-            self.tr('Find &Implementations'),
+            self.trUtf8('Find implementations'),
+            self.trUtf8('Find &Implementations'),
             0, 0,
             self, 'refactoring_find_implementations')
-        self.queryImplementationsAct.setStatusTip(self.tr(
+        self.queryImplementationsAct.setStatusTip(self.trUtf8(
             'Find places where the selected method is overridden'))
-        self.queryImplementationsAct.setWhatsThis(self.tr(
+        self.queryImplementationsAct.setWhatsThis(self.trUtf8(
             """<b>Find implementations</b>"""
             """<p>Find places where the selected method is overridden.</p>"""
         ))
-        self.queryImplementationsAct.triggered.connect(
+        self.queryImplementationsAct.triggered[()].connect(
             self.__queryImplementations)
         self.actions.append(self.queryImplementationsAct)
         
@@ -642,67 +642,67 @@
         #####################################################
         
         self.refactoringEditConfigAct = E5Action(
-            self.tr('Configure Rope'),
-            self.tr('&Configure Rope'),
+            self.trUtf8('Configure Rope'),
+            self.trUtf8('&Configure Rope'),
             0, 0,
             self, 'refactoring_edit_config')
-        self.refactoringEditConfigAct.setStatusTip(self.tr(
+        self.refactoringEditConfigAct.setStatusTip(self.trUtf8(
             'Open the rope configuration file'))
-        self.refactoringEditConfigAct.setWhatsThis(self.tr(
+        self.refactoringEditConfigAct.setWhatsThis(self.trUtf8(
             """<b>Configure Rope</b>"""
             """<p>Opens the rope configuration file in an editor.</p>"""
         ))
-        self.refactoringEditConfigAct.triggered.connect(
+        self.refactoringEditConfigAct.triggered[()].connect(
             self.__editConfig)
         self.refactoringEditConfigAct.setMenuRole(QAction.NoRole)
         self.actions.append(self.refactoringEditConfigAct)
         
         self.refactoringHelpAct = E5Action(
-            self.tr('Rope help'),
-            self.tr('Rope &Help'),
+            self.trUtf8('Rope help'),
+            self.trUtf8('Rope &Help'),
             0, 0,
             self, 'refactoring_help')
-        self.refactoringHelpAct.setStatusTip(self.tr(
+        self.refactoringHelpAct.setStatusTip(self.trUtf8(
             'Show help about the rope refactorings'))
-        self.refactoringHelpAct.setWhatsThis(self.tr(
+        self.refactoringHelpAct.setWhatsThis(self.trUtf8(
             """<b>Rope help</b>"""
             """<p>Show some help text about the rope refactorings.</p>"""
         ))
-        self.refactoringHelpAct.triggered.connect(
+        self.refactoringHelpAct.triggered[()].connect(
             self.__showRopeHelp)
         self.actions.append(self.refactoringHelpAct)
         
         self.refactoringAllSoaAct = E5Action(
-            self.tr('Analyse all modules'),
-            self.tr('&Analyse all modules'),
+            self.trUtf8('Analyse all modules'),
+            self.trUtf8('&Analyse all modules'),
             0, 0,
             self, 'refactoring_analyze_all')
-        self.refactoringAllSoaAct.setStatusTip(self.tr(
+        self.refactoringAllSoaAct.setStatusTip(self.trUtf8(
             'Perform static object analysis on all modules'))
-        self.refactoringAllSoaAct.setWhatsThis(self.tr(
+        self.refactoringAllSoaAct.setWhatsThis(self.trUtf8(
             """<b>Analyse all modules</b>"""
             """<p>Perform static object analysis (SOA) on all modules. """
             """This might be time consuming. Analysis of all modules """
             """should only be neccessary, if the project was created """
             """with the rope plugin disabled or if files were added.</p>"""
         ))
-        self.refactoringAllSoaAct.triggered.connect(
+        self.refactoringAllSoaAct.triggered[()].connect(
             self.__performSOA)
         self.actions.append(self.refactoringAllSoaAct)
         
         self.updateConfigAct = E5Action(
-            self.tr('Update Configuration'),
-            self.tr('&Update Configuration'),
+            self.trUtf8('Update Configuration'),
+            self.trUtf8('&Update Configuration'),
             0, 0,
             self, 'refactoring_update_configuration')
-        self.updateConfigAct.setStatusTip(self.tr(
+        self.updateConfigAct.setStatusTip(self.trUtf8(
             'Generates a new configuration file overwriting the current one.'))
-        self.updateConfigAct.setWhatsThis(self.tr(
+        self.updateConfigAct.setWhatsThis(self.trUtf8(
             """<b>Update Configuration</b>"""
             """<p>Generates a new configuration file overwriting"""
             """ the current one.</p>"""
         ))
-        self.updateConfigAct.triggered.connect(
+        self.updateConfigAct.triggered[()].connect(
             self.__updateConfig)
         self.actions.append(self.updateConfigAct)
         
@@ -715,7 +715,7 @@
         
         @return the menu generated (QMenu)
         """
-        menu = QMenu(self.tr('&Refactoring'), self.__ui)
+        menu = QMenu(self.trUtf8('&Refactoring'), self.__ui)
         menu.setTearOffEnabled(True)
         
         act = menu.addAction('rope', self.__ropeInfo)
@@ -724,12 +724,12 @@
         act.setFont(font)
         menu.addSeparator()
         
-        smenu = menu.addMenu(self.tr("&Query"))
+        smenu = menu.addMenu(self.trUtf8("&Query"))
         smenu.addAction(self.queryReferencesAct)
         smenu.addAction(self.queryDefinitionAct)
         smenu.addAction(self.queryImplementationsAct)
         
-        smenu = menu.addMenu(self.tr("&Refactoring"))
+        smenu = menu.addMenu(self.trUtf8("&Refactoring"))
         smenu.aboutToShow.connect(self.__showRefactoringMenu)
         smenu.addAction(self.refactoringRenameAct)
         smenu.addAction(self.refactoringRenameLocalAct)
@@ -761,7 +761,7 @@
         smenu.addAction(self.refactoringTransformModuleAct)
         smenu.addSeparator()
         
-        imenu = smenu.addMenu(self.tr("Im&ports"))
+        imenu = smenu.addMenu(self.trUtf8("Im&ports"))
         imenu.addAction(self.refactoringImportsOrganizeAct)
         imenu.addAction(self.refactoringImportsStarExpandAct)
         imenu.addAction(self.refactoringImportsRelativeToAbsoluteAct)
@@ -773,7 +773,7 @@
         smenu.addAction(self.refactoringRedoAct)
         smenu.addSeparator()
         
-        hmenu = smenu.addMenu(self.tr("History"))
+        hmenu = smenu.addMenu(self.trUtf8("History"))
         hmenu.aboutToShow.connect(self.__showRefactoringHistoryMenu)
         hmenu.addAction(self.refactoringUndoHistoryAct)
         hmenu.addAction(self.refactoringUndoFileHistoryAct)
@@ -783,7 +783,7 @@
         hmenu.addSeparator()
         hmenu.addAction(self.refactoringClearHistoryAct)
         
-        smenu = menu.addMenu(self.tr("&Utilities"))
+        smenu = menu.addMenu(self.trUtf8("&Utilities"))
         smenu.addAction(self.refactoringAllSoaAct)
         smenu.addSeparator()
         smenu.addAction(self.updateConfigAct)
@@ -805,8 +805,8 @@
         """
         E5MessageBox.about(
             self.__ui,
-            self.tr("About rope"),
-            self.tr("{0}\nVersion {1}\n\n{2}".format(
+            self.trUtf8("About rope"),
+            self.trUtf8("{0}\nVersion {1}\n\n{2}".format(
                 rope.INFO, rope.VERSION, rope.COPYRIGHT)))
     
     def __canUndo(self):
@@ -914,7 +914,7 @@
                 'ModuleSyntaxError':
             res = E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Rope error: {0}").format(str(err)),
+                self.trUtf8("Rope error: {0}").format(str(err)),
                 E5MessageBox.Ok | E5MessageBox.Open)
             if res == E5MessageBox.Open:
                 e5App().getObject("ViewManager").openSourceFile(
@@ -924,7 +924,7 @@
         else:
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Rope error: {0}").format(str(err)))
+                self.trUtf8("Rope error: {0}").format(str(err)))
     
     def __getOffset(self, editor, line, index):
         r"""
@@ -955,19 +955,19 @@
         """
         Private slot to handle the Rename action.
         """
-        self.__doRename(self.tr('Rename'))
+        self.__doRename(self.trUtf8('Rename'))
     
     def __renameLocal(self):
         """
         Private slot to handle the Local Rename action.
         """
-        self.__doRename(self.tr('Local Rename'), isLocal=True)
+        self.__doRename(self.trUtf8('Local Rename'), isLocal=True)
     
     def __renameModule(self):
         """
         Private slot to handle the Rename Current Module action.
         """
-        self.__doRename(self.tr('Rename Current Module'),
+        self.__doRename(self.trUtf8('Rename Current Module'),
                         renameModule=True)
     
     def __doRename(self, title, isLocal=False, renameModule=False):
@@ -989,8 +989,8 @@
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the declaration you want to rename"
-                        " and try again."))
+                self.trUtf8("Highlight the declaration you want to rename"
+                            " and try again."))
             return
         
         if isLocal:
@@ -1009,8 +1009,8 @@
                 # selection span more than one line
                 E5MessageBox.warning(
                     self.__ui, title,
-                    self.tr("The selection must not extend beyond"
-                            " one line."))
+                    self.trUtf8("The selection must not extend beyond"
+                                " one line."))
                 return
             index = int(index + (index1 - index) / 2)
             # keep it inside the object
@@ -1044,13 +1044,13 @@
         if aw is None:
             return
         
-        title = self.tr("Change Occurrences")
+        title = self.trUtf8("Change Occurrences")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight an occurrence to be changed"
-                        " and try again."))
+                self.trUtf8("Highlight an occurrence to be changed"
+                            " and try again."))
             return
         
         if not self.confirmBufferIsSaved(aw):
@@ -1083,13 +1083,13 @@
         """
         Private slot to handle the Extract Method action.
         """
-        self.__doExtract(self.tr("Extract Method"), "method")
+        self.__doExtract(self.trUtf8("Extract Method"), "method")
     
     def __extractLocalVariable(self):
         """
         Private slot to handle the Extract Local Variable action.
         """
-        self.__doExtract(self.tr("Extract Local Variable"), "variable")
+        self.__doExtract(self.trUtf8("Extract Local Variable"), "variable")
     
     def __doExtract(self, title, kind):
         """
@@ -1109,8 +1109,8 @@
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the region of code you want to extract"
-                        " and try again."))
+                self.trUtf8("Highlight the region of code you want to extract"
+                            " and try again."))
             return
         
         if not self.confirmBufferIsSaved(aw):
@@ -1154,13 +1154,13 @@
         if aw is None:
             return
         
-        title = self.tr("Inline")
+        title = self.trUtf8("Inline")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the local variable, method or parameter"
-                        " you want to inline and try again."))
+                self.trUtf8("Highlight the local variable, method or parameter"
+                            " you want to inline and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1197,13 +1197,13 @@
         if aw is None:
             return
         
-        title = self.tr("Move Method")
+        title = self.trUtf8("Move Method")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the method to move"
-                        " and try again."))
+                self.trUtf8("Highlight the method to move"
+                            " and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1241,7 +1241,7 @@
         if aw is None:
             return
         
-        title = self.tr("Move Current Module")
+        title = self.trUtf8("Move Current Module")
         
         if not self.confirmAllBuffersSaved():
             return
@@ -1276,12 +1276,12 @@
         if aw is None:
             return
         
-        title = self.tr("Use Function")
+        title = self.trUtf8("Use Function")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight a global function and try again."))
+                self.trUtf8("Highlight a global function and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1318,13 +1318,13 @@
         if aw is None:
             return
         
-        title = self.tr("Introduce Factory Method")
+        title = self.trUtf8("Introduce Factory Method")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the class to introduce a factory"
-                        " method for and try again."))
+                self.trUtf8("Highlight the class to introduce a factory"
+                            " method for and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1359,13 +1359,13 @@
         if aw is None:
             return
         
-        title = self.tr("Introduce Parameter")
+        title = self.trUtf8("Introduce Parameter")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the code for the new parameter"
-                        " and try again."))
+                self.trUtf8("Highlight the code for the new parameter"
+                            " and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1400,7 +1400,7 @@
         """
         from rope.refactor.importutils import ImportOrganizer
         self.__doImports(
-            self.tr("Organize Imports"),
+            self.trUtf8("Organize Imports"),
             ImportOrganizer.organize_imports)
     
     def __importsExpandStar(self):
@@ -1409,7 +1409,7 @@
         """
         from rope.refactor.importutils import ImportOrganizer
         self.__doImports(
-            self.tr("Expand Star Imports"),
+            self.trUtf8("Expand Star Imports"),
             ImportOrganizer.expand_star_imports)
     
     def __importsRelativeToAbsolute(self):
@@ -1418,7 +1418,7 @@
         """
         from rope.refactor.importutils import ImportOrganizer
         self.__doImports(
-            self.tr("Relative to Absolute"),
+            self.trUtf8("Relative to Absolute"),
             ImportOrganizer.relatives_to_absolutes)
     
     def __importsFromToImport(self):
@@ -1427,7 +1427,7 @@
         """
         from rope.refactor.importutils import ImportOrganizer
         self.__doImports(
-            self.tr("Froms to Imports"),
+            self.trUtf8("Froms to Imports"),
             ImportOrganizer.froms_to_imports)
     
     def __importsHandleLong(self):
@@ -1436,7 +1436,7 @@
         """
         from rope.refactor.importutils import ImportOrganizer
         self.__doImports(
-            self.tr("Handle Long Imports"),
+            self.trUtf8("Handle Long Imports"),
             ImportOrganizer.handle_long_imports)
     
     def __doImports(self, title, method):
@@ -1478,8 +1478,8 @@
             else:
                 E5MessageBox.information(
                     self.__ui, title,
-                    self.tr("The selected refactoring did not produce"
-                            " any change."))
+                    self.trUtf8("The selected refactoring did not produce"
+                                " any change."))
         except Exception as err:
             self.handleRopeError(err, title)
     
@@ -1492,7 +1492,7 @@
         Private slot to restructure code.
         """
         from RestructureDialog import RestructureDialog
-        title = self.tr("Restructure")
+        title = self.trUtf8("Restructure")
         self.dlg = RestructureDialog(self, title, parent=self.__ui)
         self.dlg.show()
     
@@ -1505,13 +1505,13 @@
         if aw is None:
             return
         
-        title = self.tr("Change Method Signature")
+        title = self.trUtf8("Change Method Signature")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the method or function to change"
-                        " and try again."))
+                self.trUtf8("Highlight the method or function to change"
+                            " and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1546,13 +1546,13 @@
         if aw is None:
             return
         
-        title = self.tr("Inline Argument Default")
+        title = self.trUtf8("Inline Argument Default")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the method or function to inline"
-                        " a parameter's default and try again."))
+                self.trUtf8("Highlight the method or function to inline"
+                            " a parameter's default and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1586,7 +1586,7 @@
         if aw is None:
             return
         
-        title = self.tr("Transform Module to Package")
+        title = self.trUtf8("Transform Module to Package")
         
         if not self.confirmAllBuffersSaved():
             return
@@ -1615,13 +1615,13 @@
         if aw is None:
             return
         
-        title = self.tr("Encapsulate Attribute")
+        title = self.trUtf8("Encapsulate Attribute")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the attribute to encapsulate"
-                        " and try again."))
+                self.trUtf8("Highlight the attribute to encapsulate"
+                            " and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1673,13 +1673,13 @@
         if aw is None:
             return
         
-        title = self.tr("Local Variable to Attribute")
+        title = self.trUtf8("Local Variable to Attribute")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the local variable to make an attribute"
-                        " and try again."))
+                self.trUtf8("Highlight the local variable to make an attribute"
+                            " and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1714,13 +1714,13 @@
         if aw is None:
             return
         
-        title = self.tr("Replace Method With Method Object")
+        title = self.trUtf8("Replace Method With Method Object")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the method or function to convert"
-                        " and try again."))
+                self.trUtf8("Highlight the method or function to convert"
+                            " and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1753,12 +1753,12 @@
         """
         Private slot to undo the last refactoring.
         """
-        title = self.tr("Undo refactoring")
+        title = self.trUtf8("Undo refactoring")
         history = self.__project.history
         res = E5MessageBox.yesNo(
             None,
             title,
-            self.tr("""Shall the refactoring <b>{0}</b> be undone?""")
+            self.trUtf8("""Shall the refactoring <b>{0}</b> be undone?""")
             .format(Utilities.html_encode(
                 history.undo_list[-1].description)))
         if res:
@@ -1767,7 +1767,7 @@
             
             from ProgressHandle import ProgressHandle
             changes = history.undo_list[-1]
-            handle = ProgressHandle(self.tr("Undo"), False, self.__ui)
+            handle = ProgressHandle(self.trUtf8("Undo"), False, self.__ui)
             handle.show()
             QApplication.processEvents()
             try:
@@ -1783,12 +1783,12 @@
         """
         Private slot to redo the last refactoring.
         """
-        title = self.tr("Redo refactoring")
+        title = self.trUtf8("Redo refactoring")
         history = self.__project.history
         res = E5MessageBox.yesNo(
             None,
             title,
-            self.tr("""Shall the refactoring <b>{0}</b> be redone?""")
+            self.trUtf8("""Shall the refactoring <b>{0}</b> be redone?""")
             .format(Utilities.html_encode(
                 history.redo_list[-1].description)))
         if res:
@@ -1797,7 +1797,7 @@
             
             from ProgressHandle import ProgressHandle
             changes = history.redo_list[-1]
-            handle = ProgressHandle(self.tr("Redo"), False, self.__ui)
+            handle = ProgressHandle(self.trUtf8("Redo"), False, self.__ui)
             handle.show()
             QApplication.processEvents()
             try:
@@ -1869,9 +1869,9 @@
         """
         res = E5MessageBox.yesNo(
             None,
-            self.tr("Clear History"),
-            self.tr("""Do you really want to clear the undo"""
-                    """ and redo history?"""))
+            self.trUtf8("Clear History"),
+            self.trUtf8("""Do you really want to clear the undo"""
+                        """ and redo history?"""))
         if res:
             self.__project.history.clear()
     
@@ -1888,13 +1888,13 @@
         if aw is None:
             return
         
-        title = self.tr("Find Occurrences")
+        title = self.trUtf8("Find Occurrences")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the class, method, function or variable"
-                        " to search for and try again."))
+                self.trUtf8("Highlight the class, method, function or variable"
+                            " to search for and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1930,7 +1930,7 @@
         else:
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("No occurrences found."))
+                self.trUtf8("No occurrences found."))
     
     def __queryDefinition(self):
         """
@@ -1941,14 +1941,14 @@
         if aw is None:
             return
         
-        title = self.tr("Find &Definition")
+        title = self.trUtf8("Find &Definition")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the class, method, function or"
-                        " variable reference to search definition for and"
-                        " try again."))
+                self.trUtf8("Highlight the class, method, function or"
+                            " variable reference to search definition for and"
+                            " try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -1976,7 +1976,7 @@
         else:
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("No matching definition found."))
+                self.trUtf8("No matching definition found."))
     
     def __queryImplementations(self):
         """
@@ -1987,13 +1987,13 @@
         if aw is None:
             return
         
-        title = self.tr("Find Implementations")
+        title = self.trUtf8("Find Implementations")
         if not aw.hasSelectedText():
             # no selection available
             E5MessageBox.warning(
                 self.__ui, title,
-                self.tr("Highlight the method to search for"
-                        " and try again."))
+                self.trUtf8("Highlight the method to search for"
+                            " and try again."))
             return
         
         if not self.confirmAllBuffersSaved():
@@ -2027,7 +2027,7 @@
                     occurrence.resource, occurrence.lineno, occurrence.unsure)
         else:
             E5MessageBox.warning(
-                self.__ui, title, self.tr("No occurrences found."))
+                self.__ui, title, self.trUtf8("No occurrences found."))
     
     #####################################################
     ## Various actions
@@ -2049,14 +2049,14 @@
             else:
                 E5MessageBox.critical(
                     self.__ui,
-                    self.tr("Configure Rope"),
-                    self.tr("""The Rope configuration file '{0}' does"""
-                            """ not exist.""").format(configfile))
+                    self.trUtf8("Configure Rope"),
+                    self.trUtf8("""The Rope configuration file '{0}' does"""
+                                """ not exist.""").format(configfile))
         else:
             E5MessageBox.critical(
                 self.__ui,
-                self.tr("Configure Rope"),
-                self.tr("""The Rope admin directory does not exist."""))
+                self.trUtf8("Configure Rope"),
+                self.trUtf8("""The Rope admin directory does not exist."""))
     
     def __updateConfig(self):
         """
@@ -2064,9 +2064,9 @@
         """
         res = E5MessageBox.yesNo(
             self.__ui,
-            self.tr("Update Configuration"),
-            self.tr("""Shall rope's current configuration be replaced """
-                    """by a new default configuration?"""))
+            self.trUtf8("Update Configuration"),
+            self.trUtf8("""Shall rope's current configuration be replaced """
+                        """by a new default configuration?"""))
         if res:
             src = self.__defaultConfig()
             cname = self.__ropeConfigFile()
@@ -2080,9 +2080,9 @@
                 except IOError as err:
                     E5MessageBox.critical(
                         None,
-                        self.tr("Update Configuration"),
-                        self.tr("""<p>The configuration could not be"""
-                                """ updated.</p><p>Reason: {0}</p>""")
+                        self.trUtf8("Update Configuration"),
+                        self.trUtf8("""<p>The configuration could not be"""
+                                    """ updated.</p><p>Reason: {0}</p>""")
                         .format(str(err)))
     
     def __showRopeHelp(self):
@@ -2098,7 +2098,7 @@
             helpfile = os.path.join(os.path.dirname(__file__),
                                     dir, "rope", "docs", "overview.txt")
             self.__helpDialog = \
-                HelpDialog(self.tr("Help about rope refactorings"),
+                HelpDialog(self.trUtf8("Help about rope refactorings"),
                            helpfile)
         self.__helpDialog.show()
     
@@ -2106,12 +2106,12 @@
         """
         Private slot to perform SOA on all modules.
         """
-        title = self.tr("Analyse all modules")
+        title = self.trUtf8("Analyse all modules")
         res = E5MessageBox.yesNo(
             self.__ui,
             title,
-            self.tr("""This action might take some time. """
-                    """Do you really want to perform SOA?"""))
+            self.trUtf8("""This action might take some time. """
+                        """Do you really want to perform SOA?"""))
         if res:
             from ProgressHandle import ProgressHandle
             handle = ProgressHandle(title, True, self.__ui)
@@ -2124,8 +2124,8 @@
                 E5MessageBox.information(
                     self.__ui,
                     title,
-                    self.tr("""Static object analysis (SOA) done. """
-                            """SOA database updated."""))
+                    self.trUtf8("""Static object analysis (SOA) done. """
+                                """SOA database updated."""))
             except Exception as err:
                 self.handleRopeError(err, title, handle)
     
@@ -2236,7 +2236,7 @@
     
     def confirmAllBuffersSaved(self):
         """
-        Public method to check, if any editor has unsaved changes.
+        Private method to check, if any editor has unsaved changes.
         
         @return flag indicating, that no editor contains unsaved edits
             (boolean)

eric ide

mercurial