AddUltimakerPrinter.qml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // Copyright (c) 2022 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 QtQuick.Layouts 1.3
  6. import UM 1.5 as UM
  7. import Cura 1.1 as Cura
  8. Control
  9. {
  10. UM.I18nCatalog { id: catalog; name: "cura" }
  11. property var goToThirdPartyPrinter
  12. signal cloudPrintersDetected(bool newCloudPrintersDetected)
  13. Component.onCompleted: CuraApplication.getDiscoveredCloudPrintersModel().cloudPrintersDetectedChanged.connect(cloudPrintersDetected)
  14. onCloudPrintersDetected: function(newCloudPrintersDetected)
  15. {
  16. if(newCloudPrintersDetected)
  17. {
  18. base.goToPage("add_cloud_printers")
  19. }
  20. }
  21. contentItem: ColumnLayout
  22. {
  23. UM.Label
  24. {
  25. Layout.fillWidth: true
  26. text: catalog.i18nc("@label", "New Ultimaker printers can be connected to Digital Factory and monitored remotely.")
  27. wrapMode: Text.WordWrap
  28. }
  29. RowLayout
  30. {
  31. Layout.fillWidth: true
  32. Image
  33. {
  34. source: UM.Theme.getImage("add_printer")
  35. Layout.preferredWidth: 200 * screenScaleFactor
  36. Layout.preferredHeight: 200 * screenScaleFactor
  37. }
  38. ColumnLayout
  39. {
  40. Layout.fillHeight: true
  41. Layout.alignment: Qt.AlignVCenter
  42. spacing: UM.Theme.getSize("default_margin").height
  43. UM.Label
  44. {
  45. Layout.fillWidth: true
  46. Layout.alignment: Qt.AlignTop
  47. wrapMode: Text.WordWrap
  48. font: UM.Theme.getFont("default_bold")
  49. text: catalog.i18nc("@label", "If you are trying to add a new Ultimaker printer to Cura")
  50. }
  51. UM.Label
  52. {
  53. Layout.fillWidth: true
  54. Layout.alignment: Qt.AlignTop
  55. wrapMode: Text.WordWrap
  56. text: {
  57. const steps = [
  58. catalog.i18nc("@info", "1. Sign in into Ultimaker Digilal Factory"),
  59. catalog.i18nc("@info", "2. Follow the procedure to add a new printer"),
  60. catalog.i18nc("@info", "3. Your new printer will automatically appear in Cura"),
  61. ];
  62. return steps.join("<br />");
  63. }
  64. }
  65. Cura.TertiaryButton
  66. {
  67. id: learnMoreButton
  68. Layout.fillWidth: true
  69. Layout.alignment: Qt.AlignTop
  70. leftPadding: 0
  71. text: catalog.i18nc("@button", "Learn more")
  72. iconSource: UM.Theme.getIcon("LinkExternal")
  73. isIconOnRightSide: true
  74. textFont: UM.Theme.getFont("small")
  75. onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=onboarding-add-printer")
  76. }
  77. }
  78. }
  79. Control
  80. {
  81. Layout.alignment: Qt.AlignBottom
  82. Layout.fillWidth: true
  83. contentItem: RowLayout
  84. {
  85. Cura.SecondaryButton
  86. {
  87. id: addLocalPrinterButton
  88. Layout.alignment: Qt.AlignLeft
  89. text: catalog.i18nc("@button", "Add local printer")
  90. onClicked: goToThirdPartyPrinter()
  91. }
  92. Cura.PrimaryButton
  93. {
  94. id: signInButton
  95. Layout.alignment: Qt.AlignRight
  96. text: catalog.i18nc("@button", "Sign in to Digital Factory")
  97. onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/printers?add-printer?utm_source=cura&utm_medium=software&utm_campaign=onboarding-add-printer")
  98. }
  99. }
  100. }
  101. }
  102. }