From c06ffe6cae5d7bf03e4e3f3bbd143c48d3015d70 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 7 Mar 2017 11:55:29 +0100 Subject: [PATCH] Moved auth state changed check to first thing set auth checks This should contribute to the windows authentication issues. Most windows devices seemed to get all the auth state messages twice. --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 9f0a8b20f5..b89ed58f18 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -327,6 +327,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): ## Set the authentication state. # \param auth_state \type{AuthState} Enum value representing the new auth state def setAuthenticationState(self, auth_state): + if auth_state == self._authentication_state: + return # Nothing to do here. + if auth_state == AuthState.AuthenticationRequested: Logger.log("d", "Authentication state changed to authentication requested.") self.setAcceptsCommands(False) @@ -367,9 +370,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._authentication_timer.stop() self._authentication_counter = 0 - if auth_state != self._authentication_state: - self._authentication_state = auth_state - self.authenticationStateChanged.emit() + self._authentication_state = auth_state + self.authenticationStateChanged.emit() authenticationStateChanged = pyqtSignal()