UpgradeFirmware.qml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Copyright (c) 2015 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.Window 2.1
  6. import UM 1.1 as UM
  7. Item
  8. {
  9. id: wizardPage
  10. property string title
  11. SystemPalette{id: palette}
  12. UM.I18nCatalog { id: catalog; name:"cura"}
  13. property variant printer_connection: Cura.USBPrinterManager.connectedPrinterList.rowCount() != 0 ? Cura.USBPrinterManager.connectedPrinterList.getItem(0).printer : null
  14. Label
  15. {
  16. id: pageTitle
  17. width: parent.width
  18. text: catalog.i18nc("@title", "Upgrade Firmware")
  19. wrapMode: Text.WordWrap
  20. font.pointSize: 18
  21. }
  22. Label
  23. {
  24. id: pageDescription
  25. anchors.top: pageTitle.bottom
  26. anchors.topMargin: UM.Theme.getSize("default_margin").height
  27. width: parent.width
  28. wrapMode: Text.WordWrap
  29. 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.")
  30. }
  31. Label
  32. {
  33. id: upgradeText1
  34. anchors.top: pageDescription.bottom
  35. anchors.topMargin: UM.Theme.getSize("default_margin").height
  36. width: parent.width
  37. wrapMode: Text.WordWrap
  38. text: catalog.i18nc("@label","The firmware shipping with new Ultimakers works, but upgrades have been made to make better prints, and make calibration easier.");
  39. }
  40. Label
  41. {
  42. id: upgradeText2
  43. anchors.top: upgradeText1.bottom
  44. anchors.topMargin: UM.Theme.getSize("default_margin").height
  45. width: parent.width
  46. wrapMode: Text.WordWrap
  47. 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.");
  48. }
  49. Item{
  50. anchors.top: upgradeText2.bottom
  51. anchors.topMargin: UM.Theme.getSize("default_margin").height
  52. anchors.horizontalCenter: parent.horizontalCenter
  53. width: upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height < wizardPage.width ? upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height : wizardPage.width
  54. Button {
  55. id: upgradeButton
  56. anchors.top: parent.top
  57. anchors.left: parent.left
  58. text: catalog.i18nc("@action:button","Upgrade to Marlin Firmware");
  59. onClicked: Cura.USBPrinterManager.updateAllFirmware()
  60. }
  61. Button {
  62. id: skipUpgradeButton
  63. anchors.top: parent.width < wizardPage.width ? parent.top : upgradeButton.bottom
  64. anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.getSize("default_margin").height/2
  65. anchors.left: parent.width < wizardPage.width ? upgradeButton.right : parent.left
  66. anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
  67. text: catalog.i18nc("@action:button","Skip Upgrade");
  68. onClicked: {
  69. base.currentPage += 1
  70. }
  71. }
  72. }
  73. ExclusiveGroup { id: printerGroup; }
  74. }