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: {
2023-08-29 14:22:41 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToApp ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhrase ||
2022-12-27 13:20:58 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycard ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . renamingKeycard ||
2023-01-27 16:04:07 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . unlockingKeycard ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycard ) {
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-11-18 08:16:02 +00:00
readonly property bool copyFromAKeycardPartDone: root . sharedKeycardModule . keycardData & Constants . predefinedKeycardData . copyFromAKeycardPartDone
2023-08-29 14:22:41 +00:00
readonly property bool continuousProcessingAnimation: root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToApp ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhrase ||
2022-12-27 13:20:58 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycard ||
2023-01-27 16:04:07 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . unlockingKeycard ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycard
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 {
2022-12-16 09:37:08 +00:00
id: keyPairForProcessingComponent
2022-08-31 17:09:07 +00:00
KeyPairItem {
2022-12-16 09:37:08 +00:00
keyPairType: root . sharedKeycardModule . keyPairForProcessing . pairType
2023-05-18 18:28:46 +00:00
keyPairKeyUid: root . sharedKeycardModule . keyPairForProcessing . keyUid
2022-12-16 09:37:08 +00:00
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
}
}
Component {
id: unknownKeyPairCompontnt
KeyPairUnknownItem {
2023-05-18 18:28:46 +00:00
keyPairKeyUid: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ?
root . sharedKeycardModule . keyPairHelper . keyUid
: root . sharedKeycardModule . keyPairForProcessing . keyUid
2022-12-27 13:20:58 +00:00
keyPairName: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ?
root . sharedKeycardModule . keyPairHelper . name
: root . sharedKeycardModule . keyPairForProcessing . name
keyPairIcon: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ?
root . sharedKeycardModule . keyPairHelper . icon
: root . sharedKeycardModule . keyPairForProcessing . icon
keyPairImage: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ?
root . sharedKeycardModule . keyPairHelper . image
: root . sharedKeycardModule . keyPairForProcessing . image
keyPairDerivedFrom: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ?
root . sharedKeycardModule . keyPairHelper . derivedFrom
: root . sharedKeycardModule . keyPairForProcessing . derivedFrom
2023-05-18 18:28:46 +00:00
keyPairCardLocked: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ?
root . sharedKeycardModule . keyPairHelper . locked
: root . sharedKeycardModule . keyPairForProcessing . locked
2022-12-27 13:20:58 +00:00
keyPairAccounts: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ?
root . sharedKeycardModule . keyPairHelper . accounts
: root . sharedKeycardModule . keyPairForProcessing . accounts
2022-08-31 17:09:07 +00:00
}
}
ColumnLayout {
2023-08-29 14:22:41 +00:00
id: layout
anchors.centerIn: parent
width: parent . width
2022-08-31 17:09:07 +00:00
anchors.leftMargin: Style . current . xlPadding
anchors.rightMargin: Style . current . xlPadding
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
2023-08-29 14:22:41 +00:00
Layout.alignment: Qt . AlignHCenter
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 ||
2023-08-29 14:22:41 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToApp ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhrase ||
2022-12-27 13:20:58 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycard ||
2022-10-17 10:12:22 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . renamingKeycard ||
2023-01-27 16:04:07 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . unlockingKeycard ||
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 ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . changingKeycardPairingCode ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycard
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
2022-08-05 13:50:54 +00:00
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . WordWrap
}
2022-08-31 17:09:07 +00:00
2023-08-29 14:22:41 +00:00
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
}
Loader {
id: loader
anchors.bottom: parent . bottom
anchors.left: parent . left
anchors.right: parent . right
anchors.leftMargin: Style . current . xlPadding
anchors.rightMargin: Style . current . xlPadding
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 . migratingKeypairToKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
return true
2022-08-31 17:09:07 +00:00
}
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhrase ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseFailure ) {
return true
2022-09-13 10:03:25 +00:00
}
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhrase ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . seedPhraseAlreadyInUse ) {
return true
2022-09-21 13:11:39 +00:00
}
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . seedPhraseAlreadyInUse ) {
return true
2022-10-12 17:08:59 +00:00
}
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . factoryReset ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
return true
2022-10-17 10:12:22 +00:00
}
2023-08-30 15:54:41 +00:00
if ( ! ! root . sharedKeycardModule . keyPairForProcessing &&
( 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 . wrongKeycard ) )
return true
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . authentication &&
! ! root . sharedKeycardModule . keyPairForProcessing &&
root . sharedKeycardModule . keyPairForProcessing . 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 ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . maxPukRetriesReached ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . maxPairingSlotsReached ||
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-10-17 10:44:09 +00:00
}
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . displayKeycardContent ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
return true
2022-10-18 08:04:51 +00:00
}
2023-08-29 14:22:41 +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
}
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
}
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
}
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
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard && ! 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 . removeKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyToKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardSuccess )
return true
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . migrateFromKeycardToApp ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migrateKeypairToApp ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToApp ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateFailure ) {
return true
2022-11-18 08:16:02 +00:00
}
2022-08-31 17:09:07 +00:00
}
2023-08-29 14:22:41 +00:00
return false
}
sourceComponent: {
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
if ( root . sharedKeycardModule . keyPairStoredOnKeycardIsKnown ) {
2022-12-16 09:37:08 +00:00
return keyPairForProcessingComponent
}
2023-08-29 14:22:41 +00:00
return unknownKeyPairCompontnt
2022-12-16 09:37:08 +00:00
}
2023-08-29 14:22:41 +00:00
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 . migratingKeypairToKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateFailure ) {
return keyPairForProcessingComponent
}
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
if ( root . sharedKeycardModule . keyPairStoredOnKeycardIsKnown ) {
2022-12-16 09:37:08 +00:00
return keyPairForProcessingComponent
2022-08-31 17:09:07 +00:00
}
2023-08-29 14:22:41 +00:00
return unknownKeyPairCompontnt
2022-08-31 17:09:07 +00:00
}
2022-12-26 12:52:21 +00:00
2023-08-29 14:22:41 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhrase ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseFailure ) {
return keyPairForProcessingComponent
}
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
if ( root . sharedKeycardModule . keyPairStoredOnKeycardIsKnown ) {
2022-12-26 12:52:21 +00:00
return keyPairForProcessingComponent
}
2023-08-29 14:22:41 +00:00
return unknownKeyPairCompontnt
2022-12-26 12:52:21 +00:00
}
2022-12-27 13:20:58 +00:00
2023-08-29 14:22:41 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhrase ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . seedPhraseAlreadyInUse ) {
return keyPairForProcessingComponent
}
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
if ( root . sharedKeycardModule . keyPairStoredOnKeycardIsKnown ) {
2022-12-27 13:20:58 +00:00
return keyPairForProcessingComponent
}
2023-08-29 14:22:41 +00:00
return unknownKeyPairCompontnt
2022-12-27 13:20:58 +00:00
}
2023-08-29 14:22:41 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . seedPhraseAlreadyInUse ) {
return keyPairForProcessingComponent
2022-08-31 17:09:07 +00:00
}
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . factoryReset ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
if ( root . sharedKeycardModule . keyPairStoredOnKeycardIsKnown ) {
2022-12-28 14:57:13 +00:00
return keyPairForProcessingComponent
2022-09-13 10:03:25 +00:00
}
2023-08-29 14:22:41 +00:00
return unknownKeyPairCompontnt
2022-09-13 10:03:25 +00:00
}
2023-08-30 15:54:41 +00:00
if ( ! ! root . sharedKeycardModule . keyPairForProcessing &&
( 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 . wrongKeycard ) )
return keyPairForProcessingComponent
2023-08-29 14:22:41 +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 ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . maxPukRetriesReached ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . maxPairingSlotsReached ||
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 keyPairForProcessingComponent
2022-09-21 13:11:39 +00:00
}
2023-08-29 14:22:41 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . displayKeycardContent ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ) {
if ( root . sharedKeycardModule . keyPairStoredOnKeycardIsKnown ) {
2022-12-16 09:37:08 +00:00
return keyPairForProcessingComponent
2022-10-12 17:08:59 +00:00
}
2023-08-29 14:22:41 +00:00
return unknownKeyPairCompontnt
2022-10-12 17:08:59 +00:00
}
2023-08-29 14:22:41 +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 keyPairForProcessingComponent
2022-10-17 10:44:09 +00:00
}
2023-08-29 14:22:41 +00:00
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
}
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
}
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
}
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
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardMetadataDisplay ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . removeKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyToKeycard ) {
if ( root . sharedKeycardModule . keyPairStoredOnKeycardIsKnown ) {
2022-10-18 08:04:51 +00:00
return keyPairForProcessingComponent
2022-11-18 08:16:02 +00:00
}
2023-08-29 14:22:41 +00:00
return unknownKeyPairCompontnt
}
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 . copyingKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardSuccess )
return keyPairForProcessingComponent
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . migrateFromKeycardToApp ) {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migrateKeypairToApp ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToApp ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keyPairMigrateFailure ) {
return keyPairForProcessingComponent
2022-11-18 08:16:02 +00:00
}
2022-08-31 17:09:07 +00:00
}
2023-08-29 14:22:41 +00:00
return undefined
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
2022-11-18 08:16:02 +00:00
text: {
if ( d . copyFromAKeycardPartDone ) {
return qsTr ( "Insert empty Keycard..." )
}
return qsTr ( "Insert Keycard..." )
}
2022-08-05 13:50:54 +00:00
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 ||
2023-08-29 14:22:41 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToKeycard ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToApp ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhrase ||
2022-12-27 13:20:58 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycard ||
2022-10-17 10:12:22 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . renamingKeycard ||
2023-01-27 16:04:07 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . unlockingKeycard ||
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 ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . changingKeycardPairingCode ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycard
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..." )
}
2023-08-29 14:22:41 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToKeycard ) {
2022-10-12 17:08:59 +00:00
return qsTr ( "Migrating key pair to Keycard" )
}
2023-08-29 14:22:41 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migratingKeypairToApp ) {
return qsTr ( "Migrating keypair to Status" )
}
2022-12-16 09:37:08 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhrase ) {
return qsTr ( "Creating new account..." )
}
2022-12-26 12:52:21 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhrase ) {
return qsTr ( "Setting a new Keycard..." )
}
2022-12-27 13:20:58 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycard ) {
return qsTr ( "Importing from Keycard..." )
}
2022-10-12 17:08:59 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . renamingKeycard ) {
return qsTr ( "Renaming keycard..." )
}
2023-01-27 16:04:07 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . unlockingKeycard ) {
return qsTr ( "Unlocking 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-11-18 08:16:02 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycard ) {
return qsTr ( "Copying Keycard..." )
}
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-11-14 10:24:16 +00:00
pattern: d . continuousProcessingAnimation ?
Constants.keycardAnimations.processing.pattern :
Constants . keycardAnimations . warning . pattern
2022-08-31 17:09:07 +00:00
source: ""
2022-11-14 10:24:16 +00:00
startImgIndexForTheFirstLoop: d . continuousProcessingAnimation ?
Constants.keycardAnimations.processing.startImgIndexForTheFirstLoop :
Constants . keycardAnimations . warning . startImgIndexForTheFirstLoop
startImgIndexForOtherLoops: d . continuousProcessingAnimation ?
Constants.keycardAnimations.processing.startImgIndexForOtherLoops :
Constants . keycardAnimations . warning . startImgIndexForOtherLoops
endImgIndex: d . continuousProcessingAnimation ?
Constants.keycardAnimations.processing.endImgIndex :
Constants . keycardAnimations . warning . endImgIndex
duration: d . continuousProcessingAnimation ?
Constants.keycardAnimations.processing.duration :
Constants . keycardAnimations . warning . duration
loops: d . continuousProcessingAnimation ?
Constants.keycardAnimations.processing.loops :
Constants . keycardAnimations . warning . loops
2022-08-05 13:50:54 +00:00
}
PropertyChanges {
target: message
text: ""
}
} ,
2023-03-03 10:24:50 +00:00
State {
name: Constants . keycardSharedState . noPCSCService
when: root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . noPCSCService
PropertyChanges {
target: title
text: qsTr ( "PCSC not available" )
font.pixelSize: Constants . keycard . general . fontSize1
font.weight: Font . Bold
color: Theme . palette . dangerColor1
}
PropertyChanges {
target: image
pattern: Constants . keycardAnimations . strongError . pattern
source: ""
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
}
PropertyChanges {
target: message
text: qsTr ( "The Smartcard reader (PCSC service), required\nfor using Keycard, is not currently working.\nEnsure PCSC is installed and running and try again" )
font.pixelSize: Constants . keycard . general . fontSize2
color: Theme . palette . dangerColor1
}
} ,
2022-08-05 13:50:54 +00:00
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-12-16 09:37:08 +00:00
text: {
if ( root . sharedKeycardModule . keycardData & Constants . predefinedKeycardData . disableSeedPhraseForUnlock &&
! ( root . sharedKeycardModule . keycardData & Constants . predefinedKeycardData . offerPukForUnlock ) ) {
return qsTr ( "Please run \"Unlock Keycard\" flow directly" )
}
return ""
}
font.pixelSize: Constants . keycard . general . fontSize2
color: Theme . palette . directColor1
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 ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . changePairingCode ||
2023-08-30 15:54:41 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard ||
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . factoryReset ) {
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
2022-11-18 08:16:02 +00:00
text: {
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ) {
return qsTr ( "To migrate %1 on to this Keycard, you\nwill need to perform a factory reset first" )
2022-12-16 09:37:08 +00:00
. arg ( root . sharedKeycardModule . keyPairForProcessing . name )
}
2022-12-26 12:52:21 +00:00
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ||
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ) {
2022-12-16 09:37:08 +00:00
return qsTr ( "To create a new account on to this Keycard, you\nwill need to perform a factory reset first" )
2022-11-18 08:16:02 +00:00
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard ) {
return qsTr ( "To copy %1 on to this Keycard, you\nwill need to perform a factory reset first" )
2022-12-16 09:37:08 +00:00
. arg ( root . sharedKeycardModule . keyPairForProcessing . name )
2022-11-18 08:16:02 +00:00
}
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 . 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-11-18 08:16:02 +00:00
text: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard ?
2022-09-20 14:01:57 +00:00
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-11-18 08:16:02 +00:00
color: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard ?
2022-09-20 14:01:57 +00:00
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 ) {
2022-11-18 08:16:02 +00:00
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard )
2022-09-21 13:11:39 +00:00
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-11-18 08:16:02 +00:00
color: root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard ?
2022-09-20 14:01:57 +00:00
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-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseSuccess ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseSuccess ||
2022-12-27 13:20:58 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardSuccess ||
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 ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . changingKeycardPairingCodeSuccess ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardSuccess
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 ) {
2023-08-29 14:22:41 +00:00
return qsTr ( "Keypair successfully migrated" )
2022-10-12 17:08:59 +00:00
}
2022-12-16 09:37:08 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseSuccess ) {
return qsTr ( "New account successfully created" )
}
2022-12-26 12:52:21 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseSuccess ) {
return qsTr ( "Keycard is ready to use!" )
}
2022-12-27 13:20:58 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardSuccess ) {
return qsTr ( "Account successfully imported" )
}
2022-10-17 10:44:09 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . factoryResetSuccess ) {
2022-11-18 08:16:02 +00:00
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard )
2022-10-17 10:44:09 +00:00
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-11-18 08:16:02 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardSuccess ) {
return qsTr ( "This Keycard is now a copy of %1" )
2022-12-16 09:37:08 +00:00
. arg ( root . sharedKeycardModule . keyPairForProcessing . name )
2022-11-18 08:16:02 +00:00
}
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 ) {
2023-08-29 14:22:41 +00:00
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . migrateFromKeycardToApp ) {
return qsTr ( "Keypair was removed from Keycard and is now stored on device.\nYou no longer need this Keycard to transact with the below accounts." )
}
2022-10-12 17:08:59 +00:00
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 ) {
2022-11-18 08:16:02 +00:00
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycard ||
2022-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardNewSeedPhrase ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . createCopyOfAKeycard )
2022-10-17 10:44:09 +00:00
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-12-16 09:37:08 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseFailure ||
2022-12-26 12:52:21 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseFailure ||
2022-12-27 13:20:58 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardFailure ||
2022-10-17 10:44:09 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardRenameFailure ||
2023-01-27 16:04:07 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . unlockKeycardFailure ||
2022-10-18 08:04:51 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . changingKeycardPukFailure ||
2022-11-18 08:16:02 +00:00
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . changingKeycardPairingCodeFailure ||
root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardFailure
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 ) {
2023-08-29 14:22:41 +00:00
return qsTr ( "Failed to migrate keypair" )
2022-10-12 17:08:59 +00:00
}
2022-12-16 09:37:08 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountNewSeedPhraseFailure ) {
return qsTr ( "Creating new account failed" )
}
2022-12-26 12:52:21 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . creatingAccountOldSeedPhraseFailure ) {
return qsTr ( "Setting a Keycard failed" )
}
2022-12-27 13:20:58 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . importingFromKeycardFailure ) {
return qsTr ( "Importing account failed" )
}
2022-10-12 17:08:59 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . keycardRenameFailure ) {
return qsTr ( "Keycard renaming failed" )
}
2023-01-27 16:04:07 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . unlockKeycardFailure ) {
return qsTr ( "Unlock a Keycard 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-11-18 08:16:02 +00:00
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyingKeycardFailure ) {
return qsTr ( "Copying %1 Keycard failed" )
2022-12-16 09:37:08 +00:00
. arg ( root . sharedKeycardModule . keyPairForProcessing . name )
2022-11-18 08:16:02 +00:00
}
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-11-18 08:16:02 +00:00
} ,
State {
name: Constants . keycardSharedState . removeKeycard
when: root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . removeKeycard
PropertyChanges {
target: title
text: qsTr ( "Remove Keycard" )
font.pixelSize: Constants . keycard . general . fontSize1
font.weight: Font . Bold
color: Theme . palette . directColor1
}
PropertyChanges {
target: image
pattern: Constants . keycardAnimations . cardRemoved . pattern
source: ""
startImgIndexForTheFirstLoop: Constants . keycardAnimations . cardRemoved . startImgIndexForTheFirstLoop
startImgIndexForOtherLoops: Constants . keycardAnimations . cardRemoved . startImgIndexForOtherLoops
endImgIndex: Constants . keycardAnimations . cardRemoved . endImgIndex
duration: Constants . keycardAnimations . cardRemoved . duration
loops: Constants . keycardAnimations . cardRemoved . loops
}
PropertyChanges {
target: message
text: ""
}
} ,
State {
name: Constants . keycardSharedState . sameKeycard
when: root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . sameKeycard
PropertyChanges {
target: title
text: qsTr ( "Oops this is the same Keycard!" )
font.pixelSize: Constants . keycard . general . fontSize1
font.weight: Font . Bold
color: Theme . palette . directColor1
}
PropertyChanges {
target: image
pattern: Constants . keycardAnimations . strongError . pattern
source: ""
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
}
PropertyChanges {
target: message
text: qsTr ( "You need to remove this Keycard and insert\nan empty new or factory reset Keycard" )
font.pixelSize: Constants . keycard . general . fontSize2
color: Theme . palette . directColor1
}
} ,
State {
name: Constants . keycardSharedState . copyToKeycard
when: root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . copyToKeycard
PropertyChanges {
target: title
text: qsTr ( "Copy “%1” to inserted keycard" )
2022-12-16 09:37:08 +00:00
. arg ( root . sharedKeycardModule . keyPairForProcessing . name )
2022-11-18 08:16:02 +00:00
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-12-26 12:52:21 +00:00
} ,
State {
name: Constants . keycardSharedState . seedPhraseAlreadyInUse
when: root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . seedPhraseAlreadyInUse
PropertyChanges {
target: title
2022-12-27 13:20:58 +00:00
text: {
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . setupNewKeycardOldSeedPhrase ) {
return qsTr ( "This seed phrase has already been imported" )
}
if ( root . sharedKeycardModule . currentState . flowType === Constants . keycardSharedFlow . importFromKeycard ) {
return qsTr ( "This keycard has already been imported" )
}
return ""
}
font.pixelSize: Constants . keycard . general . fontSize1
font.weight: Font . Bold
color: Theme . palette . directColor1
2022-12-26 12:52:21 +00:00
}
PropertyChanges {
target: image
2022-12-27 13:20:58 +00:00
pattern: Constants . keycardAnimations . strongSuccess . pattern
2022-12-26 12:52:21 +00:00
source: ""
2022-12-27 13:20:58 +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-12-26 12:52:21 +00:00
}
PropertyChanges {
target: message
2022-12-27 13:20:58 +00:00
text: ""
2022-12-26 12:52:21 +00:00
}
2023-08-29 14:22:41 +00:00
} ,
State {
name: Constants . keycardSharedState . migrateKeypairToApp
when: root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migrateKeypairToApp
PropertyChanges {
target: title
text: {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migrateKeypairToApp ) {
return qsTr ( "Are you sure you want to migrate\nthis keypair to Status?" )
}
return ""
}
font.pixelSize: Constants . keycard . general . fontSize1
font.weight: Font . Bold
color: Theme . palette . directColor1
horizontalAlignment: Text . AlignHCenter
}
PropertyChanges {
target: image
visible: false
}
PropertyChanges {
target: message
text: {
if ( root . sharedKeycardModule . currentState . stateType === Constants . keycardSharedState . migrateKeypairToApp ) {
let t = qsTr ( "%1 keypair and its derived account(s) will be fully removed from Keycard and stored on device." ,
"" ,
root . sharedKeycardModule . keyPairForProcessing . accounts . count )
. arg ( root . sharedKeycardModule . keyPairForProcessing . name )
t += qsTr ( "This will make your keypair and derived account(s) less secure as you will no longer require this Keycard to transact." ,
"" ,
root . sharedKeycardModule . keyPairForProcessing . accounts . count )
return t
}
return ""
}
font.pixelSize: Constants . keycard . general . fontSize2
color: Theme . palette . directColor1
Layout.leftMargin: 2 * Style . current . xlPadding
Layout.rightMargin: 2 * Style . current . xlPadding
Layout.preferredWidth: layout . width - 4 * Style . current . xlPadding
}
2022-08-05 13:50:54 +00:00
}
]
}