diff --git a/cura/Settings/SettingInheritanceManager.py b/cura/Settings/SettingInheritanceManager.py index cf3e7a32f6..5f7a97dd79 100644 --- a/cura/Settings/SettingInheritanceManager.py +++ b/cura/Settings/SettingInheritanceManager.py @@ -34,6 +34,12 @@ class SettingInheritanceManager(QObject): result.append(key) return result + @pyqtSlot(str) + def manualRemoveOverride(self, key): + if key in self._settings_with_inheritance_warning: + self._settings_with_inheritance_warning.remove(key) + self.settingsWithIntheritanceChanged.emit() + def _onActiveExtruderChanged(self): if self._active_container_stack: self._active_container_stack.propertyChanged.disconnect(self._onPropertyChanged) diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index fa90617c24..e28c5d2063 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -59,7 +59,19 @@ Button { visible: { - return Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0; + if(Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0) + { + var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(definition.key) + for(var i = 0; i < children_with_override.length; i++) + { + if(!settingDefinitionsModel.getVisible(children_with_override[i])) + { + return true + } + } + return false + } + return false } height: parent.height / 2 diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index ae216c9bdf..c721af7475 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -151,11 +151,12 @@ ScrollView onHideTooltip: base.hideTooltip() onShowAllHiddenInheritedSettings: { - var test = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(category_id) - for(var i = 0; i < test.length; i++) + var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(category_id) + for(var i = 0; i < children_with_override.length; i++) { - definitionsModel.setVisible(test[i], true) + definitionsModel.setVisible(children_with_override[i], true) } + Cura.SettingInheritanceManager.manualRemoveOverride(category_id) } } }