PluginColorString.py

changeset 11
3b7ec819a55d
parent 8
ba338747008c
child 16
126fc3a16ebf
--- a/PluginColorString.py	Sat Apr 26 15:38:51 2014 +0200
+++ b/PluginColorString.py	Fri Jul 11 19:49:18 2014 +0200
@@ -11,8 +11,9 @@
 
 import os
 
-from PyQt4.QtCore import QObject, QTranslator
-from PyQt4.QtGui import QColor, QColorDialog, QMenu, QDialog
+from PyQt5.QtCore import QObject, QTranslator
+from PyQt5.QtGui import QColor
+from PyQt5.QtWidgets import QColorDialog, QMenu, QDialog
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -22,7 +23,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "1.0.0"
+version = "2.0.0"
 className = "ColorStringPlugin"
 packageName = "ColorString"
 shortDescription = "Insert color as string"
@@ -179,7 +180,7 @@
         """
         isHex = True
         for c in text:
-            isHex = isHex and c in "0123456789abcdefABCDEF" 
+            isHex = isHex and c in "0123456789abcdefABCDEF"
         return isHex
     
     def __isValidColor(self, name):
@@ -217,9 +218,9 @@
             if not self.__isValidColor(currColor):
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Color String"),
-                    self.trUtf8(
-                        """<p>The selected string <b>{0}</b> is not a""" \
+                    self.tr("Color String"),
+                    self.tr(
+                        """<p>The selected string <b>{0}</b> is not a"""
                         """ valid color string. Aborting!</p>""")
                     .format(currColor))
                 return
@@ -265,9 +266,9 @@
             if currColor not in QColor.colorNames():
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Color String"),
-                    self.trUtf8(
-                        """<p>The selected string <b>{0}</b> is not a""" \
+                    self.tr("Color String"),
+                    self.tr(
+                        """<p>The selected string <b>{0}</b> is not a"""
                         """ valid color name. Aborting!</p>""")
                     .format(currColor))
                 return

eric ide

mercurial