Toolbox.qml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // PluginBrowser 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: 800 * screenScaleFactor
  16. height: 640 * screenScaleFactor
  17. minimumWidth: 800 * screenScaleFactor
  18. maximumWidth: 800 * screenScaleFactor
  19. minimumHeight: 350 * screenScaleFactor
  20. color: UM.Theme.getColor("sidebar")
  21. Item
  22. {
  23. id: view
  24. anchors.fill: parent
  25. ToolboxHeader
  26. {
  27. id: topBar
  28. }
  29. Rectangle
  30. {
  31. id: mainView
  32. width: parent.width
  33. color: "transparent"
  34. anchors
  35. {
  36. top: topBar.bottom
  37. bottom: bottomBar.top
  38. }
  39. ToolboxDownloadsPage
  40. {
  41. id: viewDownloads
  42. visible: manager.currentView != "installed" && manager.detailView == ""
  43. }
  44. ToolboxDetailsPage
  45. {
  46. id: viewDetail
  47. visible: manager.currentView != "installed" && manager.detailView != ""
  48. }
  49. ToolboxInstalledPage
  50. {
  51. id: installedPluginList
  52. visible: manager.currentView == "installed"
  53. }
  54. }
  55. ToolboxShadow
  56. {
  57. anchors
  58. {
  59. top: topBar.bottom
  60. }
  61. }
  62. ToolboxFooter
  63. {
  64. id: bottomBar
  65. }
  66. ToolboxShadow
  67. {
  68. anchors
  69. {
  70. top: bottomBar.top
  71. }
  72. }
  73. UM.I18nCatalog { id: catalog; name: "cura" }
  74. Connections
  75. {
  76. target: manager
  77. onShowLicenseDialog:
  78. {
  79. licenseDialog.pluginName = manager.getLicenseDialogPluginName();
  80. licenseDialog.licenseContent = manager.getLicenseDialogLicenseContent();
  81. licenseDialog.pluginFileLocation = manager.getLicenseDialogPluginFileLocation();
  82. licenseDialog.show();
  83. }
  84. }
  85. Connections
  86. {
  87. target: manager
  88. onShowRestartDialog:
  89. {
  90. restartDialog.message = manager.getRestartDialogMessage();
  91. restartDialog.show();
  92. }
  93. }
  94. ToolboxLicenseDialog
  95. {
  96. id: licenseDialog
  97. }
  98. ToolboxRestartDialog
  99. {
  100. id: restartDialog
  101. }
  102. }
  103. }