mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Don't change metadata if there is no global stack
We'll miss that status update then, but the next time Cura starts it'll update the printer status anyway. Found during testing of CURA-8591.
This commit is contained in:
parent
c8ed3634ed
commit
ec5bb444c0
1 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2021 Ultimaker B.V.
|
||||
# Copyright (c) 2022 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from enum import IntEnum
|
||||
|
@ -137,7 +137,11 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
"""
|
||||
if self.connectionState != connection_state:
|
||||
self._connection_state = connection_state
|
||||
cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack().setMetaDataEntry("is_online", self.isConnected())
|
||||
application = cura.CuraApplication.CuraApplication.getInstance()
|
||||
if application is not None: # Might happen during the closing of Cura or in a test.
|
||||
global_stack = application.getGlobalContainerStack()
|
||||
if global_stack is not None:
|
||||
global_stack.setMetaDataEntry("is_online", self.isConnected())
|
||||
self.connectionStateChanged.emit(self._id)
|
||||
|
||||
@pyqtProperty(int, constant = True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue