FirmwareUpdateWindow.qml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.1 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: catalog.i18nc("@title:window","Firmware Update");
  15. Column
  16. {
  17. anchors.fill: parent;
  18. Label
  19. {
  20. anchors
  21. {
  22. left: parent.left;
  23. right: parent.right;
  24. }
  25. text: {
  26. if (manager.progress == 0)
  27. {
  28. //: Firmware update status label
  29. return catalog.i18nc("@label","Starting firmware update, this may take a while.")
  30. }
  31. else if (manager.progress > 99)
  32. {
  33. //: Firmware update status label
  34. return catalog.i18nc("@label","Firmware update completed.")
  35. }
  36. else
  37. {
  38. //: Firmware update status label
  39. return catalog.i18nc("@label","Updating firmware.")
  40. }
  41. }
  42. wrapMode: Text.Wrap;
  43. }
  44. ProgressBar
  45. {
  46. id: prog
  47. value: manager.progress
  48. minimumValue: 0
  49. maximumValue: 100
  50. indeterminate: manager.progress < 100
  51. anchors
  52. {
  53. left: parent.left;
  54. right: parent.right;
  55. }
  56. }
  57. SystemPalette
  58. {
  59. id: palette;
  60. }
  61. UM.I18nCatalog { id: catalog; name: "cura"; }
  62. }
  63. rightButtons: [
  64. Button
  65. {
  66. text: catalog.i18nc("@action:button","Close");
  67. enabled: manager.progress >= 100;
  68. onClicked: base.visible = false;
  69. }
  70. ]
  71. }