def process_finished(self, exit_code):
format = self.ui.edit_stdout.currentCharFormat()
format.setFontWeight(QFont.Bold)
if exit_code == 0:
if self._interrupted:
color = Qt.red
msg = ('Process interrupted by user')
else:
color = Qt.green
msg = ('Process exited normally')
else:
color = Qt.red
msg = ('Process exited with exit code %d' % exit_code)
format.setForeground(color)
self.ui.edit_stdout.setCurrentCharFormat(format)
self.ui.edit_stdout.appendPlainText(msg)
self.restore_gui()
self.ui.edit_stdout.setTextInteractionFlags(Qt.TextSelectableByMouse |
Qt.TextSelectableByKeyboard)
self.process = None
self.ui.btn_log.setEnabled(self.last_log_file is not None and
os.path.isfile(self.last_log_file))
评论列表
文章目录