UpgradeFirmwareMachineAction.qml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Copyright (c) 2016 Ultimaker B.V.
  2. // Cura is released under the terms of the AGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Layouts 1.1
  6. import QtQuick.Window 2.1
  7. import UM 1.2 as UM
  8. import Cura 1.0 as Cura
  9. Cura.MachineAction
  10. {
  11. anchors.fill: parent;
  12. Item
  13. {
  14. id: upgradeFirmwareMachineAction
  15. anchors.fill: parent;
  16. UM.I18nCatalog { id: catalog; name:"cura"}
  17. Label
  18. {
  19. id: pageTitle
  20. width: parent.width
  21. text: catalog.i18nc("@title", "Upgrade Firmware")
  22. wrapMode: Text.WordWrap
  23. font.pointSize: 18
  24. }
  25. Label
  26. {
  27. id: pageDescription
  28. anchors.top: pageTitle.bottom
  29. anchors.topMargin: UM.Theme.getSize("default_margin").height
  30. width: parent.width
  31. wrapMode: Text.WordWrap
  32. 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.")
  33. }
  34. Label
  35. {
  36. id: upgradeText1
  37. anchors.top: pageDescription.bottom
  38. anchors.topMargin: UM.Theme.getSize("default_margin").height
  39. width: parent.width
  40. wrapMode: Text.WordWrap
  41. text: catalog.i18nc("@label", "The firmware shipping with new Ultimakers works, but upgrades have been made to make better prints, and make calibration easier.");
  42. }
  43. Label
  44. {
  45. id: upgradeText2
  46. anchors.top: upgradeText1.bottom
  47. anchors.topMargin: UM.Theme.getSize("default_margin").height
  48. width: parent.width
  49. wrapMode: Text.WordWrap
  50. 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.");
  51. }
  52. Item
  53. {
  54. anchors.top: upgradeText2.bottom
  55. anchors.topMargin: UM.Theme.getSize("default_margin").height
  56. anchors.horizontalCenter: parent.horizontalCenter
  57. 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
  58. Button
  59. {
  60. id: upgradeButton
  61. anchors.top: parent.top
  62. anchors.left: parent.left
  63. text: catalog.i18nc("@action:button","Upgrade to Marlin Firmware");
  64. onClicked: Cura.USBPrinterManager.updateAllFirmware()
  65. }
  66. Button
  67. {
  68. id: skipUpgradeButton
  69. anchors.top: parent.width < upgradeFirmwareMachineAction.width ? parent.top : upgradeButton.bottom
  70. anchors.topMargin: parent.width < upgradeFirmwareMachineAction.width ? 0 : UM.Theme.getSize("default_margin").height / 2
  71. anchors.left: parent.width < upgradeFirmwareMachineAction.width ? upgradeButton.right : parent.left
  72. anchors.leftMargin: parent.width < upgradeFirmwareMachineAction.width ? UM.Theme.getSize("default_margin").width : 0
  73. text: catalog.i18nc("@action:button", "Skip Upgrade");
  74. onClicked: manager.setFinished()
  75. }
  76. }
  77. }
  78. }