UI/FindFileDialog.py

changeset 3190
a9a94491c4fd
parent 3186
a05eff845522
child 3192
34689c08f095
diff -r 9a21c547de5f -r a9a94491c4fd UI/FindFileDialog.py
--- a/UI/FindFileDialog.py	Fri Jan 10 19:30:21 2014 +0100
+++ b/UI/FindFileDialog.py	Sat Jan 11 11:55:33 2014 +0100
@@ -23,6 +23,7 @@
 import Preferences
 import UI.PixmapCache
 
+
 class FindFileDialog(QDialog, Ui_FindFileDialog):
     """
     Class implementing a dialog to search for text in files.
@@ -61,19 +62,19 @@
         self.__replaceMode = replaceMode
         
         self.stopButton = \
-            self.buttonBox.addButton(self.trUtf8("Stop"),
+            self.buttonBox.addButton(self.tr("Stop"),
                                      QDialogButtonBox.ActionRole)
         self.stopButton.setEnabled(False)
         
         self.findButton = \
-            self.buttonBox.addButton(self.trUtf8("Find"),
+            self.buttonBox.addButton(self.tr("Find"),
                                      QDialogButtonBox.ActionRole)
         self.findButton.setEnabled(False)
         self.findButton.setDefault(True)
         
         if self.__replaceMode:
             self.replaceButton.setEnabled(False)
-            self.setWindowTitle(self.trUtf8("Replace in Files"))
+            self.setWindowTitle(self.tr("Replace in Files"))
         else:
             self.replaceLabel.hide()
             self.replacetextCombo.hide()
@@ -372,9 +373,9 @@
         except re.error as why:
             E5MessageBox.critical(
                 self,
-                self.trUtf8("Invalid search expression"),
-                self.trUtf8("""<p>The search expression is not valid.</p>"""
-                            """<p>Error: {0}</p>""").format(str(why)))
+                self.tr("Invalid search expression"),
+                self.tr("""<p>The search expression is not valid.</p>"""
+                        """<p>Error: {0}</p>""").format(str(why)))
             self.stopButton.setEnabled(False)
             self.findButton.setEnabled(True)
             self.findButton.setDefault(True)
@@ -538,7 +539,7 @@
         """
         directory = E5FileDialog.getExistingDirectory(
             self,
-            self.trUtf8("Select directory"),
+            self.tr("Select directory"),
             self.dirCombo.currentText(),
             E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
             
@@ -608,8 +609,8 @@
                 except (UnicodeError, IOError) as err:
                     E5MessageBox.critical(
                         self,
-                        self.trUtf8("Replace in Files"),
-                        self.trUtf8(
+                        self.tr("Replace in Files"),
+                        self.tr(
                             """<p>Could not read the file <b>{0}</b>."""
                             """ Skipping it.</p><p>Reason: {1}</p>""")
                         .format(fn, str(err))
@@ -623,8 +624,8 @@
                 if origHash != hash:
                     E5MessageBox.critical(
                         self,
-                        self.trUtf8("Replace in Files"),
-                        self.trUtf8(
+                        self.tr("Replace in Files"),
+                        self.tr(
                             """<p>The current and the original hash of the"""
                             """ file <b>{0}</b> are different. Skipping it."""
                             """</p><p>Hash 1: {1}</p><p>Hash 2: {2}</p>""")
@@ -649,8 +650,8 @@
                 except (IOError, Utilities.CodingError, UnicodeError) as err:
                     E5MessageBox.critical(
                         self,
-                        self.trUtf8("Replace in Files"),
-                        self.trUtf8(
+                        self.tr("Replace in Files"),
+                        self.tr(
                             """<p>Could not save the file <b>{0}</b>."""
                             """ Skipping it.</p><p>Reason: {1}</p>""")
                         .format(fn, str(err))
@@ -674,8 +675,8 @@
         """
         menu = QMenu(self)
         
-        menu.addAction(self.trUtf8("Open"), self.__openFile)
-        menu.addAction(self.trUtf8("Copy Path to Clipboard"),
+        menu.addAction(self.tr("Open"), self.__openFile)
+        menu.addAction(self.tr("Copy Path to Clipboard"),
                        self.__copyToClipboard)
         
         menu.exec_(QCursor.pos())

eric ide

mercurial