eric6/Plugins/VcsPlugins/vcsGit/GitDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8142
43248bafe9b2
parent 8143
2c730d5fd177
child 8273
698ae46f40a4
diff -r e01ae92db699 -r 31965986ecd1 eric6/Plugins/VcsPlugins/vcsGit/GitDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitDialog.py	Sat Mar 06 10:00:52 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsGit/GitDialog.py	Sun Mar 28 15:00:11 2021 +0200
@@ -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