Special-case MOTD in showMessage procedures. #709
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, for a MOTD it is natural to use ASCII art but since messages in the chat box are added using QT's HTML-like text fragments, multiple spaces are merged together and the default variable-width font destroys alignment.
Therefore, I propose that when showing a MOTD we escape spaces with
and wrap everything in<code>
tags to select a monospace font.One problem is that MOTD is also used for showing warnings to the user, such as the "new-syncplay-available-motd-message" message. These will also be changed accordingly. If undesired, these warning should be sent in a separate field.
I have only tested this on openSUSE with python 3.11.11 and PySide6 6.8.0.2 so far. I assume that
<code>
tags work in every python QT library since they are supported by the rich text engine (https://doc.qt.io/qtforpython-5/overviews/richtext-html-subset.html#supported-html-subset). Is there a standard way to test for the different QT wrapper libraries that should be supported?