mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-10 00:49:02 +08:00
Added signal for validation state
This improves the runtime speed somewhat CURA-1585
This commit is contained in:
parent
7b87143e65
commit
5faf2f024f
@ -43,11 +43,14 @@ class MachineManagerModel(QObject):
|
|||||||
activeVariantChanged = pyqtSignal()
|
activeVariantChanged = pyqtSignal()
|
||||||
activeQualityChanged = pyqtSignal()
|
activeQualityChanged = pyqtSignal()
|
||||||
|
|
||||||
globalValueChanged = pyqtSignal() # Emitted whenever a property inside global container is changed.
|
globalValueChanged = pyqtSignal() # Emitted whenever a value inside global container is changed.
|
||||||
|
globalValidationChanged = pyqtSignal() # Emitted whenever a validation inside global container is changed.
|
||||||
|
|
||||||
def _onGlobalPropertyChanged(self, key, property_name):
|
def _onGlobalPropertyChanged(self, key, property_name):
|
||||||
if property_name == "value":
|
if property_name == "value":
|
||||||
self.globalValueChanged.emit()
|
self.globalValueChanged.emit()
|
||||||
|
if property_name == "validationState":
|
||||||
|
self.globalValidationChanged.emit()
|
||||||
|
|
||||||
def _onGlobalContainerChanged(self):
|
def _onGlobalContainerChanged(self):
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
@ -196,7 +199,7 @@ class MachineManagerModel(QObject):
|
|||||||
user_settings = self._global_container_stack.getTop().findInstances(**{})
|
user_settings = self._global_container_stack.getTop().findInstances(**{})
|
||||||
return len(user_settings) != 0
|
return len(user_settings) != 0
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = globalValueChanged)
|
@pyqtProperty(bool, notify = globalValidationChanged)
|
||||||
def isGlobalStackValid(self):
|
def isGlobalStackValid(self):
|
||||||
return not self._checkStackForErrors(self._global_container_stack)
|
return not self._checkStackForErrors(self._global_container_stack)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user