WizardDialog.qml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright (c) 2019 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import QtQuick.Window 2.2
  6. import UM 1.3 as UM
  7. import Cura 1.1 as Cura
  8. //
  9. // This is a dialog for showing a set of processes that's defined in a WelcomePagesModel or some other Qt ListModel with
  10. // a compatible interface.
  11. //
  12. Window
  13. {
  14. UM.I18nCatalog { id: catalog; name: "cura" }
  15. id: dialog
  16. flags: Qt.Dialog
  17. modality: Qt.ApplicationModal
  18. minimumWidth: UM.Theme.getSize("modal_window_minimum").width
  19. minimumHeight: UM.Theme.getSize("modal_window_minimum").height
  20. maximumWidth: minimumWidth
  21. maximumHeight: minimumHeight
  22. color: UM.Theme.getColor("main_background")
  23. property var model: null // Needs to be set by whoever is using this dialog.
  24. property alias progressBarVisible: wizardPanel.progressBarVisible
  25. function resetModelState()
  26. {
  27. model.resetState()
  28. }
  29. WizardPanel
  30. {
  31. id: wizardPanel
  32. anchors.fill: parent
  33. model: dialog.model
  34. visible: dialog.visible
  35. }
  36. // Close this dialog when there's no more page to show
  37. Connections
  38. {
  39. target: model
  40. function onAllFinished() { dialog.hide() }
  41. }
  42. }