CloudContent.qml 4.7 KB

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