eric6/Plugins/VcsPlugins/vcsGit/GitBlameDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
diff -r 27f636beebad -r 2c730d5fd177 eric6/Plugins/VcsPlugins/vcsGit/GitBlameDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitBlameDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsGit/GitBlameDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -36,10 +36,12 @@
         """
         super(GitBlameDialog, self).__init__(parent)
         self.setupUi(self)
-        self.setWindowFlags(Qt.Window)
+        self.setWindowFlags(Qt.WindowType.Window)
         
-        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.vcs = vcs
         
@@ -69,7 +71,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)
@@ -130,7 +132,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)
@@ -139,11 +141,15 @@
         self.inputGroup.setEnabled(False)
         self.inputGroup.hide()
         
-        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.Close).setFocus(
-            Qt.OtherFocusReason)
+        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.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close).setFocus(
+            Qt.FocusReason.OtherFocusReason)
         
         self.__resizeColumns()
     
@@ -153,9 +159,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.__finish()
     
     def __procFinished(self, exitCode, exitStatus):
@@ -171,7 +181,8 @@
         """
         Private method to resize the list columns.
         """
-        self.blameList.header().resizeSections(QHeaderView.ResizeToContents)
+        self.blameList.header().resizeSections(
+            QHeaderView.ResizeMode.ResizeToContents)
     
     def __generateItem(self, commitId, author, date, time, lineno, text):
         """
@@ -187,8 +198,8 @@
         itm = QTreeWidgetItem(
             self.blameList,
             [commitId, author, date, time, lineno, text])
-        itm.setTextAlignment(0, Qt.AlignRight)
-        itm.setTextAlignment(4, Qt.AlignRight)
+        itm.setTextAlignment(0, Qt.AlignmentFlag.AlignRight)
+        itm.setTextAlignment(4, Qt.AlignmentFlag.AlignRight)
     
     def __readStdout(self):
         """
@@ -197,7 +208,7 @@
         It reads the output of the process, formats it and inserts it into
         the annotation list.
         """
-        self.process.setReadChannel(QProcess.StandardOutput)
+        self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput)
         
         while self.process.canReadLine():
             line = str(self.process.readLine(),
@@ -259,9 +270,9 @@
         @param checked flag indicating the status of the check box (boolean)
         """
         if checked:
-            self.input.setEchoMode(QLineEdit.Password)
+            self.input.setEchoMode(QLineEdit.EchoMode.Password)
         else:
-            self.input.setEchoMode(QLineEdit.Normal)
+            self.input.setEchoMode(QLineEdit.EchoMode.Normal)
     
     def keyPressEvent(self, evt):
         """

eric ide

mercurial