Skip to content

Commit

Permalink
Fixes to improve update all extruder setting
Browse files Browse the repository at this point in the history
CURA-10967
  • Loading branch information
saumyaj3 committed Sep 29, 2023
1 parent 88aaf7a commit 3c69f4a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions UM/Settings/Models/SettingPropertyProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,12 @@ def stackLevels(self):
return self._stack_levels

@pyqtSlot(str, "QVariant")
def setPropertyValue(self, property_name, property_value, *, skip_resolve = False):
def setPropertyValue(self, property_name, property_value):
"""Set the value of a property.
:param stack_index: At which level in the stack should this property be set?
:param property_name: The name of the property to set.
:param property_value: The value of the property to set.
:param skip_resolve: to skip resolve function and force property value
"""

if not self._stack or not self._key:
Expand Down Expand Up @@ -221,13 +220,28 @@ def setPropertyValue(self, property_name, property_value, *, skip_resolve = Fals
# the value. Note that we only do this when this is not caused by the calculated state
# In this case the setting does need to be set, as it needs to be stored in the user settings.
self.removeFromContainer(self._store_index)
continue
return
else: # First value that we encountered was different, stop looking & continue as normal.
break

# _remove_unused_value is used when the stack value differs from the effective value
# i.e. there is a resolve function
if self._property_map.value(property_name) == property_value and self._remove_unused_value and not skip_resolve:
if self._property_map.value(property_name) == property_value and self._remove_unused_value:
return

container.setProperty(self._key, property_name, property_value)

@pyqtSlot(str, "QVariant")
def setPropertyValueForce(self, property_name, property_value):
if not self._stack or not self._key:
return

if property_name not in self._watched_properties:
Logger.log("w", "Tried to set a property that is not being watched")
return

container = self._stack.getContainer(self._store_index)
if isinstance(container, DefinitionContainer):
return

container.setProperty(self._key, property_name, property_value)
Expand Down

0 comments on commit 3c69f4a

Please sign in to comment.