Toolbox.qml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. // Main window for the Toolbox
  4. import QtQuick 2.2
  5. import QtQuick.Dialogs 1.1
  6. import QtQuick.Window 2.2
  7. import UM 1.1 as UM
  8. import "./pages"
  9. import "./dialogs"
  10. import "./components"
  11. Window
  12. {
  13. id: base
  14. property var selection: null
  15. title: catalog.i18nc("@title", "Marketplace")
  16. modality: Qt.ApplicationModal
  17. flags: Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
  18. width: UM.Theme.getSize("large_popup_dialog").width
  19. height: UM.Theme.getSize("large_popup_dialog").height
  20. minimumWidth: width
  21. maximumWidth: minimumWidth
  22. minimumHeight: height
  23. maximumHeight: minimumHeight
  24. color: UM.Theme.getColor("main_background")
  25. UM.I18nCatalog
  26. {
  27. id: catalog
  28. name: "cura"
  29. }
  30. Item
  31. {
  32. anchors.fill: parent
  33. WelcomePage
  34. {
  35. visible: toolbox.viewPage === "welcome"
  36. }
  37. ToolboxHeader
  38. {
  39. id: header
  40. visible: toolbox.viewPage !== "welcome"
  41. }
  42. Item
  43. {
  44. id: mainView
  45. width: parent.width
  46. z: parent.z - 1
  47. anchors
  48. {
  49. top: header.bottom
  50. bottom: footer.top
  51. }
  52. // TODO: This could be improved using viewFilter instead of viewCategory
  53. ToolboxLoadingPage
  54. {
  55. id: viewLoading
  56. visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "loading"
  57. }
  58. ToolboxErrorPage
  59. {
  60. id: viewErrored
  61. visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "errored"
  62. }
  63. ToolboxDownloadsPage
  64. {
  65. id: viewDownloads
  66. visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "overview"
  67. }
  68. ToolboxDetailPage
  69. {
  70. id: viewDetail
  71. visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "detail"
  72. }
  73. ToolboxAuthorPage
  74. {
  75. id: viewAuthor
  76. visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "author"
  77. }
  78. ToolboxInstalledPage
  79. {
  80. id: installedPluginList
  81. visible: toolbox.viewCategory === "installed"
  82. }
  83. }
  84. ToolboxFooter
  85. {
  86. id: footer
  87. visible: toolbox.restartRequired
  88. height: visible ? UM.Theme.getSize("toolbox_footer").height : 0
  89. }
  90. Connections
  91. {
  92. target: toolbox
  93. function onShowLicenseDialog() { licenseDialog.show() }
  94. function onCloseLicenseDialog() { licenseDialog.close() }
  95. }
  96. ToolboxLicenseDialog
  97. {
  98. id: licenseDialog
  99. }
  100. }
  101. }