diff --git a/libnymea-app-core/connection/awsclient.cpp b/libnymea-app-core/connection/awsclient.cpp index 2192ca2e..f73f0f3b 100644 --- a/libnymea-app-core/connection/awsclient.cpp +++ b/libnymea-app-core/connection/awsclient.cpp @@ -105,7 +105,7 @@ AWSClient::AWSClient(QObject *parent) : QObject(parent), m_userId = settings.value("userId").toString(); m_password = settings.value("password").toString(); m_accessToken = settings.value("accessToken").toByteArray(); -// m_accessTokenExpiry = settings.value("accessTokenExpiry").toDateTime(); + m_accessTokenExpiry = settings.value("accessTokenExpiry").toDateTime(); m_idToken = settings.value("idToken").toByteArray(); m_refreshToken = settings.value("refreshToken").toByteArray(); diff --git a/nymea-app/ui/components/SegmentedImage.qml b/nymea-app/ui/components/SegmentedImage.qml index 77c4ea85..0e02e24d 100644 --- a/nymea-app/ui/components/SegmentedImage.qml +++ b/nymea-app/ui/components/SegmentedImage.qml @@ -23,6 +23,8 @@ Item { property alias textureSource: segmentRenderer.source property alias boxesSource: segmentBoundingBoxes.source + property alias fillColor: segmentRenderer.fillColor + implicitWidth: segmentRenderer.implicitWidth implicitHeight: segmentRenderer.implicitHeight diff --git a/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml b/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml index 57acd5b0..68702846 100644 --- a/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml +++ b/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml @@ -149,6 +149,7 @@ DevicePageBase { property string user: "" + property bool done: false property bool error: false Connections { @@ -156,7 +157,10 @@ DevicePageBase { onExecuteActionReply: { addUserPage.error = params["deviceError"] !== "DeviceErrorNoError" print("Execute action reply:", params["deviceError"]); - addUserSwipeView.currentIndex++ + var masks =[] + masks.push({x: 0, y: 0, width: 1, height: 1}); + fingerprintVisual.masks = masks + addUserPage.done = true } } @@ -165,8 +169,7 @@ DevicePageBase { SwipeView { id: addUserSwipeView Layout.fillWidth: true - Layout.topMargin: app.margins * 2 - Layout.preferredHeight: 200 + Layout.topMargin: app.margins Layout.alignment: Qt.AlignTop interactive: false Item { @@ -238,7 +241,9 @@ DevicePageBase { anchors.margins: app.margins spacing: app.margins * 2 Label { - text: qsTr("Please scan the fingerprint now") + text: !addUserPage.done ? qsTr("Please scan the fingerprint now") + : addUserPage.error ? qsTr("Uh oh") + : qsTr("All done!") Layout.fillWidth: true font.pixelSize: app.largeFont color: app.accentColor @@ -246,52 +251,17 @@ DevicePageBase { } Item { - Layout.preferredWidth: 200 - Layout.preferredHeight: 200 + Layout.preferredWidth: 100 + Layout.preferredHeight: 100 Layout.alignment: Qt.AlignCenter FingerprintVisual { id: fingerprintVisual scale: parent.height / implicitHeight - anchors.centerIn: parent - Timer { - interval: 500 - property real position: 0 - running: addUserSwipeView.currentIndex == 1 - repeat: true - onTriggered: { - var masks = []; - masks.push({x: 0, y: 0, width: 1, height: position}) - position += 0.1 - if (position < 1.1) { - fingerprintVisual.masks = masks - } else { - position = 0 - fingerprintVisual.masks = [] - } - } - } + fillColor: addUserPage.error ? "red" : app.accentColor } - } - } - } - Item { - width: addUserSwipeView.width - height: addUserSwipeView.height - - ColumnLayout { - anchors.fill: parent - anchors.margins: app.margins - spacing: app.margins * 2 - Label { - Layout.fillWidth: true - font.pixelSize: app.largeFont - color: app.accentColor - text: addUserPage.error ? qsTr("Uh oh") : - qsTr("All done!") - horizontalAlignment: Text.AlignHCenter } Label { text: addUserPage.error ? qsTr("Fingerprint could not be read.\nPlease try again.") : @@ -299,11 +269,13 @@ DevicePageBase { Layout.fillWidth: true wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter + visible: addUserPage.done } Button { Layout.fillWidth: true text: qsTr("OK") onClicked: pageStack.pop() + visible: addUserPage.done } } }