Toolbox.qml 3.0 KB

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