FirmwareUpdateWindow.qml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.Window 2.2
  5. import QtQuick.Controls 1.2
  6. import UM 1.0 as UM
  7. UM.Dialog
  8. {
  9. id: base;
  10. width: 500 * Screen.devicePixelRatio;
  11. height: 100 * Screen.devicePixelRatio;
  12. visible: true;
  13. modality: Qt.ApplicationModal;
  14. title: "Firmware Update";
  15. Column
  16. {
  17. anchors.fill: parent;
  18. Text
  19. {
  20. anchors {
  21. left: parent.left;
  22. right: parent.right;
  23. }
  24. text: {
  25. if (manager.progress == 0)
  26. {
  27. //: Firmware update status label
  28. return qsTr("Starting firmware update, this may take a while.")
  29. }
  30. else if (manager.progress > 99)
  31. {
  32. //: Firmware update status label
  33. return qsTr("Firmware update completed.")
  34. }
  35. else
  36. {
  37. //: Firmware update status label
  38. return qsTr("Updating firmware.")
  39. }
  40. }
  41. wrapMode: Text.Wrap;
  42. }
  43. ProgressBar
  44. {
  45. id: prog;
  46. value: manager.progress
  47. minimumValue: 0;
  48. maximumValue: 100;
  49. anchors {
  50. left: parent.left;
  51. right: parent.right;
  52. }
  53. }
  54. SystemPalette {
  55. id: palette;
  56. }
  57. }
  58. rightButtons: [
  59. Button {
  60. text: "Close";
  61. enabled: manager.progress >= 100;
  62. onClicked: base.visible = false;
  63. }
  64. ]
  65. }