No need to have templates here, we do it directly from the helper methods.
That also leaves us more options regarding callbacks, classes etc.
Helper methods now take an options dictionary (but still can fallback to the
old signature) containing messages, titles, callbacks etc instead of using
positional arguments for that. Switched code over to utilize that new
calling approach.
The user will now be offered a dialog with two choices if a server side update
of the settings is detected while the user has the settings dialog opened and made
local changes: Either reload all changes, effectively overwriting any local changes,
or only set those settings changed on the server that are not also changed locally.
If after a reconnect the server side configuration has changed, we want to reload.
Using the SettingsUpdated event the clients can track the current config hash during
runtime so that no unnecessary reloads during runtime should be demanded.
Readline could still be stuck in a read loop, leading to an exception on Mac
when closing the connection from another thread. This should now be captured
correctly.
Fixes#1021
"Hello" command sent to printer to trigger initial handshake can now be
configured. Commands that _always_ necessitate to be sent with checksum/
line number (e.g. M110 on Marlin) can be configured as such too.
Also fixed an issue causing the "Hello" command to not be actually enqueued
first thing on opening a connection. Seems to not have caused harm in the
wild, but was unintentional.
The GCODE viewer settings callback was not properly called, hence the
viewer was not initialized properly.
Changed prevention of concurrent settings requests to properly handle
the situation where the registered settings callbacks might be extended
through another callback.
If re-creation of the folder fails due to an access error, perform three retries. It might
be caused by the folder being open in the file explorer. Waiting a bit before retrying
seems to do the trick.
See also #1019
Introduced three new events:
* CONNECTING - fired just before starting the connection process
* DISCONNECTING - fired just before starting the (active) disconnection
process
* PRINTER_STATE_CHANGED - fired every time the printer state changes
Also introduced new GCODE script beforePrinterDisconnected, which will
get sent just before the printer gets (actively) disconnected. Also enabled
communication object to wait for the send queue to be emptied before
closing it, in order to allow sending all lines from the disconnect script.
That should fix user settings across multiple SessionUser wrappers. User settings were
previously only copied upon initialization of the SessionUser, with no update later on,
leading to them becoming out of sync with the underlying User instance.
This commit changes SessionUser to delegate method and attribute access for anything
but its own members to delegate to the wrapped User instance instead.
On MacOS, `tempfile.mkdtemp()` doesn't necessarily return a canonical
path (it uses `/private/var` instead of `/var`, but they are the same
thing). Since the `filemanager.storage` module canonicalizes paths,
tests were erroneously failing due to prefix match failures.