Don't forget to update approximate diameter after resetting actual diameter

The approximate diameter needs to be in a static field because the list model filters on that field. The filter function is not clever enough to be able to filter on values being in some kind of range or rounded, so instead the decision was made that the rounded value needs to be set in a separate field so that the static filter can filter on it.

Contributes to issue CURA-2822.
This commit is contained in:
Ghostkeeper 2017-06-29 16:55:47 +02:00
parent b8b23055ba
commit bb79e33ad5
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -49,6 +49,8 @@ class MaterialManager(QObject):
if button == "Undo":
container_manager = ContainerManager.getInstance()
container_manager.setContainerMetaDataEntry(self._material_diameter_warning_message.material_id, "properties/diameter", self._material_diameter_warning_message.previous_diameter)
approximate_previous_diameter = str(round(float(self._material_diameter_warning_message.previous_diameter)))
container_manager.setContainerMetaDataEntry(self._material_diameter_warning_message.material_id, "approximate_diameter", approximate_previous_diameter)
message.hide()
else:
Logger.log("w", "Unknown button action for material diameter warning message: {action}".format(action = button))