eric6/E5Gui/E5ProcessDialog.py

changeset 8143
2c730d5fd177
parent 8065
3554ff6fbba5
child 8217
385f60c94548
diff -r 27f636beebad -r 2c730d5fd177 eric6/E5Gui/E5ProcessDialog.py
--- a/eric6/E5Gui/E5ProcessDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/E5Gui/E5ProcessDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -48,8 +48,10 @@
         super(E5ProcessDialog, 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)
         
         font = Preferences.getEditorOtherFonts("MonospacedFont")
         self.resultbox.setFontFamily(font.family())
@@ -77,7 +79,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)
@@ -88,11 +90,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)
     
     def on_buttonBox_clicked(self, button):
         """
@@ -101,9 +107,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.statusLabel.setText(self.tr("Process canceled."))
             self.__finish()
     
@@ -116,10 +126,13 @@
         @param exitStatus exit status of the process
         @type 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(
@@ -256,9 +269,9 @@
         @type bool
         """
         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