From f9f0969a6d2ef1ab348ac57e784a6cff65c1ae50 Mon Sep 17 00:00:00 2001 From: Tamara Hogenhout Date: Wed, 14 Oct 2015 15:00:27 +0200 Subject: [PATCH] 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 --- .../qml/WizardPages/SelectUpgradedParts.qml | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/resources/qml/WizardPages/SelectUpgradedParts.qml b/resources/qml/WizardPages/SelectUpgradedParts.qml index 8680a478e9..4e84e61ec6 100644 --- a/resources/qml/WizardPages/SelectUpgradedParts.qml +++ b/resources/qml/WizardPages/SelectUpgradedParts.qml @@ -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 }