src/eric7/EricWidgets/EricProcessDialog.py

branch
eric7
changeset 9958
a78b83d1062a
parent 9653
e67609152c5e
child 10423
299802979277
--- a/src/eric7/EricWidgets/EricProcessDialog.py	Sun Apr 02 11:13:14 2023 +0200
+++ b/src/eric7/EricWidgets/EricProcessDialog.py	Sun Apr 02 15:55:20 2023 +0200
@@ -36,18 +36,32 @@
     the process.
     """
 
-    def __init__(self, outputTitle="", windowTitle="", showProgress=False, parent=None):
+    def __init__(
+        self,
+        outputTitle="",
+        windowTitle="",
+        showProgress=False,
+        showInput=True,
+        combinedOutput=False,
+        parent=None,
+    ):
         """
         Constructor
 
-        @param outputTitle title for the output group
-        @type str
-        @param windowTitle title of the dialog
-        @type str
-        @param showProgress flag indicating to show a progress bar
-        @type bool
-        @param parent reference to the parent widget
-        @type QWidget
+        @param outputTitle title for the output group (defaults to "")
+        @type str (optional)
+        @param windowTitle title of the dialog (defaults to "")
+        @type str (optional)
+        @param showProgress flag indicating to show a progress bar (defaults to False)
+        @type bool (optional)
+        @param showInput flag indicating to allow input to the process (defaults to
+            True)
+        @type bool (optional)
+        @param combinedOutput flag indicating to show output of the stderr channel
+            in the main output pane (defaults to False)
+        @type bool (optional)
+        @param parent reference to the parent widget (defaults to None)
+        @type QWidget (optional)
         """
         super().__init__(parent)
         self.setupUi(self)
@@ -68,6 +82,13 @@
         self.__showProgress = showProgress
         self.progressBar.setVisible(self.__showProgress)
 
+        self.__showInput = showInput
+        self.__combinedOutput = combinedOutput
+
+        if not self.__showInput:
+            self.inputGroup.setEnabled(False)
+            self.inputGroup.hide()
+
         self.__process = None
         self.__progressRe = re.compile(r"""(\d{1,3})\s*%""")
 
@@ -191,7 +212,7 @@
                     program
                 ),
             )
-        else:
+        elif self.__showInput:
             self.inputGroup.setEnabled(True)
             self.inputGroup.show()
 
@@ -255,9 +276,13 @@
                 "replace",
             )
 
-            self.errorGroup.show()
-            self.errors.insertPlainText(s)
-            self.errors.ensureCursorVisible()
+            if self.__combinedOutput:
+                self.resultbox.insertPlainText(s)
+                self.resultbox.ensureCursorVisible()
+            else:
+                self.errorGroup.show()
+                self.errors.insertPlainText(s)
+                self.errors.ensureCursorVisible()
 
             QCoreApplication.processEvents()
 

eric ide

mercurial