eric6/Plugins/VcsPlugins/vcsGit/GitDialog.py

changeset 8143
2c730d5fd177
parent 8047
b5594178c7fa
child 8176
31965986ecd1
child 8218
7c09585bd960
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsGit/GitDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -41,8 +41,10 @@
         super(GitDialog, self).__init__(parent)
         self.setupUi(self)
         
-        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.process = None
         self.username = ''
@@ -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)
@@ -72,11 +74,15 @@
         
         self.process = None
         
-        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)
         
         if self.normal and self.errors.toPlainText():
             self.errorGroup.setTitle(self.tr("Additional Output"))
@@ -94,9 +100,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.statusLabel.setText(self.tr("Process canceled."))
             self.__finish()
     
@@ -107,10 +117,13 @@
         @param exitCode exit code of the process (integer)
         @param exitStatus exit status of the process (QProcess.ExitStatus)
         """
-        self.normal = (exitStatus == QProcess.NormalExit) and (exitCode == 0)
+        self.normal = (
+            (exitStatus == QProcess.ExitStatus.NormalExit) and
+            (exitCode == 0)
+        )
         if self.normal:
             self.statusLabel.setText(self.tr("Process finished successfully."))
-        elif exitStatus == QProcess.CrashExit:
+        elif exitStatus == QProcess.ExitStatus.CrashExit:
             self.statusLabel.setText(self.tr("Process crashed."))
         else:
             self.statusLabel.setText(
@@ -261,9 +274,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