WizardDialog.qml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. color: UM.Theme.getColor("main_background")
  21. property var model: null // Needs to be set by whoever is using this dialog.
  22. property alias progressBarVisible: wizardPanel.progressBarVisible
  23. function resetModelState()
  24. {
  25. model.resetState()
  26. }
  27. WizardPanel
  28. {
  29. id: wizardPanel
  30. anchors.fill: parent
  31. model: dialog.model
  32. }
  33. // Close this dialog when there's no more page to show
  34. Connections
  35. {
  36. target: model
  37. onAllFinished: dialog.hide()
  38. }
  39. }