eric6/PipInterface/PipDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8176
31965986ecd1
child 8218
7c09585bd960
--- a/eric6/PipInterface/PipDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/PipInterface/PipDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -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