mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 21:25:57 +08:00
Show printer in "indeterminate" state when we are not authenticated
CURA-1851
This commit is contained in:
parent
ef36c70d83
commit
d3333540de
@ -162,9 +162,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
# \param auth_state \type{AuthState} Enum value representing the new auth state
|
||||
def setAuthenticationState(self, auth_state):
|
||||
if auth_state == AuthState.AuthenticationRequested:
|
||||
self.setAcceptsCommands(False)
|
||||
self._authentication_requested_message.show()
|
||||
self._authentication_timer.start() # Start timer so auth will fail after a while.
|
||||
elif auth_state == AuthState.Authenticated:
|
||||
self.setAcceptsCommands(True)
|
||||
self._authentication_requested_message.hide()
|
||||
authentication_succeeded_message = Message(i18n_catalog.i18nc("@info:status", "Printer was successfully paired with Cura"))
|
||||
authentication_succeeded_message.show()
|
||||
@ -176,6 +178,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
# Once we are authenticated we need to send all material profiles.
|
||||
self.sendMaterialProfiles()
|
||||
elif auth_state == AuthState.AuthenticationDenied:
|
||||
self.setAcceptsCommands(False)
|
||||
self._authentication_requested_message.hide()
|
||||
authentication_failed_message = Message(i18n_catalog.i18nc("@info:status", "Pairing request failed. This can be either due to a timeout or the printer refused the request."))
|
||||
authentication_failed_message.show()
|
||||
|
Loading…
x
Reference in New Issue
Block a user