From 93cb26e3d61937e8b383ad21311204b96f500012 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 23 Aug 2019 15:05:18 +0200 Subject: [PATCH] Display the error message in case of failed pairing --- nymea-app/ui/thingconfiguration/SetupWizard.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/nymea-app/ui/thingconfiguration/SetupWizard.qml b/nymea-app/ui/thingconfiguration/SetupWizard.qml index 207adfc3..39f9837d 100644 --- a/nymea-app/ui/thingconfiguration/SetupWizard.qml +++ b/nymea-app/ui/thingconfiguration/SetupWizard.qml @@ -86,7 +86,7 @@ Page { } onConfirmPairingReply: { busyOverlay.shown = false - internalPageStack.push(resultsPage, {success: params["deviceError"] === "DeviceErrorNoError", deviceId: params["deviceId"]}) + internalPageStack.push(resultsPage, {success: params["deviceError"] === "DeviceErrorNoError", deviceId: params["deviceId"], message: params["displayMessage"]}) } onAddDeviceReply: { busyOverlay.shown = false; @@ -443,6 +443,7 @@ Page { id: pinTextField Layout.fillWidth: true visible: pairingPage.setupMethod === "SetupMethodDisplayPin" || pairingPage.setupMethod === "SetupMethodUserAndPassword" + echoMode: TextField.Password } @@ -450,7 +451,8 @@ Page { Layout.fillWidth: true text: "OK" onClicked: { - engine.deviceManager.confirmPairing(d.pairingTransactionId, pinTextField.displayText, usernameTextField.displayText); + engine.deviceManager.confirmPairing(d.pairingTransactionId, pinTextField.text, usernameTextField.displayText); + busyOverlay.shown = true; } } } @@ -486,6 +488,7 @@ Page { property bool success property string deviceId + property string message readonly property var device: root.device ? root.device : engine.deviceManager.devices.getDevice(deviceId) @@ -508,6 +511,13 @@ Page { text: resultsView.success ? qsTr("All done. You can now start using %1.").arg(resultsView.device.name) : qsTr("Something went wrong setting up this thing..."); } + Label { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + text: resultsView.message + } + Button { Layout.fillWidth: true text: qsTr("Ok")