Fixed the firmware update for USB print

CL-541
This commit is contained in:
Jaime van Kessel 2017-12-19 15:59:21 +01:00
parent a35f665201
commit 32cbd27b70
5 changed files with 171 additions and 51 deletions

View file

@ -14,6 +14,9 @@ import Cura 1.0 as Cura
Cura.MachineAction
{
anchors.fill: parent;
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property var activeOutputDevice: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
Item
{
id: upgradeFirmwareMachineAction
@ -60,16 +63,17 @@ Cura.MachineAction
{
id: autoUpgradeButton
text: catalog.i18nc("@action:button", "Automatically upgrade Firmware");
enabled: parent.firmwareName != ""
enabled: parent.firmwareName != "" && activeOutputDevice
onClicked:
{
Cura.USBPrinterManager.updateAllFirmware(parent.firmwareName)
activeOutputDevice.updateFirmware(parent.firmwareName)
}
}
Button
{
id: manualUpgradeButton
text: catalog.i18nc("@action:button", "Upload custom Firmware");
enabled: activeOutputDevice != null
onClicked:
{
customFirmwareDialog.open()
@ -83,7 +87,7 @@ Cura.MachineAction
title: catalog.i18nc("@title:window", "Select custom firmware")
nameFilters: "Firmware image files (*.hex)"
selectExisting: true
onAccepted: Cura.USBPrinterManager.updateAllFirmware(fileUrl)
onAccepted: activeOutputDevice.updateFirmware(fileUrl)
}
}
}