mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 12:03:57 -06:00
CURA-4400 force update all settings if something changed with the extruder
This commit is contained in:
parent
00a173b1bf
commit
8ebd778224
1 changed files with 9 additions and 0 deletions
|
@ -772,6 +772,7 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
# Signal that the global stack has changed
|
# Signal that the global stack has changed
|
||||||
Application.getInstance().globalContainerStackChanged.emit()
|
Application.getInstance().globalContainerStackChanged.emit()
|
||||||
|
self.forceUpdateAllSettings()
|
||||||
|
|
||||||
@pyqtSlot(int, result = QObject)
|
@pyqtSlot(int, result = QObject)
|
||||||
def getExtruder(self, position: int):
|
def getExtruder(self, position: int):
|
||||||
|
@ -804,6 +805,12 @@ class MachineManager(QObject):
|
||||||
def defaultExtruderPosition(self):
|
def defaultExtruderPosition(self):
|
||||||
return self._default_extruder_position
|
return self._default_extruder_position
|
||||||
|
|
||||||
|
## This will fire the propertiesChanged for all settings so they will be updated in the front-end
|
||||||
|
def forceUpdateAllSettings(self):
|
||||||
|
property_names = ["value", "resolve"]
|
||||||
|
for setting_key in self._global_container_stack.getAllKeys():
|
||||||
|
self._global_container_stack.propertiesChanged.emit(setting_key, property_names)
|
||||||
|
|
||||||
@pyqtSlot(int, bool)
|
@pyqtSlot(int, bool)
|
||||||
def setExtruderEnabled(self, position: int, enabled) -> None:
|
def setExtruderEnabled(self, position: int, enabled) -> None:
|
||||||
extruder = self.getExtruder(position)
|
extruder = self.getExtruder(position)
|
||||||
|
@ -814,6 +821,8 @@ class MachineManager(QObject):
|
||||||
self.extruderChanged.emit()
|
self.extruderChanged.emit()
|
||||||
# update items in SettingExtruder
|
# update items in SettingExtruder
|
||||||
ExtruderManager.getInstance().extrudersChanged.emit(self._global_container_stack.getId())
|
ExtruderManager.getInstance().extrudersChanged.emit(self._global_container_stack.getId())
|
||||||
|
# Make sure the front end reflects changes
|
||||||
|
self.forceUpdateAllSettings()
|
||||||
|
|
||||||
def _onMachineNameChanged(self):
|
def _onMachineNameChanged(self):
|
||||||
self.globalContainerChanged.emit()
|
self.globalContainerChanged.emit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue