DigitalFactoryOpenDialog.qml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright (C) 2021 Ultimaker B.V.
  2. import QtQuick 2.10
  3. import QtQuick.Window 2.2
  4. import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
  5. import QtQuick.Controls 2.3
  6. import QtQuick.Controls.Styles 1.4
  7. import UM 1.2 as UM
  8. import Cura 1.6 as Cura
  9. import DigitalFactory 1.0 as DF
  10. Window
  11. {
  12. id: digitalFactoryOpenDialogBase
  13. title: "Open file from Library"
  14. modality: Qt.ApplicationModal
  15. width: 800 * screenScaleFactor
  16. height: 600 * screenScaleFactor
  17. minimumWidth: 800 * screenScaleFactor
  18. minimumHeight: 600 * screenScaleFactor
  19. Shortcut
  20. {
  21. sequence: "Esc"
  22. onActivated: digitalFactoryOpenDialogBase.close()
  23. }
  24. color: UM.Theme.getColor("main_background")
  25. SelectProjectPage
  26. {
  27. visible: manager.selectedProjectIndex == -1
  28. createNewProjectButtonVisible: false
  29. }
  30. OpenProjectFilesPage
  31. {
  32. visible: manager.selectedProjectIndex >= 0
  33. onOpenFilePressed: digitalFactoryOpenDialogBase.close()
  34. }
  35. BusyIndicator
  36. {
  37. // Shows up while Cura is waiting to receive the user's projects from the digital factory library
  38. id: retrievingProjectsBusyIndicator
  39. anchors {
  40. verticalCenter: parent.verticalCenter
  41. horizontalCenter: parent.horizontalCenter
  42. }
  43. width: parent.width / 4
  44. height: width
  45. visible: manager.retrievingProjectsStatus == DF.RetrievalStatus.InProgress
  46. running: visible
  47. palette.dark: UM.Theme.getColor("text")
  48. }
  49. }