Toolbox.qml 2.6 KB

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