mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Added property to indicate if output device accepts commands
Instead of how this was previously done, it's now tied to the auth state. CL-541
This commit is contained in:
parent
0b91112d72
commit
1c2c4d4163
3 changed files with 25 additions and 0 deletions
|
@ -65,6 +65,15 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
self._compressing_gcode = False
|
||||
self._gcode = []
|
||||
|
||||
self.authenticationStateChanged.connect(self._onAuthenticationStateChanged)
|
||||
|
||||
def _onAuthenticationStateChanged(self):
|
||||
# We only accept commands if we are authenticated.
|
||||
if self._authentication_state == AuthState.Authenticated:
|
||||
self.setAcceptsCommands(True)
|
||||
else:
|
||||
self.setAcceptsCommands(False)
|
||||
|
||||
def _setupMessages(self):
|
||||
self._authentication_requested_message = Message(i18n_catalog.i18nc("@info:status",
|
||||
"Access to the printer requested. Please approve the request on the printer"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue