--- a/eric6/Plugins/VcsPlugins/vcsGit/GitBisectLogBrowserDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Plugins/VcsPlugins/vcsGit/GitBisectLogBrowserDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -44,13 +44,15 @@ self.__position = QPoint() - self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) - self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setEnabled(False) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel).setDefault(True) self.logTree.headerItem().setText(self.logTree.columnCount(), "") self.refreshButton = self.buttonBox.addButton( - self.tr("&Refresh"), QDialogButtonBox.ActionRole) + self.tr("&Refresh"), QDialogButtonBox.ButtonRole.ActionRole) self.refreshButton.setToolTip( self.tr("Press to refresh the list of commits")) self.refreshButton.setEnabled(False) @@ -82,7 +84,7 @@ """ if ( self.__process is not None and - self.__process.state() != QProcess.NotRunning + self.__process.state() != QProcess.ProcessState.NotRunning ): self.__process.terminate() QTimer.singleShot(2000, self.__process.kill) @@ -112,7 +114,8 @@ """ Private method to resize the log tree columns. """ - self.logTree.header().resizeSections(QHeaderView.ResizeToContents) + self.logTree.header().resizeSections( + QHeaderView.ResizeMode.ResizeToContents) self.logTree.header().setStretchLastSection(True) def __generateLogItem(self, commitId, operation, subject): @@ -136,9 +139,12 @@ """ Private method to retrieve bisect log entries from the repository. """ - self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) - self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) - self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setEnabled(False) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel).setEnabled(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel).setDefault(True) self.inputGroup.setEnabled(True) self.inputGroup.show() @@ -213,15 +219,18 @@ """ if ( self.__process is not None and - self.__process.state() != QProcess.NotRunning + self.__process.state() != QProcess.ProcessState.NotRunning ): 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) - self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setEnabled(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel).setEnabled(False) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setDefault(True) self.inputGroup.setEnabled(False) self.inputGroup.hide() @@ -248,7 +257,8 @@ # restore current item if self.__currentCommitId: items = self.logTree.findItems( - self.__currentCommitId, Qt.MatchExactly, self.CommitIdColumn) + self.__currentCommitId, Qt.MatchFlag.MatchExactly, + self.CommitIdColumn) if items: self.logTree.setCurrentItem(items[0]) self.__currentCommitId = "" @@ -259,7 +269,7 @@ It reads the output of the process and inserts it into a buffer. """ - self.__process.setReadChannel(QProcess.StandardOutput) + self.__process.setReadChannel(QProcess.ProcessChannel.StandardOutput) while self.__process.canReadLine(): line = str(self.__process.readLine(), @@ -296,9 +306,13 @@ @param button button that was clicked (QAbstractButton) """ - if button == self.buttonBox.button(QDialogButtonBox.Close): + if button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Close + ): self.close() - elif button == self.buttonBox.button(QDialogButtonBox.Cancel): + elif button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel + ): self.cancelled = True self.__finish() elif button == self.refreshButton: @@ -325,9 +339,9 @@ @param isOn flag indicating the status of the check box (boolean) """ if isOn: - self.input.setEchoMode(QLineEdit.Password) + self.input.setEchoMode(QLineEdit.EchoMode.Password) else: - self.input.setEchoMode(QLineEdit.Normal) + self.input.setEchoMode(QLineEdit.EchoMode.Normal) @pyqtSlot() def on_sendButton_clicked(self):