AddCloudPrintersView.qml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 QtQuick.Layouts 1.3
  6. import UM 1.3 as UM
  7. import Cura 1.5 as Cura
  8. //
  9. // This component contains the content for the 'by IP' page of the "Add New Printer" flow of the on-boarding process.
  10. //
  11. Item
  12. {
  13. UM.I18nCatalog { id: catalog; name: "cura" }
  14. id: addCloudPrinterScreen
  15. Label
  16. {
  17. id: titleLabel
  18. anchors.top: parent.top
  19. anchors.horizontalCenter: parent.horizontalCenter
  20. horizontalAlignment: Text.AlignHCenter
  21. text: catalog.i18nc("@label", "Add a Cloud printer")
  22. color: UM.Theme.getColor("primary_button")
  23. font: UM.Theme.getFont("huge")
  24. renderType: Text.NativeRendering
  25. }
  26. Cura.SecondaryButton
  27. {
  28. id: backButton
  29. anchors.left: parent.left
  30. anchors.bottom: parent.bottom
  31. text: catalog.i18nc("@button", "Add printer manually")
  32. onClicked:
  33. {
  34. CuraApplication.getDiscoveredPrintersModel().cancelCurrentManualDeviceRequest()
  35. base.showPreviousPage()
  36. }
  37. }
  38. Cura.PrimaryButton
  39. {
  40. id: connectButton
  41. anchors.right: parent.right
  42. anchors.bottom: parent.bottom
  43. text: catalog.i18nc("@button", "Finish")
  44. onClicked:
  45. {
  46. CuraApplication.getDiscoveredPrintersModel().createMachineFromDiscoveredPrinter(discoveredPrinter)
  47. base.showNextPage()
  48. }
  49. enabled: addPrinterByIpScreen.canAddPrinter
  50. }
  51. }