--- a/eric6/Plugins/VcsPlugins/vcsGit/GitBisectLogBrowserDialog.py Fri Oct 09 17:19:29 2020 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsGit/GitBisectLogBrowserDialog.py Sat Oct 10 12:20:51 2020 +0200 @@ -11,13 +11,13 @@ import os from PyQt5.QtCore import pyqtSlot, Qt, QPoint, QProcess, QTimer -from PyQt5.QtGui import QCursor from PyQt5.QtWidgets import ( QWidget, QDialogButtonBox, QHeaderView, QTreeWidgetItem, QApplication, QLineEdit ) from E5Gui import E5MessageBox +from E5Gui.E5OverrideCursor import E5OverrideCursorProcess from .Ui_GitBisectLogBrowserDialog import Ui_GitBisectLogBrowserDialog @@ -64,10 +64,10 @@ self.__initData() self.__resetUI() - 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) def __initData(self): """ @@ -82,12 +82,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.__position = self.pos() @@ -145,9 +145,6 @@ self.inputGroup.show() self.refreshButton.setEnabled(False) - QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) - QApplication.processEvents() - self.buf = [] self.cancelled = False self.errors.clear() @@ -156,15 +153,15 @@ args = self.vcs.initCommand("bisect") args.append("log") - self.process.kill() + self.__process.kill() - self.process.setWorkingDirectory(self.repodir) + self.__process.setWorkingDirectory(self.repodir) self.inputGroup.setEnabled(True) self.inputGroup.show() - 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() @@ -216,14 +213,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) @@ -265,10 +260,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) @@ -280,8 +275,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) @@ -351,7 +346,7 @@ self.errors.ensureCursorVisible() self.errorGroup.show() - self.process.write(strToQByteArray(inputTxt)) + self.__process.write(strToQByteArray(inputTxt)) self.passwordCheckBox.setChecked(False) self.input.clear()