eric6/PipInterface/PipDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8043
0acf98cd089a
parent 8143
2c730d5fd177
child 8273
698ae46f40a4
diff -r e01ae92db699 -r 31965986ecd1 eric6/PipInterface/PipDialog.py
--- a/eric6/PipInterface/PipDialog.py	Sat Mar 06 10:00:52 2021 +0100
+++ b/eric6/PipInterface/PipDialog.py	Sun Mar 28 15:00:11 2021 +0200
@@ -36,8 +36,10 @@
         super(PipDialog, 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.proc = None
         self.__processQueue = []
@@ -65,7 +67,7 @@
         """
         if (
             self.proc is not None and
-            self.proc.state() != QProcess.NotRunning
+            self.proc.state() != QProcess.ProcessState.NotRunning
         ):
             self.proc.terminate()
             QTimer.singleShot(2000, self.proc.kill)
@@ -78,11 +80,15 @@
             self.__addOutput("\n\n")
             self.startProcess(cmd, args)
         else:
-            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)
     
     def __cancel(self):
         """
@@ -99,9 +105,13 @@
         @param button button that was clicked
         @type 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.__cancel()
     
     def __procFinished(self, exitCode, exitStatus):

eric ide

mercurial