7 Module implementing a dialog to show the output of the ericdoc process. |
7 Module implementing a dialog to show the output of the ericdoc 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 ericdoc process. |
23 Class implementing a dialog to show the output of the ericdoc 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 documentation generator (string) |
37 @param cmdname name of the documentation 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 |
128 self.process = None |
132 self.process = None |
129 |
133 |
130 self.contents.insertPlainText(self.tr("\n{0} finished.\n").format(self.cmdname)) |
134 self.contents.insertPlainText(self.tr("\n{0} finished.\n").format(self.cmdname)) |
131 self.contents.ensureCursorVisible() |
135 self.contents.ensureCursorVisible() |
132 |
136 |
|
137 self.processFinished.emit() |
|
138 |
133 def __readStdout(self): |
139 def __readStdout(self): |
134 """ |
140 """ |
135 Private slot to handle the readyReadStandardOutput signal. |
141 Private slot to handle the readyReadStandardOutput signal. |
136 |
142 |
137 It reads the output of the process, formats it and inserts it into |
143 It reads the output of the process, formats it and inserts it into |