From 038a5b5942d2858c004f223ace3ce4840846dd0d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 2 May 2019 08:46:46 +0200 Subject: [PATCH 1/4] Fix background of g-code text boxes having zero size --- resources/qml/MachineSettings/GcodeTextArea.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/MachineSettings/GcodeTextArea.qml b/resources/qml/MachineSettings/GcodeTextArea.qml index d1f8f51f01..3914687fc8 100644 --- a/resources/qml/MachineSettings/GcodeTextArea.qml +++ b/resources/qml/MachineSettings/GcodeTextArea.qml @@ -69,6 +69,7 @@ UM.TooltipArea background: Rectangle { color: UM.Theme.getColor("main_background") + anchors.fill: parent border.color: { From b9d8b8911310251af965ec0387f515570c4061c3 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 2 May 2019 09:03:48 +0200 Subject: [PATCH 2/4] Fix number of extruders not being updated --- .../MachineSettingsPrinterTab.qml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml index 007db41f2b..3b31a5de36 100644 --- a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml +++ b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml @@ -285,18 +285,30 @@ Item optionModel: ListModel { id: extruderCountModel + Component.onCompleted: { - extruderCountModel.clear() + update() + } + + function update() + { + clear() for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++) { // Use String as value. JavaScript only has Number. PropertyProvider.setPropertyValue() // takes a QVariant as value, and Number gets translated into a float. This will cause problem // for integer settings such as "Number of Extruders". - extruderCountModel.append({ text: String(i), value: String(i) }) + append({ text: String(i), value: String(i) }) } } } + + Connections + { + target: Cura.MachineManager + onGlobalContainerChanged: extruderCountModel.update() + } } } } From 5fee82bcb76a62865d67033593a0fc870c16fe2d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 2 May 2019 09:44:15 +0200 Subject: [PATCH 3/4] Fix machine settings page CURA-6495 --- cura/Machines/Models/FirstStartMachineActionsModel.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cura/Machines/Models/FirstStartMachineActionsModel.py b/cura/Machines/Models/FirstStartMachineActionsModel.py index aad5372cde..240571e6dc 100644 --- a/cura/Machines/Models/FirstStartMachineActionsModel.py +++ b/cura/Machines/Models/FirstStartMachineActionsModel.py @@ -35,6 +35,8 @@ class FirstStartMachineActionsModel(ListModel): self._application = application self._application.initializationFinished.connect(self._initialize) + self._previous_global_stack = None + def _initialize(self) -> None: self._application.getMachineManager().globalContainerChanged.connect(self._update) self._update() @@ -86,6 +88,12 @@ class FirstStartMachineActionsModel(ListModel): self.setItems([]) return + # Do not update if the machine has not been switched. This can cause the SettingProviders on the Machine + # Setting page to do a force update, but they can use potential outdated cached values. + if self._previous_global_stack is not None and global_stack.getId() == self._previous_global_stack.getId(): + return + self._previous_global_stack = global_stack + definition_id = global_stack.definition.getId() first_start_actions = self._application.getMachineActionManager().getFirstStartActions(definition_id) From d0cc2dc8fa08f8407b2ea0f752b2a3bf69090972 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 2 May 2019 12:47:46 +0200 Subject: [PATCH 4/4] Remove unneeded TODO CURA-6495 --- resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml b/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml index 236f9a7dd0..2eaaed4524 100644 --- a/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml +++ b/resources/qml/MachineSettings/PrintHeadMinMaxTextField.qml @@ -76,6 +76,4 @@ NumericTextFieldWithUnit forceUpdateOnChangeFunction() } } - - // TODO: add forceUpdateOnChangeFunction: }