Browse Source

Reset infill line distance when changing density via recommended mode

Otherwise the change has no effect.

Contributes to issue CURA-5324.
Ghostkeeper 6 years ago
parent
commit
02a3067a0c
2 changed files with 9 additions and 0 deletions
  1. 8 0
      cura/Settings/MachineManager.py
  2. 1 0
      resources/qml/SidebarSimple.qml

+ 8 - 0
cura/Settings/MachineManager.py

@@ -981,6 +981,14 @@ class MachineManager(QObject):
             container = extruder.userChanges
             container.setProperty(setting_name, property_name, property_value)
 
+    ##  Reset all setting properties of a setting for all extruders.
+    #   \param setting_name The ID of the setting to reset.
+    @pyqtSlot(str)
+    def resetSettingForAllExtruders(self, setting_name: str) -> None:
+        for key, extruder in self._global_container_stack.extruders.items():
+            container = extruder.userChanges
+            container.removeInstance(setting_name)
+
     @pyqtProperty("QVariantList", notify = globalContainerChanged)
     def currentExtruderPositions(self) -> List[str]:
         if self._global_container_stack is None:

+ 1 - 0
resources/qml/SidebarSimple.qml

@@ -626,6 +626,7 @@ Item
                         if (active_mode == 0 || active_mode == "simple")
                         {
                             Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue)
+                            Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance")
                         }
                     }