eric6/VirtualEnv/VirtualenvExecDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8176
31965986ecd1
child 8218
7c09585bd960
diff -r 27f636beebad -r 2c730d5fd177 eric6/VirtualEnv/VirtualenvExecDialog.py
--- a/eric6/VirtualEnv/VirtualenvExecDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/VirtualEnv/VirtualenvExecDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -42,8 +42,10 @@
         super(VirtualenvExecDialog, 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.__pyvenv = configuration["envType"] == "pyvenv"
         self.__targetDir = configuration["targetDirectory"]
@@ -121,9 +123,13 @@
         
         @param button button that was clicked (QAbstractButton)
         """
-        if button == self.buttonBox.button(QDialogButtonBox.Close):
+        if button == self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close
+        ):
             self.accept()
-        elif button == self.buttonBox.button(QDialogButtonBox.Cancel):
+        elif button == self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Cancel
+        ):
             self.__finish(0, 0, giveUp=True)
     
     def __finish(self, exitCode, exitStatus, giveUp=False):
@@ -139,15 +145,18 @@
         """
         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.StandardButton.Close).setEnabled(True)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close).setDefault(True)
         
         if not giveUp:
             if exitCode != 0:
@@ -205,7 +214,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(self.__process.readLine(),
@@ -220,7 +229,7 @@
         It reads the error output of the process and inserts it into the
         error pane.
         """
-        self.__process.setReadChannel(QProcess.StandardError)
+        self.__process.setReadChannel(QProcess.ProcessChannel.StandardError)
         
         while self.__process.canReadLine():
             s = str(self.__process.readLine(),

eric ide

mercurial