2022-11-07 11:43:34 +00:00
|
|
|
|
import QtQuick 2.14
|
|
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
property var sharedKeycardModule
|
|
|
|
|
|
|
|
|
|
property bool primaryButtonEnabled: false
|
2022-11-09 10:22:08 +00:00
|
|
|
|
readonly property bool disablePopupClose: {
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.renamingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPin:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPuk:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCode:
|
|
|
|
|
case Constants.keycardSharedState.migratingKeyPair:
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateSuccess:
|
|
|
|
|
return root.sharedKeycardModule.migratingProfileKeyPair()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
}
|
2022-11-07 11:43:34 +00:00
|
|
|
|
|
|
|
|
|
property list<Item> leftButtons: [
|
|
|
|
|
StatusBackButton {
|
|
|
|
|
id: backButton
|
|
|
|
|
visible: root.sharedKeycardModule.currentState.displayBackButton
|
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
|
|
|
|
width: height
|
|
|
|
|
onClicked: {
|
2022-11-10 09:06:42 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.doBackAction()
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
property list<StatusBaseButton> rightButtons: [
|
|
|
|
|
StatusButton {
|
2022-11-10 09:06:42 +00:00
|
|
|
|
id: cancelButton
|
2022-11-07 11:43:34 +00:00
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
2022-11-10 09:06:42 +00:00
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
|
visible: {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.flowType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.selectExistingKeyPair:
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetSuccess:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.factoryReset:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.authentication:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeychainPin:
|
|
|
|
|
case Constants.keycardSharedState.biometricsReadyToSign:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPassword:
|
|
|
|
|
case Constants.keycardSharedState.wrongPassword:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPasswordFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
|
|
|
|
case Constants.keycardSharedState.enterBiometricsPassword:
|
|
|
|
|
case Constants.keycardSharedState.wrongBiometricsPassword:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPuk:
|
|
|
|
|
case Constants.keycardSharedState.wrongPuk:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardOptions:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.displayKeycardContent:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.renameKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.changeKeycardPin:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.changeKeycardPuk:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.createPuk:
|
|
|
|
|
case Constants.keycardSharedState.repeatPuk:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.changePairingCode:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.createPairingCode:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return true
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-10 09:06:42 +00:00
|
|
|
|
return false
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
enabled: {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.migratingKeyPair:
|
|
|
|
|
case Constants.keycardSharedState.renamingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPin:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPuk:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCode:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
if (root.disablePopupClose) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
2022-11-10 09:06:42 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.doCancelAction()
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
|
id: secondaryButton
|
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
|
|
|
|
text: {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.flowType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.authentication:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
if (userProfile.usingBiometricLogin) {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPassword:
|
|
|
|
|
case Constants.keycardSharedState.wrongPassword:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Use biometrics instead")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.biometricsPasswordFailed:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Use password instead")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Use biometrics")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.biometricsReadyToSign:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinFailed:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Use PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Update PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardOptions:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock using PUK")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
visible: text !== ""
|
|
|
|
|
enabled: {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.migratingKeyPair:
|
|
|
|
|
case Constants.keycardSharedState.renamingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPin:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPuk:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCode:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
if (root.disablePopupClose) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.flowType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.authentication:
|
|
|
|
|
if (userProfile.usingBiometricLogin) {
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardOptions:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.offerPukForUnlock
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.sharedKeycardModule.currentState.doSecondaryAction()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
|
id: primaryButton
|
|
|
|
|
objectName: "PrimaryButton"
|
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
|
|
|
|
text: {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.flowType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
case Constants.keycardSharedState.pinSet:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Input seed phrase")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseEnterWords:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Yes, migrate key pair to this Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Yes, migrate key pair to Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongSeedPhrase:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Try entering seed phrase again")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Check what is stored on this Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Factory reset this Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.selectExistingKeyPair:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetSuccess:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseDisplay:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.useUnlockLabelForLockedState)
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.migratingKeyPair:
|
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateFailure:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateSuccess:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
if (root.sharedKeycardModule.migratingProfileKeyPair())
|
|
|
|
|
return qsTr("Restart app & sign in using your new Keycard")
|
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.factoryReset:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Factory reset this Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetSuccess:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.authentication:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.biometricsReadyToSign:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPassword:
|
|
|
|
|
case Constants.keycardSharedState.wrongPassword:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Authenticate")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterBiometricsPassword:
|
|
|
|
|
case Constants.keycardSharedState.wrongBiometricsPassword:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Update password & authenticate")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongKeychainPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Update PIN & authenticate")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.biometricsPasswordFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Try biometrics again")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
case Constants.keycardSharedState.keycardAlreadyUnlocked:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardSuccess:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardOptions:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock using seed phrase")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
case Constants.keycardSharedState.pinSet:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.enterPuk:
|
|
|
|
|
case Constants.keycardSharedState.wrongPuk:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongSeedPhrase:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Try entering seed phrase again")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.displayKeycardContent:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.renameKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.keycardRenameSuccess:
|
|
|
|
|
case Constants.keycardSharedState.keycardRenameFailure:
|
|
|
|
|
case Constants.keycardSharedState.renamingKeycard:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterKeycardName:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Rename this Keycard")
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.changeKeycardPin:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPin:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPinSuccess:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPinFailure:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.changeKeycardPuk:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPuk:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPukSuccess:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPukFailure:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.changePairingCode:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCode:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCodeSuccess:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCodeFailure:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("I don’t know the PIN")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.createPairingCode:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Set paring code")
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
visible: text !== ""
|
|
|
|
|
enabled: {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.migratingKeyPair:
|
|
|
|
|
case Constants.keycardSharedState.renamingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPin:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPuk:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCode:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
if (root.disablePopupClose) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.flowType) {
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.selectExistingKeyPair:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseDisplay:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseEnterWords:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return root.primaryButtonEnabled
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return false
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.factoryReset:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.authentication:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeychainPin:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPassword:
|
|
|
|
|
case Constants.keycardSharedState.wrongPassword:
|
|
|
|
|
case Constants.keycardSharedState.enterBiometricsPassword:
|
|
|
|
|
case Constants.keycardSharedState.wrongBiometricsPassword:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.enterPuk:
|
|
|
|
|
case Constants.keycardSharedState.wrongPuk:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return root.primaryButtonEnabled
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return false
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.renameKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterKeycardName:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return root.primaryButtonEnabled
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.changePairingCode:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.createPairingCode:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return root.primaryButtonEnabled
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
icon.name: {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.flowType) {
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycard:
|
|
|
|
|
if (root.sharedKeycardModule.migratingProfileKeyPair()) {
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseEnterWords:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
if (userProfile.usingBiometricLogin)
|
|
|
|
|
return "touch-id"
|
|
|
|
|
if (userProfile.isKeycardUser)
|
|
|
|
|
return "keycard"
|
|
|
|
|
return "password"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.authentication:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
if (userProfile.usingBiometricLogin) {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPasswordFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
|
|
|
|
case Constants.keycardSharedState.biometricsReadyToSign:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return "touch-id"
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
break
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.sharedKeycardModule.currentState.doPrimaryAction()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|