From 2a027d44d08ac63a9c371a970d6596b76c3a0697 Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Mon, 27 Sep 2021 10:36:38 +0300 Subject: [PATCH] add insert card dialog --- src/app/keycard/view.nim | 3 ++ ui/onboarding/Keycard.qml | 7 +++++ ui/shared/keycard/InsertCard.qml | 52 ++++++++++++++++++++++++++++++-- 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/app/keycard/view.nim b/src/app/keycard/view.nim index 80f615e622..44708cec70 100644 --- a/src/app/keycard/view.nim +++ b/src/app/keycard/view.nim @@ -16,3 +16,6 @@ QtObject: result.status = status result.setup + proc cardConnected*(self: KeycardView) {.signal.} + + proc cardDisconnected*(self: KeycardView) {.signal.} diff --git a/ui/onboarding/Keycard.qml b/ui/onboarding/Keycard.qml index 2218b88e00..c30b758a68 100644 --- a/ui/onboarding/Keycard.qml +++ b/ui/onboarding/Keycard.qml @@ -28,6 +28,13 @@ Item { PINModal { id: pinModal onClosed: function () { + insertCard.open() + } + } + + InsertCard { + id: insertCard + onClosed: function() { keycardView.onClosed() } } diff --git a/ui/shared/keycard/InsertCard.qml b/ui/shared/keycard/InsertCard.qml index 87832d1d4b..959fc6fb25 100644 --- a/ui/shared/keycard/InsertCard.qml +++ b/ui/shared/keycard/InsertCard.qml @@ -1,4 +1,52 @@ import QtQuick 2.13 +import QtQuick.Controls 2.13 +import QtQuick.Layouts 1.13 -Item { -} \ No newline at end of file +import StatusQ.Core 0.1 +import StatusQ.Core.Theme 0.1 +import StatusQ.Controls 0.1 +import StatusQ.Popups 0.1 + +StatusModal { + id: insertCard + anchors.centerIn: parent + + showHeader: false + focus: visible + + contentItem: Item { + width: insertCard.width + implicitHeight: childrenRect.height + Column { + width: parent.width - 32 + anchors.horizontalCenter: parent.horizontalCenter + + Item { + width: parent.width + height: 16 + } + + StatusBaseText { + text: qsTr("Please insert your Keycard to proceed or press the cancel button to cancel the operation") + font.pixelSize: 15 + anchors.left: parent.left + anchors.right: parent.right + wrapMode: Text.WordWrap + color: Theme.palette.directColor1 + } + + Item { + width: parent.width + height: 16 + } + } + } + + rightButtons: [ + StatusButton { + id: cancelButton + text: qsTr("Cancel") + onClicked: { insertCard.close() } + } + ] +}