Toolbox.qml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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", "Toolbox")
  12. modality: Qt.ApplicationModal
  13. flags: Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
  14. width: 720 * screenScaleFactor
  15. height: 640 * screenScaleFactor
  16. minimumWidth: 720 * screenScaleFactor
  17. maximumWidth: 720 * screenScaleFactor
  18. minimumHeight: 350 * screenScaleFactor
  19. color: UM.Theme.getColor("sidebar")
  20. UM.I18nCatalog
  21. {
  22. id: catalog
  23. name:"cura"
  24. }
  25. Item
  26. {
  27. anchors.fill: parent
  28. ToolboxHeader
  29. {
  30. id: header
  31. }
  32. Item
  33. {
  34. id: mainView
  35. width: parent.width
  36. z: -1
  37. anchors
  38. {
  39. top: header.bottom
  40. bottom: footer.top
  41. }
  42. // TODO: This could be improved using viewFilter instead of viewCategory
  43. ToolboxLoadingPage
  44. {
  45. id: viewLoading
  46. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "loading"
  47. }
  48. ToolboxErrorPage
  49. {
  50. id: viewErrored
  51. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "errored"
  52. }
  53. ToolboxDownloadsPage
  54. {
  55. id: viewDownloads
  56. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "overview"
  57. }
  58. ToolboxDetailPage
  59. {
  60. id: viewDetail
  61. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "detail"
  62. }
  63. ToolboxAuthorPage
  64. {
  65. id: viewAuthor
  66. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "author"
  67. }
  68. ToolboxInstalledPage
  69. {
  70. id: installedPluginList
  71. visible: toolbox.viewCategory == "installed"
  72. }
  73. }
  74. ToolboxFooter
  75. {
  76. id: footer
  77. visible: toolbox.restartRequired
  78. height: toolbox.restartRequired ? UM.Theme.getSize("toolbox_footer").height : 0
  79. }
  80. // TODO: Clean this up:
  81. Connections
  82. {
  83. target: toolbox
  84. onShowLicenseDialog:
  85. {
  86. licenseDialog.pluginName = toolbox.getLicenseDialogPluginName();
  87. licenseDialog.licenseContent = toolbox.getLicenseDialogLicenseContent();
  88. licenseDialog.pluginFileLocation = toolbox.getLicenseDialogPluginFileLocation();
  89. licenseDialog.show();
  90. }
  91. }
  92. ToolboxLicenseDialog
  93. {
  94. id: licenseDialog
  95. }
  96. }
  97. }