diff --git a/plugins/UltimakerMachineActions/BedLevelMachineAction.qml b/plugins/UltimakerMachineActions/BedLevelMachineAction.qml index 8a3bf8d96a..5d1140e03d 100644 --- a/plugins/UltimakerMachineActions/BedLevelMachineAction.qml +++ b/plugins/UltimakerMachineActions/BedLevelMachineAction.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2015 Ultimaker B.V. +// Copyright (c) 2016 Ultimaker B.V. // Cura is released under the terms of the AGPLv3 or higher. import QtQuick 2.2 @@ -10,12 +10,11 @@ import UM 1.2 as UM import Cura 1.0 as Cura -// The action items always need to be wrapped in a component. Cura.MachineAction { Item { - id: wizardPage + id: bedLevelMachineAction anchors.fill: parent; UM.I18nCatalog { id: catalog; name: "cura"; } diff --git a/plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.py b/plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.py new file mode 100644 index 0000000000..7d696a871e --- /dev/null +++ b/plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.py @@ -0,0 +1,6 @@ +from cura.MachineAction import MachineAction + +class UpgradeFirmwareMachineAction(MachineAction): + def __init__(self): + super().__init__("UpgradeFirmware", "Upgrade Firmware") + self._qml_url = "UpgradeFirmwareMachineAction.qml" \ No newline at end of file diff --git a/plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.qml b/plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.qml new file mode 100644 index 0000000000..e4dd43a8d6 --- /dev/null +++ b/plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.qml @@ -0,0 +1,84 @@ +// Copyright (c) 2016 Ultimaker B.V. +// Cura is released under the terms of the AGPLv3 or higher. + +import QtQuick 2.2 +import QtQuick.Controls 1.1 +import QtQuick.Layouts 1.1 +import QtQuick.Window 2.1 + +import UM 1.2 as UM +import Cura 1.0 as Cura + + +Cura.MachineAction +{ + Item + { + id: upgradeFirmwareMachineAction + + UM.I18nCatalog { id: catalog; name:"cura"} + + Label + { + id: pageTitle + width: parent.width + text: catalog.i18nc("@title", "Upgrade Firmware") + wrapMode: Text.WordWrap + font.pointSize: 18 + } + Label + { + id: pageDescription + anchors.top: pageTitle.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + width: parent.width + wrapMode: Text.WordWrap + text: catalog.i18nc("@label", "Firmware is the piece of software running directly on your 3D printer. This firmware controls the step motors, regulates the temperature and ultimately makes your printer work.") + } + + Label + { + id: upgradeText1 + anchors.top: pageDescription.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + width: parent.width + wrapMode: Text.WordWrap + text: catalog.i18nc("@label", "The firmware shipping with new Ultimakers works, but upgrades have been made to make better prints, and make calibration easier."); + } + + Label + { + id: upgradeText2 + anchors.top: upgradeText1.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + width: parent.width + wrapMode: Text.WordWrap + text: catalog.i18nc("@label", "Cura requires these new features and thus your firmware will most likely need to be upgraded. You can do so now."); + } + Item + { + anchors.top: upgradeText2.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.horizontalCenter: parent.horizontalCenter + width: upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height < upgradeFirmwareMachineAction.width ? upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height : upgradeFirmwareMachineAction.width + Button + { + id: upgradeButton + anchors.top: parent.top + anchors.left: parent.left + text: catalog.i18nc("@action:button","Upgrade to Marlin Firmware"); + onClicked: Cura.USBPrinterManager.updateAllFirmware() + } + Button + { + id: skipUpgradeButton + anchors.top: parent.width < upgradeFirmwareMachineAction.width ? parent.top : upgradeButton.bottom + anchors.topMargin: parent.width < upgradeFirmwareMachineAction.width ? 0 : UM.Theme.getSize("default_margin").height / 2 + anchors.left: parent.width < upgradeFirmwareMachineAction.width ? upgradeButton.right : parent.left + anchors.leftMargin: parent.width < upgradeFirmwareMachineAction.width ? UM.Theme.getSize("default_margin").width : 0 + text: catalog.i18nc("@action:button", "Skip Upgrade"); + onClicked: manager.setFinished() + } + } + } +} \ No newline at end of file diff --git a/plugins/UltimakerMachineActions/__init__.py b/plugins/UltimakerMachineActions/__init__.py index 1807fa1f1e..08d6db5076 100644 --- a/plugins/UltimakerMachineActions/__init__.py +++ b/plugins/UltimakerMachineActions/__init__.py @@ -2,6 +2,7 @@ # Cura is released under the terms of the AGPLv3 or higher. from . import BedLevelMachineAction +from . import UpgradeFirmwareMachineAction from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") @@ -18,4 +19,4 @@ def getMetaData(): } def register(app): - return { "machine_action": BedLevelMachineAction.BedLevelMachineAction() } + return { "machine_action": BedLevelMachineAction.BedLevelMachineAction(), "machine_action": UpgradeFirmwareMachineAction.UpgradeFirmwareMachineAction() }