CloudContent.qml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. // Copyright (c) 2019 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import UM 1.3 as UM
  6. import Cura 1.1 as Cura
  7. //
  8. // This component contains the content for the "Ultimaker Cloud" page of the welcome on-boarding process.
  9. //
  10. Item
  11. {
  12. UM.I18nCatalog { id: catalog; name: "cura" }
  13. signal cloudPrintersDetected(bool newCloudPrintersDetected)
  14. Component.onCompleted: CuraApplication.getDiscoveredCloudPrintersModel().cloudPrintersDetectedChanged.connect(cloudPrintersDetected)
  15. onCloudPrintersDetected:
  16. {
  17. // When the user signs in successfully, it will be checked whether he/she has cloud printers connected to
  18. // the account. If he/she does, then the welcome wizard will show a summary of the Cloud printers linked to the
  19. // account. If there are no cloud printers, then proceed to the next page (if any)
  20. if(newCloudPrintersDetected)
  21. {
  22. base.goToPage("add_cloud_printers")
  23. }
  24. else
  25. {
  26. base.showNextPage()
  27. }
  28. }
  29. // Area where the cloud contents can be put. Pictures, texts and such.
  30. Item
  31. {
  32. id: cloudContentsArea
  33. anchors
  34. {
  35. top: parent.top
  36. bottom: skipButton.top
  37. left: parent.left
  38. right: parent.right
  39. }
  40. // Pictures and texts are arranged using Columns with spacing. The whole picture and text area is centered in
  41. // the cloud contents area.
  42. Column
  43. {
  44. anchors.horizontalCenter: parent.horizontalCenter
  45. width: parent.width
  46. height: childrenRect.height
  47. spacing: UM.Theme.getSize("thick_margin").height
  48. Label
  49. {
  50. id: titleLabel
  51. anchors.horizontalCenter: parent.horizontalCenter
  52. horizontalAlignment: Text.AlignHCenter
  53. text: catalog.i18nc("@label", "Sign in to the Ultimaker platform")
  54. color: UM.Theme.getColor("primary_button")
  55. font: UM.Theme.getFont("huge")
  56. renderType: Text.NativeRendering
  57. }
  58. // Filler item
  59. Item
  60. {
  61. height: UM.Theme.getSize("default_margin").height
  62. width: parent.width
  63. }
  64. // Cloud image
  65. Image
  66. {
  67. id: cloudImage
  68. anchors.horizontalCenter: parent.horizontalCenter
  69. source: UM.Theme.getImage("first_run_ultimaker_cloud")
  70. fillMode: Image.PreserveAspectFit
  71. width: UM.Theme.getSize("welcome_wizard_content_image_big").width
  72. sourceSize.width: width
  73. sourceSize.height: height
  74. }
  75. // Filler item
  76. Item
  77. {
  78. height: UM.Theme.getSize("default_margin").height
  79. width: parent.width
  80. }
  81. // Motivational icons
  82. Row
  83. {
  84. id: motivationRow
  85. width: parent.width
  86. Column
  87. {
  88. id: marketplaceColumn
  89. width: Math.round(parent.width / 3)
  90. spacing: UM.Theme.getSize("default_margin").height
  91. Image
  92. {
  93. id: marketplaceImage
  94. anchors.horizontalCenter: parent.horizontalCenter
  95. fillMode: Image.PreserveAspectFit
  96. width: UM.Theme.getSize("welcome_wizard_cloud_content_image").width
  97. source: UM.Theme.getIcon("Plugin", "high")
  98. sourceSize.width: width
  99. sourceSize.height: height
  100. }
  101. Label
  102. {
  103. id: marketplaceTextLabel
  104. anchors.horizontalCenter: parent.horizontalCenter
  105. width: parent.width
  106. text: catalog.i18nc("@text", "Add material settings and plugins from the Marketplace")
  107. wrapMode: Text.Wrap
  108. horizontalAlignment: Text.AlignHCenter
  109. color: UM.Theme.getColor("text")
  110. font: UM.Theme.getFont("default")
  111. renderType: Text.NativeRendering
  112. }
  113. }
  114. Column
  115. {
  116. id: syncColumn
  117. width: Math.round(parent.width / 3)
  118. spacing: UM.Theme.getSize("default_margin").height
  119. Image
  120. {
  121. id: syncImage
  122. anchors.horizontalCenter: parent.horizontalCenter
  123. fillMode: Image.PreserveAspectFit
  124. width: UM.Theme.getSize("welcome_wizard_cloud_content_image").width
  125. source: UM.Theme.getIcon("Spool", "high")
  126. sourceSize.width: width
  127. sourceSize.height: height
  128. }
  129. Label
  130. {
  131. id: syncTextLabel
  132. anchors.horizontalCenter: parent.horizontalCenter
  133. width: parent.width
  134. text: catalog.i18nc("@text", "Backup and sync your material settings and plugins")
  135. wrapMode: Text.Wrap
  136. horizontalAlignment: Text.AlignHCenter
  137. color: UM.Theme.getColor("text")
  138. font: UM.Theme.getFont("default")
  139. renderType: Text.NativeRendering
  140. }
  141. }
  142. Column
  143. {
  144. id: communityColumn
  145. width: Math.round(parent.width / 3)
  146. spacing: UM.Theme.getSize("default_margin").height
  147. Image
  148. {
  149. id: communityImage
  150. anchors.horizontalCenter: communityColumn.horizontalCenter
  151. fillMode: Image.PreserveAspectFit
  152. width: UM.Theme.getSize("welcome_wizard_cloud_content_image").width
  153. source: UM.Theme.getIcon("People", "high")
  154. sourceSize.width: width
  155. sourceSize.height: height
  156. }
  157. Label
  158. {
  159. id: communityTextLabel
  160. anchors.horizontalCenter: communityColumn.horizontalCenter
  161. width: parent.width
  162. text: catalog.i18nc("@text", "Share ideas and get help from 48,000+ users in the Ultimaker Community")
  163. wrapMode: Text.Wrap
  164. horizontalAlignment: Text.AlignHCenter
  165. color: UM.Theme.getColor("text")
  166. font: UM.Theme.getFont("default")
  167. renderType: Text.NativeRendering
  168. }
  169. }
  170. }
  171. // Sign in Button
  172. Cura.PrimaryButton
  173. {
  174. id: signInButton
  175. anchors.horizontalCenter: parent.horizontalCenter
  176. text: catalog.i18nc("@button", "Sign in")
  177. onClicked: Cura.API.account.login()
  178. // Content Item is used in order to align the text inside the button. Without it, when resizing the
  179. // button, the text will be aligned on the left
  180. contentItem: Text {
  181. text: signInButton.text
  182. font: UM.Theme.getFont("medium")
  183. color: UM.Theme.getColor("primary_text")
  184. horizontalAlignment: Text.AlignHCenter
  185. verticalAlignment: Text.AlignVCenter
  186. }
  187. }
  188. // Create an account button
  189. Cura.TertiaryButton
  190. {
  191. id: createAccountButton
  192. anchors.horizontalCenter: parent.horizontalCenter
  193. text: catalog.i18nc("@text", "Create a free Ultimaker Account")
  194. onClicked: Qt.openUrlExternally("https://ultimaker.com/app/ultimaker-cura-account-sign-up?utm_source=cura&utm_medium=software&utm_campaign=onboarding-signup")
  195. }
  196. }
  197. }
  198. // The "Skip" button exists on the bottom right
  199. Label
  200. {
  201. id: skipButton
  202. anchors.right: parent.right
  203. anchors.bottom: parent.bottom
  204. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  205. text: catalog.i18nc("@button", "Skip")
  206. color: UM.Theme.getColor("secondary_button_text")
  207. font: UM.Theme.getFont("medium")
  208. renderType: Text.NativeRendering
  209. MouseArea
  210. {
  211. anchors.fill: parent
  212. hoverEnabled: true
  213. onClicked: base.showNextPage()
  214. onEntered: parent.font.underline = true
  215. onExited: parent.font.underline = false
  216. }
  217. }
  218. }