mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 20:19:32 +08:00
Moved authentication request state change
This commit is contained in:
parent
2810054f8e
commit
db1fb8e692
@ -855,7 +855,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
url = QUrl("http://" + self._address + self._api_prefix + "auth/request")
|
url = QUrl("http://" + self._address + self._api_prefix + "auth/request")
|
||||||
request = QNetworkRequest(url)
|
request = QNetworkRequest(url)
|
||||||
request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||||
self.setAuthenticationState(AuthState.AuthenticationRequested)
|
|
||||||
self._manager.post(request, json.dumps({"application": "Cura-" + Application.getInstance().getVersion(), "user": self._getUserName()}).encode())
|
self._manager.post(request, json.dumps({"application": "Cura-" + Application.getInstance().getVersion(), "user": self._getUserName()}).encode())
|
||||||
|
|
||||||
## Send all material profiles to the printer.
|
## Send all material profiles to the printer.
|
||||||
@ -1036,7 +1035,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
if "/auth/request" in reply_url:
|
if "/auth/request" in reply_url:
|
||||||
# We got a response to requesting authentication.
|
# We got a response to requesting authentication.
|
||||||
data = json.loads(bytes(reply.readAll()).decode("utf-8"))
|
data = json.loads(bytes(reply.readAll()).decode("utf-8"))
|
||||||
|
self.setAuthenticationState(AuthState.AuthenticationRequested)
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
if global_container_stack: # Remove any old data.
|
if global_container_stack: # Remove any old data.
|
||||||
Logger.log("d", "Removing old network authentication data as a new one was requested.")
|
Logger.log("d", "Removing old network authentication data as a new one was requested.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user