Fixes problems with the upgraded parts page of the add Original wizard

The setMachineSettingValue functionalities are now bound to whether the checkboxes are checked or not instead of onClicked. Also the wizard now saves the values, so the user cannot get confused when revisiting this part of the wizard.

commits to #143
contributes to #CURA-256
This commit is contained in:
Tamara Hogenhout 2015-10-14 15:00:27 +02:00
parent 861b535f9d
commit f9f0969a6d

View file

@ -14,6 +14,19 @@ Item
SystemPalette{id: palette}
UM.I18nCatalog { id: catalog; name:"cura"}
Component.onDestruction:
{
base.addOriginalProgress.upgrades[0] = extruderCheckBox.checked
base.addOriginalProgress.upgrades[1] = heatedBedCheckBox1.checked
base.addOriginalProgress.upgrades[2] = heatedBedCheckBox2.checked
if (extruderCheckBox.checked == true){
UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true);
}
if (heatedBedCheckBox1.checked == true || heatedBedCheckBox2.checked == true){
UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
}
}
Label
{
id: pageTitle
@ -43,18 +56,17 @@ Item
width: parent.width - UM.Theme.sizes.default_margin.width
CheckBox
{
id: checkBox
id: extruderCheckBox
text: catalog.i18nc("@option:check","Extruder driver ugrades")
checked: true
onClicked: UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true);
checked: base.addOriginalProgress.upgrades[0]
}
CheckBox
{
id: heatedBedCheckBox1
text: catalog.i18nc("@option:check","Heated printer bed (standard kit)")
y: checkBox.height * 1
y: extruderCheckBox.height * 1
checked: base.addOriginalProgress.upgrades[1]
onClicked: {
UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
if (heatedBedCheckBox2.checked == true)
heatedBedCheckBox2.checked = false
}
@ -63,9 +75,9 @@ Item
{
id: heatedBedCheckBox2
text: catalog.i18nc("@option:check","Heated printer bed (self built)")
y: checkBox.height * 2
y: extruderCheckBox.height * 2
checked: base.addOriginalProgress.upgrades[2]
onClicked: {
UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
if (heatedBedCheckBox1.checked == true)
heatedBedCheckBox1.checked = false
}