7 Module implementing a dialog to show the output of the ericapi process. |
7 Module implementing a dialog to show the output of the ericapi process. |
8 """ |
8 """ |
9 |
9 |
10 import os.path |
10 import os.path |
11 |
11 |
12 from PyQt6.QtCore import QProcess, QTimer |
12 from PyQt6.QtCore import QProcess, Qt, QTimer, pyqtSignal |
13 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
13 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
14 |
14 |
15 from eric7 import Preferences |
15 from eric7 import Preferences |
16 from eric7.EricWidgets import EricMessageBox |
16 from eric7.EricWidgets import EricMessageBox |
17 |
17 |
22 """ |
22 """ |
23 Class implementing a dialog to show the output of the ericapi process. |
23 Class implementing a dialog to show the output of the ericapi process. |
24 |
24 |
25 This class starts a QProcess and displays a dialog that |
25 This class starts a QProcess and displays a dialog that |
26 shows the output of the documentation command process. |
26 shows the output of the documentation command process. |
|
27 |
|
28 @signal processFinished() emitted to indicate the eric7_doc process finished |
27 """ |
29 """ |
|
30 |
|
31 processFinished = pyqtSignal() |
28 |
32 |
29 def __init__(self, cmdname, parent=None): |
33 def __init__(self, cmdname, parent=None): |
30 """ |
34 """ |
31 Constructor |
35 Constructor |
32 |
36 |
33 @param cmdname name of the ericapi generator (string) |
37 @param cmdname name of the ericapi generator (string) |
34 @param parent parent widget of this dialog (QWidget) |
38 @param parent parent widget of this dialog (QWidget) |
35 """ |
39 """ |
36 super().__init__(parent) |
40 super().__init__(parent) |
37 self.setModal(True) |
|
38 self.setupUi(self) |
41 self.setupUi(self) |
|
42 self.setWindowFlags(Qt.WindowType.Window) |
39 |
43 |
40 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False) |
44 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False) |
41 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
45 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
42 |
46 |
43 self.process = None |
47 self.process = None |
126 self.process = None |
130 self.process = None |
127 |
131 |
128 self.contents.insertPlainText(self.tr("\n{0} finished.\n").format(self.cmdname)) |
132 self.contents.insertPlainText(self.tr("\n{0} finished.\n").format(self.cmdname)) |
129 self.contents.ensureCursorVisible() |
133 self.contents.ensureCursorVisible() |
130 |
134 |
|
135 self.processFinished.emit() |
|
136 |
131 def __readStdout(self): |
137 def __readStdout(self): |
132 """ |
138 """ |
133 Private slot to handle the readyReadStandardOutput signal. |
139 Private slot to handle the readyReadStandardOutput signal. |
134 |
140 |
135 It reads the output of the process, formats it and inserts it into |
141 It reads the output of the process, formats it and inserts it into |