From 7808b727c3d4d081e888cfe1cc6719679f2c9d57 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 13 Sep 2018 22:19:56 +0200 Subject: [PATCH] guide user to the cloud login before being able to register a box --- nymea-app/ui/system/CloudSettingsPage.qml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nymea-app/ui/system/CloudSettingsPage.qml b/nymea-app/ui/system/CloudSettingsPage.qml index 6ef3f701..3ae6cee2 100644 --- a/nymea-app/ui/system/CloudSettingsPage.qml +++ b/nymea-app/ui/system/CloudSettingsPage.qml @@ -111,10 +111,14 @@ Page { Layout.fillWidth: true Layout.leftMargin: app.margins; Layout.rightMargin: app.margins visible: Engine.jsonRpcClient.cloudConnectionState === JsonRpcClient.CloudConnectionStateUnconfigured && !d.deploymentStarted - text: qsTr("Register box") + text: Engine.awsClient.isLoggedIn ? qsTr("Register box") : qsTr("Log in to cloud") onClicked: { - d.deploymentStarted = true - Engine.deployCertificate(); + if (Engine.awsClient.isLoggedIn) { + d.deploymentStarted = true + Engine.deployCertificate(); + } else { + pageStack.push(Qt.resolvedUrl("qrc:/ui/appsettings/CloudLoginPage.qml")) + } } }