eric6/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8143
2c730d5fd177
child 8218
7c09585bd960
diff -r e01ae92db699 -r 31965986ecd1 eric6/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py	Sat Mar 06 10:00:52 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py	Sun Mar 28 15:00:11 2021 +0200
@@ -35,10 +35,12 @@
         """
         super(SvnBlameDialog, 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
         
@@ -61,7 +63,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)
@@ -115,17 +117,21 @@
         """
         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.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.inputGroup.setEnabled(False)
         self.inputGroup.hide()
@@ -138,9 +144,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):
@@ -156,7 +166,8 @@
         """
         Private method to resize the list columns.
         """
-        self.blameList.header().resizeSections(QHeaderView.ResizeToContents)
+        self.blameList.header().resizeSections(
+            QHeaderView.ResizeMode.ResizeToContents)
         
     def __generateItem(self, revision, author, text):
         """
@@ -170,8 +181,8 @@
             self.blameList,
             [revision, author, "{0:d}".format(self.lineno), text])
         self.lineno += 1
-        itm.setTextAlignment(0, Qt.AlignRight)
-        itm.setTextAlignment(2, Qt.AlignRight)
+        itm.setTextAlignment(0, Qt.AlignmentFlag.AlignRight)
+        itm.setTextAlignment(2, Qt.AlignmentFlag.AlignRight)
         
     def __readStdout(self):
         """
@@ -180,7 +191,7 @@
         It reads the output of the process, formats it and inserts it into
         the contents pane.
         """
-        self.process.setReadChannel(QProcess.StandardOutput)
+        self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput)
         
         while self.process.canReadLine():
             s = str(
@@ -215,9 +226,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):

eric ide

mercurial