CloudContent.qml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. property bool isLoggedIn: Cura.API.account.isLoggedIn
  14. onIsLoggedInChanged:
  15. {
  16. if(isLoggedIn)
  17. {
  18. // If the user created an account or logged in by pressing any button on this page, all the actions that
  19. // need / can be done by this page are completed, so we can just go to the next (if any).
  20. base.showNextPage()
  21. }
  22. }
  23. Label
  24. {
  25. id: titleLabel
  26. anchors.top: parent.top
  27. anchors.horizontalCenter: parent.horizontalCenter
  28. horizontalAlignment: Text.AlignHCenter
  29. text: catalog.i18nc("@label", "Ultimaker Cloud")
  30. color: UM.Theme.getColor("primary_button")
  31. font: UM.Theme.getFont("huge")
  32. renderType: Text.NativeRendering
  33. }
  34. // Area where the cloud contents can be put. Pictures, texts and such.
  35. Item
  36. {
  37. id: cloudContentsArea
  38. anchors
  39. {
  40. top: titleLabel.bottom
  41. bottom: finishButton.top
  42. left: parent.left
  43. right: parent.right
  44. topMargin: UM.Theme.getSize("default_margin").height
  45. }
  46. // Pictures and texts are arranged using Columns with spacing. The whole picture and text area is centered in
  47. // the cloud contents area.
  48. Column
  49. {
  50. anchors.centerIn: parent
  51. width: parent.width
  52. height: childrenRect.height
  53. spacing: 20 * screenScaleFactor
  54. Image // Cloud image
  55. {
  56. id: cloudImage
  57. anchors.horizontalCenter: parent.horizontalCenter
  58. source: UM.Theme.getImage("first_run_ultimaker_cloud")
  59. }
  60. Label // A title-ish text
  61. {
  62. id: highlightTextLabel
  63. anchors.horizontalCenter: parent.horizontalCenter
  64. horizontalAlignment: Text.AlignHCenter
  65. text: catalog.i18nc("@text", "The next generation 3D printing workflow")
  66. textFormat: Text.RichText
  67. color: UM.Theme.getColor("primary")
  68. font: UM.Theme.getFont("medium")
  69. renderType: Text.NativeRendering
  70. }
  71. Label // A number of text items
  72. {
  73. id: textLabel
  74. anchors.horizontalCenter: parent.horizontalCenter
  75. text:
  76. {
  77. // There are 3 text items, each of which is translated separately as a single piece of text.
  78. var full_text = ""
  79. var t = ""
  80. t = catalog.i18nc("@text", "- Send print jobs to Ultimaker printers outside your local network")
  81. full_text += "<p>" + t + "</p>"
  82. t = catalog.i18nc("@text", "- Store your Ultimaker Cura settings in the cloud for use anywhere")
  83. full_text += "<p>" + t + "</p>"
  84. t = catalog.i18nc("@text", "- Get exclusive access to print profiles from leading brands")
  85. full_text += "<p>" + t + "</p>"
  86. return full_text
  87. }
  88. textFormat: Text.RichText
  89. font: UM.Theme.getFont("medium")
  90. color: UM.Theme.getColor("text")
  91. renderType: Text.NativeRendering
  92. }
  93. }
  94. }
  95. // Bottom buttons go here
  96. Cura.PrimaryButton
  97. {
  98. id: finishButton
  99. anchors.right: parent.right
  100. anchors.bottom: parent.bottom
  101. text: catalog.i18nc("@button", "Finish")
  102. onClicked: base.showNextPage()
  103. }
  104. Cura.SecondaryButton
  105. {
  106. id: createAccountButton
  107. anchors.left: parent.left
  108. anchors.verticalCenter: finishButton.verticalCenter
  109. text: catalog.i18nc("@button", "Create an account")
  110. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
  111. }
  112. Label
  113. {
  114. id: signInButton
  115. anchors.left: createAccountButton.right
  116. anchors.verticalCenter: finishButton.verticalCenter
  117. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  118. text: catalog.i18nc("@button", "Sign in")
  119. color: UM.Theme.getColor("secondary_button_text")
  120. font: UM.Theme.getFont("medium")
  121. renderType: Text.NativeRendering
  122. MouseArea
  123. {
  124. anchors.fill: parent
  125. hoverEnabled: true
  126. onClicked: Cura.API.account.login()
  127. onEntered: parent.font.underline = true
  128. onExited: parent.font.underline = false
  129. }
  130. }
  131. }