eric6/Plugins/DocumentationPlugins/Ericdoc/EricdocExecDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/Plugins/DocumentationPlugins/Ericdoc/EricdocExecDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Plugins/DocumentationPlugins/Ericdoc/EricdocExecDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -37,8 +37,10 @@
         self.setModal(True)
         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.cmdname = cmdname
@@ -99,9 +101,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()
         
     def __finish(self):
@@ -112,17 +118,20 @@
         the user pressed the button.
         """
         if self.process is not None:
-            if self.process.state() != QProcess.NotRunning:
+            if self.process.state() != QProcess.ProcessState.NotRunning:
                 self.process.terminate()
                 QTimer.singleShot(2000, self.process.kill)
                 self.process.waitForFinished(3000)
-            if self.process.exitStatus() == QProcess.CrashExit:
+            if self.process.exitStatus() == QProcess.ExitStatus.CrashExit:
                 self.contents.insertPlainText(
                     self.tr('\n{0} crashed.\n').format(self.cmdname))
         
-        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)
         
         self.process = None
         
@@ -137,7 +146,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(),
@@ -153,7 +162,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():
             self.errorGroup.show()

eric ide

mercurial