WizardDialog.qml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. minimumWidth: 580 * screenScaleFactor
  18. minimumHeight: 600 * screenScaleFactor
  19. color: UM.Theme.getColor("main_background")
  20. property var model: null // Needs to be set by whoever is using this dialog.
  21. onVisibilityChanged:
  22. {
  23. if (visible)
  24. {
  25. model.resetState()
  26. }
  27. }
  28. WizardPanel
  29. {
  30. id: wizardPanel
  31. anchors.fill: parent
  32. model: dialog.model
  33. }
  34. // Close this dialog when there's no more page to show
  35. Connections
  36. {
  37. target: model
  38. onAllFinished: dialog.hide()
  39. }
  40. }