2022-08-05 13:50:54 +00:00
|
|
|
|
import QtQuick 2.14
|
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
|
|
import "./states"
|
|
|
|
|
|
|
|
|
|
StatusModal {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
property var sharedKeycardModule
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
width: Constants.keycard.general.popupWidth
|
|
|
|
|
height: {
|
|
|
|
|
if (!root.sharedKeycardModule.keyPairStoredOnKeycardIsKnown) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata) {
|
|
|
|
|
return Constants.keycard.general.popupBiggerHeight
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.factoryReset) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata) {
|
|
|
|
|
return Constants.keycard.general.popupBiggerHeight
|
|
|
|
|
}
|
|
|
|
|
}
|
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 Constants.keycard.general.popupBiggerHeight
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
return Constants.keycard.general.popupHeight
|
|
|
|
|
}
|
|
|
|
|
margins: Style.current.halfPadding
|
2022-08-05 13:50:54 +00:00
|
|
|
|
anchors.centerIn: parent
|
2022-08-31 17:09:07 +00:00
|
|
|
|
closePolicy: d.disablePopupClose? Popup.NoAutoClose : Popup.CloseOnEscape
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
header.title: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
|
|
|
|
return qsTr("Set up a new Keycard with an existing account")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.factoryReset) {
|
|
|
|
|
return qsTr("Factory reset a Keycard")
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
return qsTr("Authenticate")
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.unlockKeycard) {
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
}
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.displayKeycardContent) {
|
|
|
|
|
return qsTr("Check what’s on a Keycard")
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
|
id: d
|
2022-08-31 17:09:07 +00:00
|
|
|
|
property bool primaryButtonEnabled: false
|
|
|
|
|
property bool seedPhraseRevealed: false
|
2022-09-02 11:04:59 +00:00
|
|
|
|
readonly property bool disablePopupClose: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
2022-09-15 08:05:37 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
2022-09-02 11:04:59 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair ||
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess &&
|
|
|
|
|
root.sharedKeycardModule.migratingProfileKeyPair())
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
onDisablePopupCloseChanged: {
|
|
|
|
|
hasCloseButton = !disablePopupClose
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClosed: {
|
2022-09-15 08:05:37 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.doTertiaryAction()
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
contentItem: Item {
|
|
|
|
|
Loader {
|
|
|
|
|
id: loader
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
sourceComponent: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
2022-08-05 13:50:54 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateFailure ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair ||
|
2022-08-05 13:50:54 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetSuccess ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmptyMetadata ||
|
2022-08-05 13:50:54 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardNotEmpty ||
|
2022-09-20 14:01:57 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardAlreadyUnlocked ||
|
2022-08-05 13:50:54 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
2022-09-20 14:01:57 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardOptions ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardSuccess ||
|
2022-09-13 10:03:25 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsReadyToSign ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
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-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
2022-09-13 10:03:25 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPasswordFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid)
|
2022-08-05 13:50:54 +00:00
|
|
|
|
{
|
|
|
|
|
return initComponent
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmation ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata)
|
2022-08-05 13:50:54 +00:00
|
|
|
|
{
|
|
|
|
|
return confirmationComponent
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.selectExistingKeyPair)
|
|
|
|
|
{
|
|
|
|
|
return selectKeyPairComponent
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.createPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.repeatPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin ||
|
2022-09-13 10:03:25 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeychainPin ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinSet ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinVerified)
|
|
|
|
|
{
|
|
|
|
|
return keycardPinComponent
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPuk)
|
|
|
|
|
{
|
|
|
|
|
return keycardPukComponent
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongSeedPhrase)
|
|
|
|
|
{
|
|
|
|
|
return enterSeedPhraseComponent
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.seedPhraseDisplay)
|
|
|
|
|
{
|
|
|
|
|
return seedPhraseComponent
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.seedPhraseEnterWords)
|
|
|
|
|
{
|
|
|
|
|
return enterSeedPhraseWordsComponent
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterBiometricsPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongBiometricsPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPassword) {
|
|
|
|
|
return passwordComponent
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
|
|
|
|
return undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: initComponent
|
|
|
|
|
KeycardInit {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: confirmationComponent
|
|
|
|
|
KeycardConfirmation {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-05 13:50:54 +00:00
|
|
|
|
onConfirmationUpdated: {
|
2022-08-31 17:09:07 +00:00
|
|
|
|
d.primaryButtonEnabled = value
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: selectKeyPairComponent
|
|
|
|
|
SelectKeyPair {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
2022-09-02 11:04:59 +00:00
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onKeyPairSelected: {
|
|
|
|
|
d.primaryButtonEnabled = true
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: keycardPinComponent
|
|
|
|
|
KeycardPin {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPinUpdated: {
|
|
|
|
|
d.primaryButtonEnabled = pin.length === Constants.keycard.general.keycardPinLength
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-20 14:01:57 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: keycardPukComponent
|
|
|
|
|
KeycardPuk {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPukUpdated: {
|
|
|
|
|
d.primaryButtonEnabled = puk.length === Constants.keycard.general.keycardPukLength
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 17:09:07 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: enterSeedPhraseComponent
|
|
|
|
|
EnterSeedPhrase {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onValidation: {
|
|
|
|
|
d.primaryButtonEnabled = result
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: seedPhraseComponent
|
|
|
|
|
SeedPhrase {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
hideSeed = !d.seedPhraseRevealed
|
|
|
|
|
d.primaryButtonEnabled = Qt.binding(function(){ return d.seedPhraseRevealed })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onSeedPhraseRevealed: {
|
|
|
|
|
d.seedPhraseRevealed = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: enterSeedPhraseWordsComponent
|
|
|
|
|
EnterSeedPhraseWords {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onValidation: {
|
|
|
|
|
d.primaryButtonEnabled = result
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: passwordComponent
|
|
|
|
|
EnterPassword {
|
|
|
|
|
sharedKeycardModule: root.sharedKeycardModule
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
d.primaryButtonEnabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPasswordValid: {
|
|
|
|
|
d.primaryButtonEnabled = valid
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
leftButtons: [
|
|
|
|
|
StatusBackButton {
|
|
|
|
|
id: backButton
|
|
|
|
|
visible: root.sharedKeycardModule.currentState.displayBackButton
|
2022-09-13 10:03:25 +00:00
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
|
|
|
|
width: height
|
2022-08-05 13:50:54 +00:00
|
|
|
|
onClicked: {
|
|
|
|
|
root.sharedKeycardModule.currentState.backAction()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
rightButtons: [
|
2022-09-13 10:03:25 +00:00
|
|
|
|
StatusButton {
|
|
|
|
|
id: tertiaryButton
|
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
2022-09-20 14:01:57 +00:00
|
|
|
|
text: {
|
2022-09-15 08:05:37 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.selectExistingKeyPair ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardNotEmpty ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmptyMetadata ||
|
2022-09-20 14:01:57 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
2022-09-15 08:05:37 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin ||
|
2022-09-13 10:03:25 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin ||
|
|
|
|
|
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-15 08:05:37 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmation ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinVerified ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
2022-09-20 14:01:57 +00:00
|
|
|
|
return qsTr("Cancel")
|
2022-09-15 08:05:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.factoryReset) {
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinVerified ||
|
2022-09-15 08:05:37 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin ||
|
|
|
|
|
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-15 08:05:37 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmptyMetadata ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmation) {
|
2022-09-20 14:01:57 +00:00
|
|
|
|
return qsTr("Cancel")
|
2022-09-15 08:05:37 +00:00
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeychainPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsReadyToSign ||
|
|
|
|
|
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.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPasswordFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterBiometricsPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongBiometricsPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin)
|
2022-09-20 14:01:57 +00:00
|
|
|
|
return qsTr("Cancel")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.unlockKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardOptions ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase)
|
|
|
|
|
return qsTr("Cancel")
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.displayKeycardContent) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinVerified ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached)
|
|
|
|
|
return qsTr("Cancel")
|
|
|
|
|
}
|
2022-09-15 08:05:37 +00:00
|
|
|
|
|
2022-09-20 14:01:57 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
visible: text !== ""
|
|
|
|
|
enabled: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair) {
|
|
|
|
|
if (d.disablePopupClose) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.sharedKeycardModule.currentState.doTertiaryAction()
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-08-05 13:50:54 +00:00
|
|
|
|
StatusButton {
|
|
|
|
|
id: secondaryButton
|
2022-09-13 10:03:25 +00:00
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
2022-08-05 13:50:54 +00:00
|
|
|
|
text: {
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
if (root.sharedKeycardModule.loggedInUserUsesBiometricLogin()) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPassword)
|
|
|
|
|
return qsTr("Use biometrics instead")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPasswordFailed)
|
|
|
|
|
return qsTr("Use password instead")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin)
|
|
|
|
|
return qsTr("Use biometrics")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
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.biometricsReadyToSign ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty)
|
|
|
|
|
return qsTr("Use PIN")
|
2022-09-23 13:53:13 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid)
|
|
|
|
|
return qsTr("Update PIN")
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.unlockKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardOptions)
|
|
|
|
|
return qsTr("Unlock using PUK")
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-05 13:50:54 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
visible: text !== ""
|
|
|
|
|
enabled: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair) {
|
|
|
|
|
if (d.disablePopupClose) {
|
|
|
|
|
return false
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
if (root.sharedKeycardModule.loggedInUserUsesBiometricLogin() &&
|
|
|
|
|
(root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
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.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty))
|
|
|
|
|
return false
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.unlockKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardOptions)
|
|
|
|
|
return root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.offerPukForUnlock
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.sharedKeycardModule.currentState.doSecondaryAction()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
StatusButton {
|
|
|
|
|
id: primaryButton
|
2022-09-13 10:03:25 +00:00
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
2022-08-05 13:50:54 +00:00
|
|
|
|
text: {
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.createPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.repeatPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinSet) {
|
|
|
|
|
return qsTr("Input seed phrase")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.seedPhraseEnterWords) {
|
|
|
|
|
return qsTr("Yes, migrate key pair to this Keycard")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase) {
|
|
|
|
|
return qsTr("Yes, migrate key pair to Keycard")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongSeedPhrase) {
|
|
|
|
|
return qsTr("Try entering seed phrase again")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardNotEmpty) {
|
|
|
|
|
return qsTr("Check what is stored on this Keycard")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin) {
|
2022-09-13 10:03:25 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmation ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata) {
|
|
|
|
|
return qsTr("Factory reset this Keycard")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.selectExistingKeyPair ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmptyMetadata ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetSuccess ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.seedPhraseDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinVerified ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached) {
|
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.useUnlockLabelForLockedState)
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
return qsTr("Next")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateFailure) {
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keyPairMigrateSuccess) {
|
|
|
|
|
if (root.sharedKeycardModule.migratingProfileKeyPair())
|
|
|
|
|
return qsTr("Restart app & sign in using your new Keycard")
|
|
|
|
|
return qsTr("Done")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.factoryReset) {
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin) {
|
2022-09-13 10:03:25 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmation ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata) {
|
|
|
|
|
return qsTr("Factory reset this Keycard")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinVerified ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmptyMetadata) {
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (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
|
|
|
|
return qsTr("Unlock Keycard")
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetSuccess) {
|
2022-08-31 17:09:07 +00:00
|
|
|
|
return qsTr("Done")
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsReadyToSign ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin) {
|
|
|
|
|
return qsTr("Authenticate")
|
|
|
|
|
}
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty) {
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterBiometricsPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongBiometricsPassword) {
|
|
|
|
|
return qsTr("Update password & authenticate")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeychainPin) {
|
|
|
|
|
return qsTr("Update PIN & authenticate")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPasswordFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid) {
|
|
|
|
|
return qsTr("Try biometrics again")
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached) {
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.unlockKeycard) {
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardAlreadyUnlocked ||
|
2022-09-20 14:01:57 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardSuccess)
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.unlockKeycardOptions)
|
|
|
|
|
return qsTr("Unlock using seed phrase")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.createPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.repeatPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinSet ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPuk)
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongSeedPhrase) {
|
|
|
|
|
return qsTr("Try entering seed phrase again")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached) {
|
2022-09-13 10:03:25 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-21 13:11:39 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.displayKeycardContent) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardEmpty ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardMetadataDisplay) {
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin) {
|
|
|
|
|
return qsTr("I don’t know the PIN")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pinVerified) {
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPinRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPukRetriesReached ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.maxPairingSlotsReached) {
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
return ""
|
2022-08-05 13:50:54 +00:00
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
visible: text !== ""
|
2022-08-05 13:50:54 +00:00
|
|
|
|
enabled: {
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.migratingKeyPair) {
|
|
|
|
|
if (d.disablePopupClose) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
2022-09-02 11:04:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.selectExistingKeyPair ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmation ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.seedPhraseDisplay ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.seedPhraseEnterWords ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase) {
|
|
|
|
|
return d.primaryButtonEnabled
|
|
|
|
|
}
|
2022-09-02 11:04:59 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
2022-08-31 17:09:07 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.recognizedKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.createPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.repeatPin) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.factoryReset) {
|
2022-08-31 17:09:07 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmation ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata) {
|
|
|
|
|
return d.primaryButtonEnabled
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.readingKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.insertKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.keycardInserted ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeychainPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterBiometricsPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongBiometricsPassword ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPin) {
|
|
|
|
|
return d.primaryButtonEnabled
|
|
|
|
|
}
|
2022-09-20 14:01:57 +00:00
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.unlockKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterPuk ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongPuk)
|
|
|
|
|
return d.primaryButtonEnabled
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.createPin ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.repeatPin)
|
|
|
|
|
return false
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
icon.name: {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycard) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.seedPhraseEnterWords ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase) {
|
|
|
|
|
if (root.sharedKeycardModule.loggedInUserUsesBiometricLogin())
|
|
|
|
|
return "touch-id"
|
2022-09-26 11:01:26 +00:00
|
|
|
|
if (userProfile.isKeycardUser())
|
2022-09-13 10:03:25 +00:00
|
|
|
|
return "keycard"
|
2022-08-31 17:09:07 +00:00
|
|
|
|
return "password"
|
2022-09-26 11:01:26 +00:00
|
|
|
|
if (userProfile.isKeycardUser)
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication) {
|
|
|
|
|
if (root.sharedKeycardModule.loggedInUserUsesBiometricLogin()) {
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.pluginReader ||
|
|
|
|
|
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.biometricsPasswordFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinFailed ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsPinInvalid ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.biometricsReadyToSign ||
|
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.notKeycard ||
|
2022-09-21 13:11:39 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongKeycard)
|
2022-09-13 10:03:25 +00:00
|
|
|
|
return "touch-id"
|
2022-08-31 17:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-08-05 13:50:54 +00:00
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.sharedKeycardModule.currentState.doPrimaryAction()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|