Force rendering of error messages as plain text

Make the `error_label` widget always render messages as plain text,
instead of auto discovering if the text is rich. We need this because
the error message may contain input from the sandbox, which we consider
untrusted.
This commit is contained in:
Alex Pyrgiotis 2023-07-28 18:44:47 +03:00
parent a72a31980d
commit cb08c198ad
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -988,6 +988,7 @@ class DocumentWidget(QtWidgets.QWidget):
self.error_label = QtWidgets.QLabel() self.error_label = QtWidgets.QLabel()
self.error_label.setAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignLeft) self.error_label.setAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignLeft)
self.error_label.setWordWrap(True) self.error_label.setWordWrap(True)
self.error_label.setTextFormat(QtCore.Qt.PlainText)
self.error_label.hide() # only show on error self.error_label.hide() # only show on error
# Progress bar # Progress bar