diff -r c3ca6d580760 -r bf234b8941d9 PyLint/PyLintExecDialog.py --- a/PyLint/PyLintExecDialog.py Wed Apr 30 19:58:17 2014 +0200 +++ b/PyLint/PyLintExecDialog.py Sun Jul 06 17:08:41 2014 +0200 @@ -15,9 +15,10 @@ import os -from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot -from PyQt4.QtGui import QWidget, QCursor, QHeaderView, QApplication, \ - QTextCursor, QDialogButtonBox, QTreeWidgetItem +from PyQt5.QtCore import QTimer, QProcess, Qt, pyqtSlot +from PyQt5.QtGui import QCursor, QTextCursor +from PyQt5.QtWidgets import QWidget, QHeaderView, QApplication, \ + QDialogButtonBox, QTreeWidgetItem from E5Gui import E5MessageBox, E5FileDialog from E5Gui.E5Application import e5App @@ -47,14 +48,14 @@ self.setupUi(self) self.saveButton = self.buttonBox.addButton( - self.trUtf8("Save Report..."), QDialogButtonBox.ActionRole) + self.tr("Save Report..."), QDialogButtonBox.ActionRole) self.saveButton.setToolTip( - self.trUtf8("Press to save the report to a file")) + self.tr("Press to save the report to a file")) self.saveButton.setEnabled(False) self.refreshButton = self.buttonBox.addButton( - self.trUtf8("Refresh"), QDialogButtonBox.ActionRole) - self.refreshButton.setToolTip(self.trUtf8( + self.tr("Refresh"), QDialogButtonBox.ActionRole) + self.refreshButton.setToolTip(self.tr( "Press to refresh the result display")) self.refreshButton.setEnabled(False) @@ -70,11 +71,11 @@ self.__scrollPosition = -1 # illegal value self.typeDict = { - 'C': self.trUtf8('Convention'), - 'R': self.trUtf8('Refactor'), - 'W': self.trUtf8('Warning'), - 'E': self.trUtf8('Error'), - 'F': self.trUtf8('Fatal'), + 'C': self.tr('Convention'), + 'R': self.tr('Refactor'), + 'W': self.tr('Warning'), + 'E': self.tr('Error'), + 'F': self.tr('Fatal'), } def start(self, args, fn, reportFile, ppath): @@ -148,8 +149,8 @@ if not procStarted: E5MessageBox.critical( self, - self.trUtf8('Process Generation Error'), - self.trUtf8( + self.tr('Process Generation Error'), + self.tr( 'The process {0} could not be started. ' 'Ensure, that it is in the search path.' ).format(program)) @@ -220,7 +221,7 @@ if self.noResults: self.__createItem( - self.trUtf8('No PyLint errors found.'), "", "", "") + self.tr('No PyLint errors found.'), "", "", "") @pyqtSlot() def on_refreshButton_clicked(self): @@ -344,7 +345,7 @@ vm.openSourceFile(fn, lineno) editor = vm.getOpenEditor(fn) editor.toggleWarning( - lineno, True, + lineno, 0, True, "{0} | {1}".format(itm.text(1), itm.text(2))) else: fn = os.path.join(self.pathname, itm.data(0, self.filenameRole)) @@ -355,7 +356,7 @@ citm = itm.child(index) lineno = int(citm.text(0)) editor.toggleWarning( - lineno, True, + lineno, 0, True, "{0} | {1}".format(citm.text(1), citm.text(2))) def __writeReport(self): @@ -366,8 +367,8 @@ if os.path.exists(self.reportFile): res = E5MessageBox.warning( self, - self.trUtf8("PyLint Report"), - self.trUtf8( + self.tr("PyLint Report"), + self.tr( """<p>The PyLint report file <b>{0}</b> already""" """ exists.</p>""") .format(self.reportFile), @@ -386,8 +387,8 @@ f.close() except IOError as why: E5MessageBox.critical( - self, self.trUtf8('PyLint Report'), - self.trUtf8('<p>The PyLint report file <b>{0}</b> could not' + self, self.tr('PyLint Report'), + self.tr('<p>The PyLint report file <b>{0}</b> could not' ' be written.<br>Reason: {1}</p>') .format(self.reportFile, str(why))) @@ -397,13 +398,13 @@ Private slot to save the report to a file. """ if self.htmlOutput: - filter = self.trUtf8("HTML Files (*.html);;All Files (*)") + filter = self.tr("HTML Files (*.html);;All Files (*)") else: - filter = self.trUtf8("Text Files (*.txt);;All Files (*)") + filter = self.tr("Text Files (*.txt);;All Files (*)") self.reportFile = E5FileDialog.getSaveFileName( self, - self.trUtf8("PyLint Report"), + self.tr("PyLint Report"), self.ppath, filter, E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))