AboutDialog.qml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. // Copyright (c) 2025 UltiMaker
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.4
  4. import QtQuick.Controls 2.9
  5. import QtQuick.Layouts 1.3
  6. import UM 1.6 as UM
  7. import Cura 1.6 as Cura
  8. UM.Dialog
  9. {
  10. readonly property UM.I18nCatalog catalog: UM.I18nCatalog { name: "cura" }
  11. id: base
  12. title: catalog.i18nc("@title:window The argument is the application name.", "About %1").arg(CuraApplication.applicationDisplayName)
  13. // Flag to toggle between main dependencies information and extensive dependencies information
  14. property bool showDefaultDependencies: true
  15. minimumHeight: 700 * screenScaleFactor
  16. height: minimumHeight
  17. backgroundColor: UM.Theme.getColor("main_background")
  18. headerComponent: Rectangle
  19. {
  20. width: parent.width
  21. height: logo.height + 2 * UM.Theme.getSize("wide_margin").height
  22. color: UM.Theme.getColor("main_window_header_background")
  23. Image
  24. {
  25. id: logo
  26. width: Math.floor(base.width * 0.85)
  27. height: Math.floor(width * UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width)
  28. source: UM.Theme.getImage("logo")
  29. sourceSize.width: width
  30. sourceSize.height: height
  31. fillMode: Image.PreserveAspectFit
  32. anchors.centerIn: parent
  33. }
  34. Image
  35. {
  36. id: enterpriseLogo
  37. visible: CuraApplication.isEnterprise
  38. source: UM.Theme.getImage("enterprise")
  39. fillMode: Image.PreserveAspectFit
  40. anchors.bottom: parent.bottom
  41. }
  42. UM.Label
  43. {
  44. id: version
  45. text: catalog.i18nc("@label","version: %1").arg(CuraApplication.version())
  46. font: UM.Theme.getFont("large_bold")
  47. color: UM.Theme.getColor("button_text")
  48. anchors.right : logo.right
  49. anchors.top: logo.bottom
  50. }
  51. MouseArea
  52. {
  53. anchors.fill: parent
  54. onDoubleClicked: showDefaultDependencies = !showDefaultDependencies
  55. }
  56. }
  57. // Reusable component to display a dependency
  58. readonly property Component dependency_row: RowLayout
  59. {
  60. spacing: UM.Theme.getSize("default_margin").width
  61. UM.Label
  62. {
  63. text: {
  64. if (url !== "") {
  65. return `<a href="${url}">${name}</a>`;
  66. } else {
  67. return name;
  68. }
  69. }
  70. Layout.fillWidth: true
  71. Layout.preferredWidth: 1
  72. onLinkActivated: Qt.openUrlExternally(url)
  73. }
  74. UM.Label
  75. {
  76. text: description
  77. Layout.fillWidth: true
  78. Layout.preferredWidth: 2
  79. }
  80. UM.Label
  81. {
  82. text:
  83. {
  84. if (license_full !== "")
  85. {
  86. return `<a href="license_full">${license}</a>`;
  87. }
  88. else
  89. {
  90. return license;
  91. }
  92. }
  93. Layout.fillWidth: true
  94. Layout.preferredWidth: 1
  95. Component
  96. {
  97. id: componentLicenseDialog
  98. LicenseDialog { }
  99. }
  100. onLinkActivated:
  101. {
  102. var license_dialog = componentLicenseDialog.createObject(base, {name: name, version: version, license: license_full});
  103. license_dialog.open();
  104. }
  105. }
  106. UM.Label
  107. {
  108. text: version
  109. Layout.fillWidth: true
  110. Layout.preferredWidth: 1
  111. }
  112. }
  113. Flickable
  114. {
  115. id: scroll
  116. anchors.fill: parent
  117. ScrollBar.vertical: UM.ScrollBar {
  118. visible: scroll.contentHeight > height
  119. }
  120. contentHeight: content.height
  121. clip: true
  122. Column
  123. {
  124. id: content
  125. spacing: UM.Theme.getSize("default_margin").height
  126. width: parent.width
  127. UM.Label
  128. {
  129. text: catalog.i18nc("@label", "End-to-end solution for fused filament 3D printing.")
  130. font: UM.Theme.getFont("system")
  131. wrapMode: Text.WordWrap
  132. }
  133. UM.Label
  134. {
  135. text: catalog.i18nc("@info:credit", "Cura is developed by UltiMaker in cooperation with the community.\nCura proudly uses the following open source projects:")
  136. font: UM.Theme.getFont("system")
  137. wrapMode: Text.WordWrap
  138. }
  139. Column
  140. {
  141. visible: showDefaultDependencies
  142. width: parent.width
  143. spacing: UM.Theme.getSize("narrow_margin").height
  144. Repeater
  145. {
  146. width: parent.width
  147. delegate: Loader
  148. {
  149. sourceComponent: dependency_row
  150. width: parent.width
  151. property string name: modelData.name
  152. property string description: modelData.summary
  153. property string license: modelData.license
  154. property string license_full: modelData.license_full
  155. property string url: modelData.sources_url
  156. property string version: modelData.version
  157. }
  158. property var dependencies_model: Cura.OpenSourceDependenciesModel {}
  159. model: dependencies_model.dependencies
  160. }
  161. }
  162. UM.Label
  163. {
  164. visible: !showDefaultDependencies
  165. text: "Conan Installs"
  166. font: UM.Theme.getFont("large_bold")
  167. }
  168. Column
  169. {
  170. visible: !showDefaultDependencies
  171. width: parent.width
  172. Repeater
  173. {
  174. width: parent.width
  175. model: Object
  176. .entries(CuraApplication.conanInstalls)
  177. .map(([name, { version }]) => ({ name, version }))
  178. delegate: Loader
  179. {
  180. sourceComponent: dependency_row
  181. width: parent.width
  182. property string name: modelData.name
  183. property string version: modelData.version
  184. property string license: ""
  185. property string license_full: ""
  186. property string url: ""
  187. property string description: ""
  188. }
  189. }
  190. }
  191. UM.Label
  192. {
  193. visible: !showDefaultDependencies
  194. text: "Python Installs"
  195. font: UM.Theme.getFont("large_bold")
  196. }
  197. Column
  198. {
  199. width: parent.width
  200. visible: !showDefaultDependencies
  201. Repeater
  202. {
  203. delegate: Loader
  204. {
  205. sourceComponent: dependency_row
  206. width: parent.width
  207. property string name: modelData.name
  208. property string version: modelData.version
  209. property string license: ""
  210. property string license_full: ""
  211. property string url: ""
  212. property string description: ""
  213. }
  214. width: parent.width
  215. model: Object
  216. .entries(CuraApplication.pythonInstalls)
  217. .map(([name, { version }]) => ({ name, version }))
  218. }
  219. }
  220. }
  221. }
  222. rightButtons: Cura.TertiaryButton
  223. {
  224. id: closeButton
  225. text: catalog.i18nc("@action:button", "Close")
  226. onClicked: reject()
  227. }
  228. }