2022-08-05 13:50:54 +00:00
|
|
|
|
import QtQuick 2.14
|
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
import "../helpers"
|
|
|
|
|
|
2022-08-05 13:50:54 +00:00
|
|
|
|
Item {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
property var sharedKeycardModule
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
Component.onCompleted: {
|
2022-10-12 17:08:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.renamingKeycard) {
|
2022-09-13 10:03:25 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.doPrimaryAction()
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
|
id: d
|
|
|
|
|
|
2022-09-02 11:04:59 +00:00
|
|
|
|
readonly property bool hideKeyPair: root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.hideKeyPair
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-08-05 13:50:54 +00:00
|
|
|
|
Timer {
|
|
|
|
|
id: timer
|
|
|
|
|
interval: 1000
|
2022-10-17 10:12:22 +00:00
|
|
|
|
running: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
2022-10-17 10:44:09 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPin ||
|
2022-10-18 08:04:51 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCode
|
2022-08-05 13:50:54 +00:00
|
|
|
|
onTriggered: {
|
|
|
|
|
root.sharedKeycardModule.currentState.doSecondaryAction()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: keyPairComponent
|
|
|
|
|
KeyPairItem {
|
2022-09-02 11:04:59 +00:00
|
|
|
|
keyPairType: root.sharedKeycardModule.selectedKeyPairItem.pairType
|
2022-08-31 17:09:07 +00:00
|
|
|
|
keyPairPubKey: root.sharedKeycardModule.selectedKeyPairItem.pubKey
|
|
|
|
|
keyPairName: root.sharedKeycardModule.selectedKeyPairItem.name
|
|
|
|
|
keyPairIcon: root.sharedKeycardModule.selectedKeyPairItem.icon
|
|
|
|
|
keyPairImage: root.sharedKeycardModule.selectedKeyPairItem.image
|
|
|
|
|
keyPairDerivedFrom: root.sharedKeycardModule.selectedKeyPairItem.derivedFrom
|
|
|
|
|
keyPairAccounts: root.sharedKeycardModule.selectedKeyPairItem.accounts
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: knownKeyPairComponent
|
|
|
|
|
KeyPairItem {
|
2022-09-02 11:04:59 +00:00
|
|
|
|
keyPairType: root.sharedKeycardModule.keyPairStoredOnKeycard.pairType
|
2022-08-31 17:09:07 +00:00
|
|
|
|
keyPairPubKey: root.sharedKeycardModule.keyPairStoredOnKeycard.pubKey
|
|
|
|
|
keyPairName: root.sharedKeycardModule.keyPairStoredOnKeycard.name
|
|
|
|
|
keyPairIcon: root.sharedKeycardModule.keyPairStoredOnKeycard.icon
|
|
|
|
|
keyPairImage: root.sharedKeycardModule.keyPairStoredOnKeycard.image
|
|
|
|
|
keyPairDerivedFrom: root.sharedKeycardModule.keyPairStoredOnKeycard.derivedFrom
|
|
|
|
|
keyPairAccounts: root.sharedKeycardModule.keyPairStoredOnKeycard.accounts
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: unknownKeyPairCompontnt
|
|
|
|
|
KeyPairUnknownItem {
|
|
|
|
|
keyPairPubKey: root.sharedKeycardModule.keyPairStoredOnKeycard.pubKey
|
|
|
|
|
keyPairName: root.sharedKeycardModule.keyPairStoredOnKeycard.name
|
|
|
|
|
keyPairIcon: root.sharedKeycardModule.keyPairStoredOnKeycard.icon
|
|
|
|
|
keyPairImage: root.sharedKeycardModule.keyPairStoredOnKeycard.image
|
|
|
|
|
keyPairDerivedFrom: root.sharedKeycardModule.keyPairStoredOnKeycard.derivedFrom
|
|
|
|
|
keyPairAccounts: root.sharedKeycardModule.keyPairStoredOnKeycard.accounts
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-13 10:03:25 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: keyPairForAuthenticationComponent
|
|
|
|
|
KeyPairItem {
|
|
|
|
|
keyPairType: root.sharedKeycardModule.keyPairForAuthentication.pairType
|
|
|
|
|
keyPairPubKey: root.sharedKeycardModule.keyPairForAuthentication.pubKey
|
|
|
|
|
keyPairName: root.sharedKeycardModule.keyPairForAuthentication.name
|
|
|
|
|
keyPairIcon: root.sharedKeycardModule.keyPairForAuthentication.icon
|
|
|
|
|
keyPairImage: root.sharedKeycardModule.keyPairForAuthentication.image
|
|
|
|
|
keyPairDerivedFrom: root.sharedKeycardModule.keyPairForAuthentication.derivedFrom
|
|
|
|
|
keyPairAccounts: root.sharedKeycardModule.keyPairForAuthentication.accounts
|
|
|
|
|
keyPairCardLocked: root.sharedKeycardModule.keyPairForAuthentication.locked
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-12 17:08:59 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: keyPairForProcessingComponent
|
|
|
|
|
KeyPairItem {
|
|
|
|
|
keyPairType: root.sharedKeycardModule.keyPairForProcessing.pairType
|
|
|
|
|
keyPairPubKey: root.sharedKeycardModule.keyPairForProcessing.pubKey
|
|
|
|
|
keyPairName: root.sharedKeycardModule.keyPairForProcessing.name
|
|
|
|
|
keyPairIcon: root.sharedKeycardModule.keyPairForProcessing.icon
|
|
|
|
|
keyPairImage: root.sharedKeycardModule.keyPairForProcessing.image
|
|
|
|
|
keyPairDerivedFrom: root.sharedKeycardModule.keyPairForProcessing.derivedFrom
|
|
|
|
|
keyPairAccounts: root.sharedKeycardModule.keyPairForProcessing.accounts
|
|
|
|
|
keyPairCardLocked: root.sharedKeycardModule.keyPairForProcessing.locked
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
ColumnLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.topMargin: Style.current.xlPadding
|
|
|
|
|
anchors.bottomMargin: Style.current.halfPadding
|
|
|
|
|
anchors.leftMargin: Style.current.xlPadding
|
|
|
|
|
anchors.rightMargin: Style.current.xlPadding
|
2022-08-05 13:50:54 +00:00
|
|
|
|
spacing: Style.current.padding
|
2022-08-31 17:09:07 +00:00
|
|
|
|
clip: true
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
KeycardImage {
|
2022-08-05 13:50:54 +00:00
|
|
|
|
id: image
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
Layout.preferredHeight: Constants.keycard.shared.imageHeight
|
|
|
|
|
Layout.preferredWidth: Constants.keycard.shared.imageWidth
|
2022-08-31 17:09:07 +00:00
|
|
|
|
|
|
|
|
|
onAnimationCompleted: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard) {
|
|
|
|
|
root.sharedKeycardModule.currentState.doSecondaryAction()
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
|
Layout.alignment: Qt.AlignCenter
|
2022-08-31 17:09:07 +00:00
|
|
|
|
Layout.preferredHeight: Constants.keycard.general.titleHeight
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
|
|
|
|
StatusIcon {
|
|
|
|
|
id: icon
|
|
|
|
|
visible: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard
|
|
|
|
|
width: Style.current.padding
|
|
|
|
|
height: Style.current.padding
|
|
|
|
|
icon: "checkmark"
|
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
|
}
|
|
|
|
|
StatusLoadingIndicator {
|
|
|
|
|
id: loading
|
2022-08-31 17:09:07 +00:00
|
|
|
|
visible: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
2022-10-12 17:08:59 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair ||
|
2022-10-17 10:12:22 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.renamingKeycard ||
|
2022-10-17 10:44:09 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPin ||
|
2022-10-18 08:04:51 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCode
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
StatusBaseText {
|
|
|
|
|
id: title
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
|
id: message
|
2022-08-31 17:09:07 +00:00
|
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
|
Layout.preferredWidth: parent.width
|
|
|
|
|
Layout.preferredHeight: Constants.keycard.general.messageHeight
|
2022-08-05 13:50:54 +00:00
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
|
id: loader
|
|
|
|
|
Layout.preferredWidth: parent.width
|
|
|
|
|
active: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
|
|
|
|
if((root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader && !d.hideKeyPair) ||
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard && !d.hideKeyPair) ||
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted && !d.hideKeyPair) ||
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard && !d.hideKeyPair) ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateFailure ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.factoryReset) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication &&
|
|
|
|
|
!!root.sharedKeycardModule.keyPairForAuthentication &&
|
|
|
|
|
root.sharedKeycardModule.keyPairForAuthentication.name !== "") {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
2022-09-20 14:01:57 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
2022-09-13 10:03:25 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsReadyToSign ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.displayKeycardContent) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-12 17:08:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.renameKeycard && !d.hideKeyPair) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameFailure)
|
|
|
|
|
return true
|
|
|
|
|
}
|
2022-10-17 10:12:22 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changeKeycardPin && !d.hideKeyPair) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
|
|
|
|
return true
|
|
|
|
|
}
|
2022-10-17 10:44:09 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changeKeycardPuk && !d.hideKeyPair) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
|
|
|
|
return true
|
|
|
|
|
}
|
2022-10-18 08:04:51 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changePairingCode && !d.hideKeyPair) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourceComponent: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
2022-10-12 17:08:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameFailure) {
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.keyPairStoredOnKeycardIsKnown) {
|
|
|
|
|
return knownKeyPairComponent
|
|
|
|
|
}
|
|
|
|
|
return unknownKeyPairCompontnt
|
|
|
|
|
}
|
|
|
|
|
if ((root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader && !d.hideKeyPair) ||
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard && !d.hideKeyPair) ||
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted && !d.hideKeyPair) ||
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard && !d.hideKeyPair) ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateFailure) {
|
|
|
|
|
return keyPairComponent
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.factoryReset) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
|
|
|
|
if (root.sharedKeycardModule.keyPairStoredOnKeycardIsKnown) {
|
|
|
|
|
return knownKeyPairComponent
|
|
|
|
|
}
|
|
|
|
|
return unknownKeyPairCompontnt
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
2022-09-20 14:01:57 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
2022-09-13 10:03:25 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsReadyToSign ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard) {
|
|
|
|
|
return keyPairForAuthenticationComponent
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.displayKeycardContent) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
|
|
|
|
if (root.sharedKeycardModule.keyPairStoredOnKeycardIsKnown) {
|
|
|
|
|
return knownKeyPairComponent
|
|
|
|
|
}
|
|
|
|
|
return unknownKeyPairCompontnt
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-12 17:08:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.renameKeycard) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameFailure) {
|
|
|
|
|
return knownKeyPairComponent
|
|
|
|
|
}
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
|
|
|
|
return keyPairForProcessingComponent
|
|
|
|
|
}
|
2022-10-17 10:12:22 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changeKeycardPin) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
|
|
|
|
return keyPairForProcessingComponent
|
|
|
|
|
}
|
2022-10-17 10:44:09 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changeKeycardPuk) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
|
|
|
|
return keyPairForProcessingComponent
|
|
|
|
|
}
|
2022-10-18 08:04:51 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changePairingCode) {
|
|
|
|
|
if(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
|
|
|
|
return keyPairForProcessingComponent
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
|
|
|
|
return undefined
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
visible: !loader.active
|
|
|
|
|
Layout.fillWidth: true
|
2022-09-02 11:04:59 +00:00
|
|
|
|
Layout.fillHeight: visible
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
states: [
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.pluginReader
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Plug in Keycard reader...")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-08-31 17:09:07 +00:00
|
|
|
|
source: Style.png("keycard/empty-reader")
|
|
|
|
|
pattern: ""
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.insertKeycard
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Insert Keycard...")
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.cardInsert.pattern
|
2022-08-31 17:09:07 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInsert.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.cardInsert.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.cardInsert.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.cardInsert.duration
|
|
|
|
|
loops: Constants.keycardAnimations.cardInsert.loops
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
2022-08-31 17:09:07 +00:00
|
|
|
|
text: root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.wronglyInsertedCard?
|
|
|
|
|
qsTr("Check the card, it might be wrongly inserted") :
|
|
|
|
|
""
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
2022-08-12 07:33:12 +00:00
|
|
|
|
color: Theme.palette.baseColor1
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-31 17:09:07 +00:00
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.keycardInserted
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Keycard inserted...")
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.cardInserted.pattern
|
2022-08-31 17:09:07 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInserted.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.cardInserted.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.cardInserted.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.cardInserted.duration
|
|
|
|
|
loops: Constants.keycardAnimations.cardInserted.loops
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-05 13:50:54 +00:00
|
|
|
|
State {
|
2022-10-12 17:08:59 +00:00
|
|
|
|
name: "processing"
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair ||
|
2022-10-17 10:12:22 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.renamingKeycard ||
|
2022-10-17 10:44:09 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPin ||
|
2022-10-18 08:04:51 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCode
|
2022-08-05 13:50:54 +00:00
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
2022-10-12 17:08:59 +00:00
|
|
|
|
text: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard) {
|
|
|
|
|
return qsTr("Reading Keycard...")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair) {
|
|
|
|
|
return qsTr("Migrating key pair to Keycard")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.renamingKeycard) {
|
|
|
|
|
return qsTr("Renaming keycard...")
|
|
|
|
|
}
|
2022-10-17 10:12:22 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPin) {
|
|
|
|
|
return qsTr("Updating PIN")
|
|
|
|
|
}
|
2022-10-17 10:44:09 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPuk) {
|
|
|
|
|
return qsTr("Setting your Keycard PUK...")
|
|
|
|
|
}
|
2022-10-18 08:04:51 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCode) {
|
|
|
|
|
return qsTr("Setting your pairing code...")
|
|
|
|
|
}
|
2022-10-12 17:08:59 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.warning.pattern
|
2022-08-31 17:09:07 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.warning.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.warning.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.warning.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.warning.duration
|
|
|
|
|
loops: Constants.keycardAnimations.warning.loops
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.notKeycard
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("This is not a Keycard")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
2022-08-05 13:50:54 +00:00
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-09-13 10:03:25 +00:00
|
|
|
|
pattern: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication?
|
2022-10-18 08:31:23 +00:00
|
|
|
|
"" : Constants.keycardAnimations.strongError.pattern
|
2022-09-13 10:03:25 +00:00
|
|
|
|
source: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication?
|
|
|
|
|
Style.png("keycard/plain-error") : ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication?
|
|
|
|
|
0 : Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop
|
2022-09-13 10:03:25 +00:00
|
|
|
|
startImgIndexForOtherLoops: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication?
|
2022-10-18 08:31:23 +00:00
|
|
|
|
0 : Constants.keycardAnimations.strongError.startImgIndexForOtherLoops
|
2022-09-13 10:03:25 +00:00
|
|
|
|
endImgIndex: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication?
|
2022-10-18 08:31:23 +00:00
|
|
|
|
0 : Constants.keycardAnimations.strongError.endImgIndex
|
2022-09-13 10:03:25 +00:00
|
|
|
|
duration: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication?
|
2022-10-18 08:31:23 +00:00
|
|
|
|
0 : Constants.keycardAnimations.strongError.duration
|
|
|
|
|
loops: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication?
|
|
|
|
|
-1 : Constants.keycardAnimations.strongError.loops
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: qsTr("The card inserted is not a recognised Keycard,\nplease remove and try and again")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-09-13 10:03:25 +00:00
|
|
|
|
State {
|
2022-09-20 14:01:57 +00:00
|
|
|
|
name: Constants.keycardSharedState.unlockKeycardOptions
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardOptions
|
2022-09-13 10:03:25 +00:00
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
2022-09-20 14:01:57 +00:00
|
|
|
|
text: qsTr("Unlock this Keycard")
|
2022-09-13 10:03:25 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
2022-09-20 14:01:57 +00:00
|
|
|
|
color: Theme.palette.directColor1
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.strongError.pattern
|
2022-09-20 14:01:57 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongError.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.strongError.duration
|
|
|
|
|
loops: Constants.keycardAnimations.strongError.loops
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
2022-09-20 14:01:57 +00:00
|
|
|
|
text: ""
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-31 17:09:07 +00:00
|
|
|
|
State {
|
2022-09-20 14:01:57 +00:00
|
|
|
|
name: Constants.keycardSharedState.wrongKeycard
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard
|
2022-08-31 17:09:07 +00:00
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
2022-09-20 14:01:57 +00:00
|
|
|
|
text: qsTr("Wrong Keycard inserted")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-09-20 14:01:57 +00:00
|
|
|
|
source: Style.png("keycard/plain-error")
|
|
|
|
|
pattern: ""
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
2022-10-11 12:15:33 +00:00
|
|
|
|
text: {
|
2022-10-12 17:08:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication ||
|
2022-10-17 10:12:22 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.renameKeycard ||
|
2022-10-17 10:44:09 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changeKeycardPin ||
|
2022-10-18 08:04:51 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changeKeycardPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.changePairingCode) {
|
2022-10-11 12:15:33 +00:00
|
|
|
|
return qsTr("Keycard inserted does not match the Keycard below")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.unlockKeycard) {
|
|
|
|
|
return qsTr("Keycard inserted does not match the Keycard you're trying to unlock")
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
2022-08-05 13:50:54 +00:00
|
|
|
|
color: Theme.palette.dangerColor1
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.keycardEmptyMetadata
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmptyMetadata
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("This Keycard has empty metadata")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
|
|
|
|
source: Style.png("keycard/card-inserted")
|
|
|
|
|
pattern: ""
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: qsTr("This Keycard already stores keys\nbut doesn't store any metadata")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
|
color: Theme.palette.directColor1
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.keycardEmpty
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Keycard is empty")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
2022-08-05 13:50:54 +00:00
|
|
|
|
font.weight: Font.Bold
|
2022-09-20 14:01:57 +00:00
|
|
|
|
color: Theme.palette.directColor1
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-09-20 14:01:57 +00:00
|
|
|
|
source: Style.png("keycard/card-empty")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
pattern: ""
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: qsTr("There is no key pair on this Keycard")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
2022-09-20 14:01:57 +00:00
|
|
|
|
color: Theme.palette.directColor1
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.keycardNotEmpty
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardNotEmpty
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("This Keycard already stores keys")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
|
|
|
|
source: Style.png("keycard/card-inserted")
|
|
|
|
|
pattern: ""
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard?
|
|
|
|
|
qsTr("To migrate %1 on to this Keycard, you\nwill need to perform a factory reset first")
|
|
|
|
|
.arg(root.sharedKeycardModule.selectedKeyPairItem.name) :
|
|
|
|
|
""
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
2022-08-05 13:50:54 +00:00
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-09-13 10:03:25 +00:00
|
|
|
|
State {
|
2022-09-20 14:01:57 +00:00
|
|
|
|
name: "sharedLockedState"
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached
|
2022-09-13 10:03:25 +00:00
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
2022-09-20 14:01:57 +00:00
|
|
|
|
text: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard?
|
|
|
|
|
qsTr("Keycard locked and already stores keys") : qsTr("Keycard locked")
|
2022-09-13 10:03:25 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
2022-09-20 14:01:57 +00:00
|
|
|
|
color: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard?
|
|
|
|
|
Theme.palette.directColor1 : Theme.palette.dangerColor1
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.strongError.pattern
|
2022-09-13 10:03:25 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongError.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.strongError.duration
|
|
|
|
|
loops: Constants.keycardAnimations.strongError.loops
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
2022-09-20 14:01:57 +00:00
|
|
|
|
text: {
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.useGeneralMessageForLockedState) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard)
|
|
|
|
|
return qsTr("The Keycard you have inserted is locked,\nyou will need to factory reset it before proceeding")
|
2022-09-20 14:01:57 +00:00
|
|
|
|
return qsTr("You will need to unlock it before proceeding")
|
2022-09-21 13:11:39 +00:00
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached)
|
|
|
|
|
return qsTr("Pin entered incorrectly too many times")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached)
|
|
|
|
|
return qsTr("Puk entered incorrectly too many times")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached)
|
|
|
|
|
return qsTr("Max pairing slots reached for the entered keycard")
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
2022-09-20 14:01:57 +00:00
|
|
|
|
color: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard?
|
|
|
|
|
Theme.palette.directColor1 : Theme.palette.dangerColor1
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.keycardAlreadyUnlocked
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardAlreadyUnlocked
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Your Keycard is already unlocked!")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.success.pattern
|
2022-09-20 14:01:57 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.success.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.success.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.success.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.success.duration
|
|
|
|
|
loops: Constants.keycardAnimations.success.loops
|
2022-09-20 14:01:57 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-05 13:50:54 +00:00
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.recognizedKeycard
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Keycard recognized")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
|
font.weight: Font.Normal
|
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.success.pattern
|
2022-08-31 17:09:07 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.success.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.success.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.success.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.success.duration
|
|
|
|
|
loops: Constants.keycardAnimations.success.loops
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-31 17:09:07 +00:00
|
|
|
|
State {
|
2022-10-12 17:08:59 +00:00
|
|
|
|
name: "processing-success"
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess ||
|
2022-10-17 10:44:09 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameSuccess ||
|
2022-10-18 08:04:51 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPukSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCodeSuccess
|
2022-08-31 17:09:07 +00:00
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
2022-10-12 17:08:59 +00:00
|
|
|
|
text: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess) {
|
|
|
|
|
return qsTr("Key pair successfully migrated")
|
|
|
|
|
}
|
2022-10-17 10:44:09 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetSuccess) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard)
|
|
|
|
|
return qsTr("Your Keycard has been reset")
|
|
|
|
|
return qsTr("Keycard successfully factory reset")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardSuccess) {
|
|
|
|
|
return qsTr("Unlock successful")
|
|
|
|
|
}
|
2022-10-12 17:08:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameSuccess) {
|
|
|
|
|
return qsTr("Keycard successfully renamed")
|
|
|
|
|
}
|
2022-10-17 10:44:09 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPukSuccess) {
|
|
|
|
|
return qsTr("Keycard’s PUK successfully set")
|
|
|
|
|
}
|
2022-10-18 08:04:51 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCodeSuccess) {
|
|
|
|
|
return qsTr("Pairing code successfully set")
|
|
|
|
|
}
|
2022-10-12 17:08:59 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.strongSuccess.pattern
|
2022-08-31 17:09:07 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongSuccess.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongSuccess.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongSuccess.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.strongSuccess.duration
|
|
|
|
|
loops: Constants.keycardAnimations.strongSuccess.loops
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
2022-10-12 17:08:59 +00:00
|
|
|
|
text: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess) {
|
|
|
|
|
return qsTr("To complete migration close Status and log in with your new Keycard")
|
|
|
|
|
}
|
2022-10-17 10:44:09 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetSuccess) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard)
|
|
|
|
|
return qsTr("You can now create a new key pair on this Keycard")
|
|
|
|
|
return qsTr("You can now use this Keycard as if it\nwas a brand new empty Keycard")
|
|
|
|
|
}
|
2022-10-12 17:08:59 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
2022-10-12 17:08:59 +00:00
|
|
|
|
name: "processing-failure"
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateFailure ||
|
2022-10-17 10:44:09 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameFailure ||
|
2022-10-18 08:04:51 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPukFailure ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCodeFailure
|
2022-08-31 17:09:07 +00:00
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
2022-10-12 17:08:59 +00:00
|
|
|
|
text: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateFailure) {
|
|
|
|
|
return qsTr("Key pair failed to migrated")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardRenameFailure) {
|
|
|
|
|
return qsTr("Keycard renaming failed")
|
|
|
|
|
}
|
2022-10-17 10:44:09 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPukFailure) {
|
|
|
|
|
return qsTr("Setting Keycard’s PUK failed")
|
|
|
|
|
}
|
2022-10-18 08:04:51 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPairingCodeFailure) {
|
|
|
|
|
return qsTr("Setting pairing code failed")
|
|
|
|
|
}
|
2022-10-12 17:08:59 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
|
pattern: Constants.keycardAnimations.strongError.pattern
|
2022-08-31 17:09:07 +00:00
|
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop
|
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops
|
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongError.endImgIndex
|
|
|
|
|
duration: Constants.keycardAnimations.strongError.duration
|
|
|
|
|
loops: Constants.keycardAnimations.strongError.loops
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.keycardMetadataDisplay
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Accounts on this Keycard")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
|
|
|
|
source: Style.png("keycard/card-inserted")
|
|
|
|
|
pattern: ""
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.biometricsReadyToSign
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsReadyToSign
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Ready to authenticate...")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
|
|
|
|
source: Style.png("keycard/card-inserted")
|
|
|
|
|
pattern: ""
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.biometricsPasswordFailed
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPasswordFailed
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
|
|
|
|
source: Style.png("keycard/biometrics-fail")
|
|
|
|
|
pattern: ""
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Biometric scan failed")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: qsTr("Biometrics incorrect")
|
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.biometricsPinFailed
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
|
|
|
|
source: Style.png("keycard/plain-error")
|
|
|
|
|
pattern: ""
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Biometric scan failed")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
|
|
|
|
text: qsTr("Biometrics incorrect")
|
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: Constants.keycardSharedState.biometricsPinInvalid
|
|
|
|
|
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: image
|
|
|
|
|
source: Style.png("keycard/plain-error")
|
|
|
|
|
pattern: ""
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: title
|
|
|
|
|
text: qsTr("Biometric pin invalid")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize1
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: message
|
2022-09-23 13:53:13 +00:00
|
|
|
|
text: qsTr("The PIN length doesn't match Keycard's PIN length")
|
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
|
color: Theme.palette.baseColor1
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|