diff -r 49f3377aebf1 -r 787a6b3f8c9f eric6/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py --- a/eric6/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py Fri Oct 09 17:19:29 2020 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py Sat Oct 10 12:20:51 2020 +0200 @@ -15,7 +15,7 @@ pyqtSlot, Qt, QDate, QProcess, QTimer, QRegExp, QSize, QPoint, QFileInfo ) from PyQt5.QtGui import ( - QCursor, QColor, QPixmap, QPainter, QPen, QIcon, QTextCursor, QPalette + QColor, QPixmap, QPainter, QPen, QIcon, QTextCursor, QPalette ) from PyQt5.QtWidgets import ( QWidget, QDialogButtonBox, QHeaderView, QTreeWidgetItem, QApplication, @@ -24,6 +24,7 @@ from E5Gui.E5Application import e5App from E5Gui import E5MessageBox, E5FileDialog +from E5Gui.E5OverrideCursor import E5OverrideCursorProcess from Globals import strToQByteArray @@ -194,10 +195,10 @@ # roles used in the file tree self.__diffFileLineRole = Qt.UserRole - self.process = QProcess() - self.process.finished.connect(self.__procFinished) - self.process.readyReadStandardOutput.connect(self.__readStdout) - self.process.readyReadStandardError.connect(self.__readStderr) + self.__process = E5OverrideCursorProcess() + self.__process.finished.connect(self.__procFinished) + self.__process.readyReadStandardOutput.connect(self.__readStdout) + self.__process.readyReadStandardError.connect(self.__readStderr) self.flags = { 'A': self.tr('Added'), @@ -383,12 +384,12 @@ @param e close event (QCloseEvent) """ if ( - self.process is not None and - self.process.state() != QProcess.NotRunning + self.__process is not None and + self.__process.state() != QProcess.NotRunning ): - self.process.terminate() - QTimer.singleShot(2000, self.process.kill) - self.process.waitForFinished(3000) + self.__process.terminate() + QTimer.singleShot(2000, self.__process.kill) + self.__process.waitForFinished(3000) self.vcs.getPlugin().setPreferences( "LogBrowserGeometry", self.saveGeometry()) @@ -782,9 +783,6 @@ self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) QApplication.processEvents() - QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) - QApplication.processEvents() - self.buf = [] self.cancelled = False self.errors.clear() @@ -810,12 +808,12 @@ args.append('--') args.append(self.__filename) - self.process.kill() + self.__process.kill() - self.process.setWorkingDirectory(self.repodir) + self.__process.setWorkingDirectory(self.repodir) - self.process.start('git', args) - procStarted = self.process.waitForStarted(5000) + self.__process.start('git', args) + procStarted = self.__process.waitForStarted(5000) if not procStarted: self.inputGroup.setEnabled(False) self.inputGroup.hide() @@ -881,14 +879,12 @@ the button. """ if ( - self.process is not None and - self.process.state() != QProcess.NotRunning + self.__process is not None and + self.__process.state() != QProcess.NotRunning ): - self.process.terminate() - QTimer.singleShot(2000, self.process.kill) - self.process.waitForFinished(3000) - - QApplication.restoreOverrideCursor() + self.__process.terminate() + QTimer.singleShot(2000, self.__process.kill) + self.__process.waitForFinished(3000) self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) @@ -1052,10 +1048,10 @@ It reads the output of the process and inserts it into a buffer. """ - self.process.setReadChannel(QProcess.StandardOutput) + self.__process.setReadChannel(QProcess.StandardOutput) - while self.process.canReadLine(): - line = str(self.process.readLine(), + while self.__process.canReadLine(): + line = str(self.__process.readLine(), Preferences.getSystem("IOEncoding"), 'replace') self.buf.append(line) @@ -1067,8 +1063,8 @@ It reads the error output of the process and inserts it into the error pane. """ - if self.process is not None: - s = str(self.process.readAllStandardError(), + if self.__process is not None: + s = str(self.__process.readAllStandardError(), Preferences.getSystem("IOEncoding"), 'replace') self.__showError(s) @@ -1147,7 +1143,7 @@ self.errors.ensureCursorVisible() self.errorGroup.show() - self.process.write(strToQByteArray(inputTxt)) + self.__process.write(strToQByteArray(inputTxt)) self.passwordCheckBox.setChecked(False) self.input.clear()