Toolbox.qml 2.7 KB

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