AboutDialog.qml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. // Copyright (c) 2022 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 UM 1.6 as UM
  6. import Cura 1.5 as Cura
  7. UM.Dialog
  8. {
  9. id: base
  10. //: About dialog title
  11. title: catalog.i18nc("@title:window The argument is the application name.", "About %1").arg(CuraApplication.applicationDisplayName)
  12. minimumWidth: 500 * screenScaleFactor
  13. minimumHeight: 700 * screenScaleFactor
  14. width: minimumWidth
  15. height: minimumHeight
  16. backgroundColor: UM.Theme.getColor("main_background")
  17. property real dialogX: base.x
  18. property real dialogY: base.y
  19. property int shakeDetected: (shakeDetector.shakeIsdetected)
  20. property UM.ShakeDetector shakeDetector: UM.ShakeDetector{ }
  21. readonly property Timer timer : Timer
  22. {
  23. interval: 100 // Update interval in milliseconds (adjust as needed)
  24. running: onDialogXChanged || onDialogYChanged
  25. repeat: true
  26. onTriggered:
  27. {
  28. shakeDetector.checkForShake(dialogX, dialogY)
  29. }
  30. }
  31. Rectangle
  32. {
  33. id: header
  34. width: parent.width + 2 * margin // margin from Dialog.qml
  35. height: childrenRect.height + topPadding
  36. anchors.top: parent.top
  37. anchors.topMargin: -margin
  38. anchors.horizontalCenter: parent.horizontalCenter
  39. property real topPadding: UM.Theme.getSize("wide_margin").height
  40. color: UM.Theme.getColor("main_window_header_background")
  41. Image
  42. {
  43. id: logo
  44. width: (base.minimumWidth * 0.85) | 0
  45. height: (width * (UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width)) | 0
  46. source: UM.Theme.getImage("logo")
  47. sourceSize.width: width
  48. sourceSize.height: height
  49. fillMode: Image.PreserveAspectFit
  50. anchors.top: parent.top
  51. anchors.topMargin: parent.topPadding
  52. anchors.horizontalCenter: parent.horizontalCenter
  53. UM.I18nCatalog{id: catalog; name: "cura"}
  54. }
  55. UM.Label
  56. {
  57. id: version
  58. text: catalog.i18nc("@label","version: %1").arg(UM.Application.version)
  59. font: UM.Theme.getFont("large_bold")
  60. color: UM.Theme.getColor("button_text")
  61. anchors.right : logo.right
  62. anchors.top: logo.bottom
  63. anchors.topMargin: (UM.Theme.getSize("default_margin").height / 2) | 0
  64. }
  65. }
  66. UM.Label
  67. {
  68. id: description
  69. width: parent.width
  70. //: About dialog application description
  71. text: catalog.i18nc("@label","End-to-end solution for fused filament 3D printing.")
  72. font: UM.Theme.getFont("system")
  73. wrapMode: Text.WordWrap
  74. anchors.top: header.bottom
  75. anchors.topMargin: UM.Theme.getSize("default_margin").height
  76. }
  77. UM.Label
  78. {
  79. id: creditsNotes
  80. width: parent.width
  81. //: About dialog application author note
  82. text: catalog.i18nc("@info:credit","Cura is developed by UltiMaker in cooperation with the community.\nCura proudly uses the following open source projects:")
  83. font: UM.Theme.getFont("system")
  84. wrapMode: Text.WordWrap
  85. anchors.top: description.bottom
  86. anchors.topMargin: UM.Theme.getSize("default_margin").height
  87. }
  88. ListView
  89. {
  90. id: projectsList
  91. anchors.top: creditsNotes.bottom
  92. anchors.topMargin: UM.Theme.getSize("default_margin").height
  93. width: parent.width
  94. height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)
  95. ScrollBar.vertical: UM.ScrollBar
  96. {
  97. id: projectsListScrollBar
  98. }
  99. delegate: Row
  100. {
  101. spacing: UM.Theme.getSize("narrow_margin").width
  102. UM.Label
  103. {
  104. text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
  105. width: (projectsList.width * 0.25) | 0
  106. elide: Text.ElideRight
  107. onLinkActivated: Qt.openUrlExternally(link)
  108. }
  109. UM.Label
  110. {
  111. text: model.description
  112. elide: Text.ElideRight
  113. width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width
  114. }
  115. UM.Label
  116. {
  117. text: model.license
  118. elide: Text.ElideRight
  119. width: (projectsList.width * 0.15) | 0
  120. }
  121. }
  122. model: ListModel
  123. {
  124. id: projectsModel
  125. }
  126. Component.onCompleted:
  127. {
  128. //Do NOT add dependencies of our dependencies here, nor CI-dependencies!
  129. //UltiMaker's own projects and forks.
  130. projectsModel.append({ name: "Cura", description: catalog.i18nc("@label Description for application component", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" });
  131. projectsModel.append({ name: "Uranium", description: catalog.i18nc("@label Description for application component", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" });
  132. projectsModel.append({ name: "CuraEngine", description: catalog.i18nc("@label Description for application component", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" });
  133. projectsModel.append({ name: "libArcus", description: catalog.i18nc("@label Description for application component", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" });
  134. projectsModel.append({ name: "pynest2d", description: catalog.i18nc("@label Description for application component", "Python bindings for libnest2d"), license: "LGPL", url: "https://github.com/Ultimaker/pynest2d" });
  135. projectsModel.append({ name: "libnest2d", description: catalog.i18nc("@label Description for application component", "Polygon packing library, developed by Prusa Research"), license: "LGPL", url: "https://github.com/tamasmeszaros/libnest2d" });
  136. projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label Description for application component", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" });
  137. projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label Description for application component", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" });
  138. //Direct dependencies of the front-end.
  139. projectsModel.append({ name: "Python", description: catalog.i18nc("@label Description for application dependency", "Programming language"), license: "Python", url: "http://python.org/" });
  140. projectsModel.append({ name: "Qt6", description: catalog.i18nc("@label Description for application dependency", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" });
  141. projectsModel.append({ name: "PyQt", description: catalog.i18nc("@label Description for application dependency", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" });
  142. projectsModel.append({ name: "SIP", description: catalog.i18nc("@label Description for application dependency", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" });
  143. projectsModel.append({ name: "Protobuf", description: catalog.i18nc("@label Description for application dependency", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" });
  144. projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" });
  145. //CuraEngine's dependencies.
  146. projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label Description for application dependency", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
  147. projectsModel.append({ name: "RapidJSON", description: catalog.i18nc("@label Description for application dependency", "JSON parser"), license: "MIT", url: "https://rapidjson.org/" });
  148. projectsModel.append({ name: "STB", description: catalog.i18nc("@label Description for application dependency", "Utility functions, including an image loader"), license: "Public Domain", url: "https://github.com/nothings/stb" });
  149. projectsModel.append({ name: "Boost", description: catalog.i18nc("@label Description for application dependency", "Utility library, including Voronoi generation"), license: "Boost", url: "https://www.boost.org/" });
  150. //Python modules.
  151. projectsModel.append({ name: "Certifi", description: catalog.i18nc("@label Description for application dependency", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" });
  152. projectsModel.append({ name: "Cryptography", description: catalog.i18nc("@label Description for application dependency", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" });
  153. projectsModel.append({ name: "Future", description: catalog.i18nc("@label Description for application dependency", "Compatibility between Python 2 and 3"), license: "MIT", url: "https://python-future.org/" });
  154. projectsModel.append({ name: "keyring", description: catalog.i18nc("@label Description for application dependency", "Support library for system keyring access"), license: "MIT", url: "https://github.com/jaraco/keyring" });
  155. projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label Description for application dependency", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
  156. projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label Description for application dependency", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
  157. projectsModel.append({ name: "PyClipper", description: catalog.i18nc("@label Description for application dependency", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" });
  158. projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label Description for application dependency", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
  159. projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label Description for application dependency", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" });
  160. projectsModel.append({ name: "Sentry", description: catalog.i18nc("@Label Description for application dependency", "Python Error tracking library"), license: "BSD 2-Clause 'Simplified'", url: "https://sentry.io/for/python/" });
  161. projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label Description for application dependency", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" });
  162. projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label Description for application dependency", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
  163. //Building/packaging.
  164. projectsModel.append({ name: "CMake", description: catalog.i18nc("@label Description for development tool", "Universal build system configuration"), license: "BSD 3-Clause", url: "https://cmake.org/" });
  165. projectsModel.append({ name: "Conan", description: catalog.i18nc("@label Description for development tool", "Dependency and package manager"), license: "MIT", url: "https://conan.io/" });
  166. projectsModel.append({ name: "Pyinstaller", description: catalog.i18nc("@label Description for development tool", "Packaging Python-applications"), license: "GPLv2", url: "https://pyinstaller.org/" });
  167. projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label Description for development tool", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" });
  168. projectsModel.append({ name: "NSIS", description: catalog.i18nc("@label Description for development tool", "Generating Windows installers"), license: "Zlib", url: "https://nsis.sourceforge.io/" });
  169. }
  170. }
  171. AboutDialogVersionsList{
  172. id: projectBuildInfoList
  173. }
  174. onShakeDetectedChanged:
  175. {
  176. if (!projectBuildInfoList.visible)
  177. {
  178. projectsList.visible= false;
  179. projectBuildInfoList.visible = true;
  180. }
  181. else
  182. {
  183. projectsList.visible = true;
  184. projectBuildInfoList.visible = false;
  185. }
  186. }
  187. onVisibleChanged:
  188. {
  189. projectsList.visible = true;
  190. projectBuildInfoList.visible = false;
  191. }
  192. rightButtons: Cura.TertiaryButton
  193. {
  194. //: Close about dialog button
  195. id: closeButton
  196. text: catalog.i18nc("@action:button", "Close")
  197. onClicked: reject()
  198. }
  199. }