--- a/eric6/Plugins/VcsPlugins/vcsGit/GitReflogBrowserDialog.py Fri Oct 09 17:19:29 2020 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsGit/GitReflogBrowserDialog.py Sat Oct 10 12:20:51 2020 +0200 @@ -11,13 +11,13 @@ import os from PyQt5.QtCore import pyqtSlot, Qt, QProcess, QTimer, QPoint -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_GitReflogBrowserDialog import Ui_GitReflogBrowserDialog @@ -75,10 +75,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): """ @@ -95,12 +95,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() @@ -165,9 +165,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() @@ -181,15 +178,15 @@ args.append('--format={0}'.format(self.__formatTemplate)) args.append('--skip={0}'.format(skip)) - 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() @@ -242,14 +239,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) @@ -313,10 +308,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) @@ -328,8 +323,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) @@ -399,7 +394,7 @@ self.errors.ensureCursorVisible() self.errorGroup.show() - self.process.write(strToQByteArray(inputTxt)) + self.__process.write(strToQByteArray(inputTxt)) self.passwordCheckBox.setChecked(False) self.input.clear()