Don't cache the automatic firmware name

The QML property was not updated when you change the printer. By not caching it, it gets the current printer's firmware file upon clicking the button. Simple and effective, and not that tough on computational power that it needs caching.

Contributes to issue CURA-5749.
This commit is contained in:
Ghostkeeper 2018-10-12 13:25:34 +02:00
parent 85b835118d
commit 287689a073
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -1,4 +1,4 @@
// Copyright (c) 2016 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
@ -58,7 +58,6 @@ Cura.MachineAction
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: childrenRect.width width: childrenRect.width
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
property var firmwareName: Cura.USBPrinterManager.getDefaultFirmwareName()
Button Button
{ {
id: autoUpgradeButton id: autoUpgradeButton
@ -66,7 +65,7 @@ Cura.MachineAction
enabled: parent.firmwareName != "" && activeOutputDevice enabled: parent.firmwareName != "" && activeOutputDevice
onClicked: onClicked:
{ {
activeOutputDevice.updateFirmware(parent.firmwareName) activeOutputDevice.updateFirmware(Cura.USBPrinterManager.getDefaultFirmwareName())
} }
} }
Button Button