Implement warning message when you change material diameter

The undo functionality currently gives an error though. Investigating...

Contributes to issue CURA-2822.
This commit is contained in:
Ghostkeeper 2017-06-22 12:01:42 +02:00
parent 121bf5897d
commit b37fa6f718
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
3 changed files with 73 additions and 3 deletions

View file

@ -1,5 +1,5 @@
// Copyright (c) 2016 Ultimaker B.V.
// Uranium is released under the terms of the AGPLv3 or higher.
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 1.3
@ -168,8 +168,13 @@ TabView
{
// This does not use a SettingPropertyProvider, because we need to make the change to all containers
// which derive from the same base_file
var old_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "properties/diameter");
base.setMetaDataEntry("approximate_diameter", properties.approximate_diameter, Math.round(value).toString());
base.setMetaDataEntry("properties/diameter", properties.diameter, value);
if (Cura.MachineManager.filterMaterialsByMachine && properties.approximate_diameter != Math.round(Cura.MachineManager.activeMachine.approximateMaterialDiameter).toString())
{
Cura.MaterialManager.showMaterialWarningMessage(base.containerId, old_diameter);
}
Cura.ContainerManager.setContainerProperty(base.containerId, "material_diameter", "value", value);
}
onValueChanged: updateCostPerMeter()