mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
_settingIsOverwritingInheritance now also checks if there is a non setting value before it
CURA-2361
This commit is contained in:
parent
4f547fff8d
commit
6d2520ffbb
1 changed files with 9 additions and 4 deletions
|
@ -126,17 +126,22 @@ class SettingInheritanceManager(QObject):
|
|||
while stack:
|
||||
containers.extend(stack.getContainers())
|
||||
stack = stack.getNextStack()
|
||||
|
||||
has_non_function_value = False
|
||||
for container in containers:
|
||||
try:
|
||||
has_setting_function = isinstance(container.getProperty(key, "value"), UM.Settings.SettingFunction)
|
||||
value = container.getProperty(key, "value")
|
||||
if value is not None:
|
||||
has_setting_function = isinstance(value, UM.Settings.SettingFunction)
|
||||
if has_setting_function is False:
|
||||
has_non_function_value = True
|
||||
continue
|
||||
except AttributeError:
|
||||
continue
|
||||
if has_setting_function:
|
||||
break # There is a setting function somehwere, stop looking deeper.
|
||||
break # There is a setting function somewhere, stop looking deeper.
|
||||
|
||||
## Also check if the top container is not a setting function (this happens if the inheritance is restored).
|
||||
return has_setting_function and not isinstance(self._active_container_stack.getTop().getProperty(key, "value"), UM.Settings.SettingFunction)
|
||||
return has_setting_function and not isinstance(self._active_container_stack.getTop().getProperty(key, "value"), UM.Settings.SettingFunction) and has_non_function_value
|
||||
|
||||
def _update(self):
|
||||
self._settings_with_inheritance_warning = [] # Reset previous data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue