WizardDataUriEncoder/DataUriEncoderWizardDialog.py

changeset 18
c475669c478a
parent 12
7d05e63f3cb1
child 28
31ec0c818335
--- a/WizardDataUriEncoder/DataUriEncoderWizardDialog.py	Sat Apr 26 16:23:02 2014 +0200
+++ b/WizardDataUriEncoder/DataUriEncoderWizardDialog.py	Sat Jul 12 17:02:12 2014 +0200
@@ -12,8 +12,9 @@
 import getpass
 import datetime
 
-from PyQt4.QtCore import pyqtSlot
-from PyQt4.QtGui import QDialog, QDialogButtonBox, QApplication, QInputDialog
+from PyQt5.QtCore import pyqtSlot
+from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QApplication, \
+    QInputDialog
 
 from E5Gui.E5Completers import E5FileCompleter
 from E5Gui import E5FileDialog, E5MessageBox
@@ -104,9 +105,9 @@
             self.__getStartDir()
         inputFile = E5FileDialog.getOpenFileName(
             self,
-            self.trUtf8("Data URI Encoder"),
+            self.tr("Data URI Encoder"),
             start,
-            self.trUtf8(
+            self.tr(
                 "Audio Files (*.flac *.mp3 *.ogg *.wav *.weba *.wma);;"
                 "Image Files (*.gif *.ico *.jpg *.png *.svg *.tif *.webp"
                 " *.xpm);;"
@@ -143,8 +144,8 @@
         if os.path.getsize(filepath) // 1024 // 1024 >= 1:
             res = E5MessageBox.warning(
                 self,
-                self.trUtf8("Data URI Encoder"),
-                self.trUtf8(
+                self.tr("Data URI Encoder"),
+                self.tr(
                     """The file size is > 1 Megabyte. Encoding this will"""
                     """ take some time depending on your CPU processing"""
                     """ power!"""),
@@ -166,8 +167,8 @@
         except (IOError, OSError) as err:
             E5MessageBox.critical(
                 self,
-                self.trUtf8("Data URI Encoder"),
-                self.trUtf8(
+                self.tr("Data URI Encoder"),
+                self.tr(
                     """<p>The file <b>{0}</b> could not be read.</p>"""
                     """<p>Reason: {1}</p>""").format(filepath, str(err)))
             return
@@ -236,8 +237,8 @@
             index = 0
         mimetype, ok = QInputDialog.getItem(
             self,
-            self.trUtf8("Data URI Encoder"),
-            self.trUtf8("Enter a mime type:"),
+            self.tr("Data URI Encoder"),
+            self.tr("Enter a mime type:"),
             mimetypesList,
             index, True)
         if ok:

eric ide

mercurial