Toolbox.qml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 QtQuick.Controls 1.4
  7. import QtQuick.Controls.Styles 1.4
  8. // TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles
  9. import UM 1.1 as UM
  10. Window
  11. {
  12. id: base
  13. title: catalog.i18nc("@title:tab", "Toolbox")
  14. modality: Qt.ApplicationModal
  15. width: 720 * screenScaleFactor
  16. height: 640 * screenScaleFactor
  17. minimumWidth: 720 * screenScaleFactor
  18. maximumWidth: 720 * screenScaleFactor
  19. minimumHeight: 350 * screenScaleFactor
  20. color: UM.Theme.getColor("sidebar")
  21. Item
  22. {
  23. anchors.fill: parent
  24. ToolboxHeader
  25. {
  26. id: header
  27. }
  28. Rectangle
  29. {
  30. id: mainView
  31. width: parent.width
  32. color: "transparent"
  33. anchors
  34. {
  35. top: header.bottom
  36. bottom: footer.top
  37. }
  38. // TODO: This could be improved using viewFilter instead of viewCategory
  39. ToolboxLoadingPage
  40. {
  41. id: viewLoading
  42. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "loading"
  43. }
  44. ToolboxDownloadsPage
  45. {
  46. id: viewDownloads
  47. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "overview"
  48. }
  49. ToolboxDetailPage
  50. {
  51. id: viewDetail
  52. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "detail"
  53. }
  54. ToolboxAuthorPage
  55. {
  56. id: viewAuthor
  57. visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "author"
  58. }
  59. ToolboxInstalledPage
  60. {
  61. id: installedPluginList
  62. visible: toolbox.viewCategory == "installed"
  63. }
  64. }
  65. ToolboxShadow
  66. {
  67. anchors.top: header.bottom
  68. }
  69. ToolboxFooter
  70. {
  71. id: footer
  72. visible: toolbox.restartRequired
  73. height: toolbox.restartRequired ? UM.Theme.getSize("base_unit").height * 5 : 0
  74. }
  75. ToolboxShadow
  76. {
  77. visible: toolbox.restartRequired
  78. anchors.bottom: footer.top
  79. reversed: true
  80. }
  81. UM.I18nCatalog { id: catalog; name: "cura" }
  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. Connections
  94. {
  95. target: toolbox
  96. onShowRestartDialog:
  97. {
  98. restartDialog.message = toolbox.getRestartDialogMessage();
  99. restartDialog.show();
  100. }
  101. }
  102. ToolboxLicenseDialog
  103. {
  104. id: licenseDialog
  105. }
  106. ToolboxRestartDialog
  107. {
  108. id: restartDialog
  109. }
  110. }
  111. }