diff options
Diffstat (limited to 'resources/qml/WelcomePages/CloudContent.qml')
-rw-r--r-- | resources/qml/WelcomePages/CloudContent.qml | 85 |
1 files changed, 52 insertions, 33 deletions
diff --git a/resources/qml/WelcomePages/CloudContent.qml b/resources/qml/WelcomePages/CloudContent.qml index e9b6df94e0..48410f7f12 100644 --- a/resources/qml/WelcomePages/CloudContent.qml +++ b/resources/qml/WelcomePages/CloudContent.qml @@ -15,14 +15,21 @@ Item { UM.I18nCatalog { id: catalog; name: "cura" } - property bool isLoggedIn: Cura.API.account.isLoggedIn + signal cloudPrintersDetected(bool newCloudPrintersDetected) - onIsLoggedInChanged: + Component.onCompleted: CuraApplication.getDiscoveredCloudPrintersModel().cloudPrintersDetectedChanged.connect(cloudPrintersDetected) + + onCloudPrintersDetected: { - if(isLoggedIn) + // When the user signs in successfully, it will be checked whether he/she has cloud printers connected to + // the account. If he/she does, then the welcome wizard will show a summary of the Cloud printers linked to the + // account. If there are no cloud printers, then proceed to the next page (if any) + if(newCloudPrintersDetected) + { + base.goToPage("add_cloud_printers") + } + else { - // If the user created an account or logged in by pressing any button on this page, all the actions that - // need / can be done by this page are completed, so we can just go to the next (if any). base.showNextPage() } } @@ -33,7 +40,7 @@ Item anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter - text: catalog.i18nc("@label", "Ultimaker Cloud") + text: catalog.i18nc("@label", "Ultimaker Account") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") renderType: Text.NativeRendering @@ -46,7 +53,7 @@ Item anchors { top: titleLabel.bottom - bottom: finishButton.top + bottom: skipButton.top left: parent.left right: parent.right topMargin: UM.Theme.getSize("default_margin").height @@ -74,7 +81,7 @@ Item id: highlightTextLabel anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter - text: catalog.i18nc("@text", "The next generation 3D printing workflow") + text: catalog.i18nc("@text", "Your key to connected 3D printing") textFormat: Text.RichText color: UM.Theme.getColor("primary") font: UM.Theme.getFont("medium") @@ -91,13 +98,13 @@ Item var full_text = "" var t = "" - t = catalog.i18nc("@text", "- Send print jobs to Ultimaker printers outside your local network") + t = catalog.i18nc("@text", "- Customize your experience with more print profiles and plugins") full_text += "<p>" + t + "</p>" - t = catalog.i18nc("@text", "- Store your Ultimaker Cura settings in the cloud for use anywhere") + t = catalog.i18nc("@text", "- Stay flexible by syncing your setup and loading it anywhere") full_text += "<p>" + t + "</p>" - t = catalog.i18nc("@text", "- Get exclusive access to print profiles from leading brands") + t = catalog.i18nc("@text", "- Increase efficiency with a remote workflow on Ultimaker printers") full_text += "<p>" + t + "</p>" return full_text @@ -107,35 +114,47 @@ Item color: UM.Theme.getColor("text") renderType: Text.NativeRendering } + + // "Sign in" and "Create an account" exist inside the column + Cura.PrimaryButton + { + id: signInButton + height: createAccountButton.height + width: createAccountButton.width + anchors.horizontalCenter: parent.horizontalCenter + text: catalog.i18nc("@button", "Sign in") + onClicked: Cura.API.account.login() + // Content Item is used in order to align the text inside the button. Without it, when resizing the + // button, the text will be aligned on the left + contentItem: Text { + text: signInButton.text + font: UM.Theme.getFont("medium") + color: UM.Theme.getColor("primary_text") + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + + Cura.SecondaryButton + { + id: createAccountButton + anchors.horizontalCenter: parent.horizontalCenter + text: catalog.i18nc("@button","Create account") + onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create") + } } - } - // Bottom buttons go here - Cura.PrimaryButton - { - id: finishButton - anchors.right: parent.right - anchors.bottom: parent.bottom - text: catalog.i18nc("@button", "Finish") - onClicked: base.showNextPage() - } - Cura.SecondaryButton - { - id: createAccountButton - anchors.left: parent.left - anchors.verticalCenter: finishButton.verticalCenter - text: catalog.i18nc("@button", "Create an account") - onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create") } + // The "Skip" button exists on the bottom right Label { - id: signInButton - anchors.left: createAccountButton.right - anchors.verticalCenter: finishButton.verticalCenter + id: skipButton + anchors.right: parent.right + anchors.bottom: parent.bottom anchors.leftMargin: UM.Theme.getSize("default_margin").width - text: catalog.i18nc("@button", "Sign in") + text: catalog.i18nc("@button", "Skip") color: UM.Theme.getColor("secondary_button_text") font: UM.Theme.getFont("medium") renderType: Text.NativeRendering @@ -144,7 +163,7 @@ Item { anchors.fill: parent hoverEnabled: true - onClicked: Cura.API.account.login() + onClicked: base.showNextPage() onEntered: parent.font.underline = true onExited: parent.font.underline = false } |