2024-02-08 16:59:53 +00:00
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
2022-11-07 11:43:34 +00:00
|
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
2022-12-16 09:37:08 +00:00
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-11-07 11:43:34 +00:00
|
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
property var sharedKeycardModule
|
|
|
|
|
|
|
|
|
|
property bool primaryButtonEnabled: false
|
2023-01-04 15:01:10 +00:00
|
|
|
|
|
2023-05-23 12:46:16 +00:00
|
|
|
|
signal cancelBtnClicked()
|
2024-08-05 13:44:32 +00:00
|
|
|
|
signal accountLimitWarning()
|
2023-05-23 12:46:16 +00:00
|
|
|
|
|
2023-01-04 15:01:10 +00:00
|
|
|
|
// disables action buttons (back, cancel, primary, secondary) and close button (upper right "X" button) as well
|
2023-02-14 11:37:59 +00:00
|
|
|
|
readonly property bool disableActionPopupButtons: {
|
|
|
|
|
if (root.sharedKeycardModule.disablePopup) {
|
2023-01-04 15:01:10 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2023-02-14 11:37:59 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.renamingKeycard:
|
2023-01-27 16:04:07 +00:00
|
|
|
|
case Constants.keycardSharedState.unlockingKeycard:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
case Constants.keycardSharedState.changingKeycardPin:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPuk:
|
|
|
|
|
case Constants.keycardSharedState.changingKeycardPairingCode:
|
2023-08-29 14:22:41 +00:00
|
|
|
|
case Constants.keycardSharedState.migratingKeypairToApp:
|
|
|
|
|
case Constants.keycardSharedState.migratingKeypairToKeycard:
|
2022-12-16 09:37:08 +00:00
|
|
|
|
case Constants.keycardSharedState.creatingAccountNewSeedPhrase:
|
2022-12-26 12:52:21 +00:00
|
|
|
|
case Constants.keycardSharedState.creatingAccountOldSeedPhrase:
|
2022-12-27 13:20:58 +00:00
|
|
|
|
case Constants.keycardSharedState.importingFromKeycard:
|
2022-11-18 08:16:02 +00:00
|
|
|
|
case Constants.keycardSharedState.copyingKeycard:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
return true
|
2023-03-03 10:13:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// disables only close button (upper right "X" button)
|
|
|
|
|
readonly property bool disableCloseButton: {
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
|
|
|
|
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
|
2023-01-04 15:01:10 +00:00
|
|
|
|
enabled: !root.disableActionPopupButtons
|
2024-02-08 16:59:53 +00:00
|
|
|
|
|
|
|
|
|
Layout.minimumWidth: implicitWidth
|
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
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-12-16 09:37:08 +00:00
|
|
|
|
borderColor: Theme.palette.baseColor2
|
|
|
|
|
normalColor: "transparent"
|
2022-11-10 09:06:42 +00:00
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
|
visible: {
|
2023-03-03 10:24:50 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.noPCSCService) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
|
2022-12-16 09:37:08 +00:00
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardNewSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-12-16 09:37:08 +00:00
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
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:
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-12-26 12:52:21 +00:00
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardOldSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-12-26 12:52:21 +00:00
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.recognizedKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
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:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
2022-12-27 13:20:58 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.importFromKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-12-27 13:20:58 +00:00
|
|
|
|
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:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
2022-12-26 12:52:21 +00:00
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
case Constants.keycardSharedFlow.factoryReset:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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
|
|
|
|
|
|
2023-10-27 17:14:39 +00:00
|
|
|
|
case Constants.keycardSharedFlow.sign:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2023-10-27 17:14:39 +00:00
|
|
|
|
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.biometricsPinFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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-12-16 09:37:08 +00:00
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
// we're sure that we cannot unlock it from here using seed phrase and also in this point max num of puk retries is reached
|
|
|
|
|
// the only option to unlock a keycard is to run unlock flow from details view of the locked keycard
|
|
|
|
|
return root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.displayKeycardContent:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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-18 08:16:02 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.createCopyOfAKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-18 08:16:02 +00:00
|
|
|
|
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:
|
|
|
|
|
case Constants.keycardSharedState.removeKeycard:
|
|
|
|
|
case Constants.keycardSharedState.sameKeycard:
|
|
|
|
|
case Constants.keycardSharedState.copyToKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.wrongSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
let copyFromAKeycardPartDone = root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.copyFromAKeycardPartDone
|
|
|
|
|
if (copyFromAKeycardPartDone) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
break
|
2023-08-29 14:22:41 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.migrateFromKeycardToApp:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.migrateKeypairToApp:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.wrongSeedPhrase:
|
2023-09-01 13:32:21 +00:00
|
|
|
|
case Constants.keycardSharedState.createPassword:
|
|
|
|
|
case Constants.keycardSharedState.confirmPassword:
|
2023-09-04 16:06:51 +00:00
|
|
|
|
return !root.sharedKeycardModule.forceFlow
|
2023-08-29 14:22:41 +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
|
|
|
|
}
|
2023-09-04 16:06:51 +00:00
|
|
|
|
enabled: !root.sharedKeycardModule.forceFlow && !root.disableActionPopupButtons
|
2022-11-07 11:43:34 +00:00
|
|
|
|
onClicked: {
|
2023-05-23 12:46:16 +00:00
|
|
|
|
root.cancelBtnClicked();
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
|
id: secondaryButton
|
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
2022-12-16 09:37:08 +00:00
|
|
|
|
borderColor: Theme.palette.baseColor2
|
|
|
|
|
normalColor: "transparent"
|
2022-11-07 11:43:34 +00:00
|
|
|
|
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
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
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
|
|
|
|
|
|
2023-10-27 17:14:39 +00:00
|
|
|
|
case Constants.keycardSharedFlow.sign:
|
|
|
|
|
if (userProfile.usingBiometricLogin) {
|
|
|
|
|
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
return qsTr("Use biometrics")
|
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2023-10-27 17:14:39 +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:
|
|
|
|
|
return qsTr("Use PIN")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
|
|
|
|
return qsTr("Update PIN")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardOptions:
|
2022-12-16 09:37:08 +00:00
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock &&
|
|
|
|
|
!(root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.offerPukForUnlock)) {
|
|
|
|
|
// In case max puk retries or free pairing slots is reached and user is running unlock flow from a flow
|
|
|
|
|
// where we cannot determine key pair, than we should should display only "Close" button and inform him
|
|
|
|
|
// to run unlock flow directly.
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock using PUK")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
2022-12-16 09:37:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardNewSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return qsTr("Add another account")
|
|
|
|
|
}
|
|
|
|
|
break
|
2022-12-26 12:52:21 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardOldSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return qsTr("Add another account")
|
2022-12-27 13:20:58 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseAlreadyInUse:
|
|
|
|
|
return qsTr("View accounts in Wallet")
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.importFromKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseAlreadyInUse:
|
|
|
|
|
return qsTr("View accounts in Wallet")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.importingFromKeycardSuccess:
|
|
|
|
|
return qsTr("View imported accounts in Wallet")
|
2022-12-26 12:52:21 +00:00
|
|
|
|
}
|
|
|
|
|
break
|
2023-08-29 14:22:41 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.migrateFromKeycardToApp:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
2023-09-01 13:32:21 +00:00
|
|
|
|
case Constants.keycardSharedState.biometrics:
|
|
|
|
|
return qsTr("I prefer to use my password")
|
|
|
|
|
|
2023-08-29 14:22:41 +00:00
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateSuccess:
|
|
|
|
|
if (!root.sharedKeycardModule.migratingProfileKeyPair())
|
|
|
|
|
return qsTr("Factory reset this Keycard")
|
|
|
|
|
}
|
|
|
|
|
break
|
2023-09-06 09:16:23 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.migrateFromAppToKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.biometrics:
|
|
|
|
|
return qsTr("I prefer to use my PIN")
|
|
|
|
|
}
|
|
|
|
|
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: {
|
2023-01-04 15:01:10 +00:00
|
|
|
|
if (root.disableActionPopupButtons) {
|
|
|
|
|
return false
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
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.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2023-10-27 17:14:39 +00:00
|
|
|
|
case Constants.keycardSharedFlow.sign:
|
|
|
|
|
if (userProfile.usingBiometricLogin) {
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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-12-16 09:37:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardNewSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
2022-12-26 12:52:21 +00:00
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardOldSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
2022-12-16 09:37:08 +00:00
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
|
|
|
|
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: {
|
2024-08-05 13:44:32 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycardNewSeedPhrase ||
|
|
|
|
|
root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycardOldSeedPhrase) {
|
|
|
|
|
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.manageKeycardAccounts &&
|
|
|
|
|
!!root.sharedKeycardModule.keyPairForProcessing &&
|
|
|
|
|
root.sharedKeycardModule.remainingAccountCapacity() === root.sharedKeycardModule.keyPairForProcessing.accounts.count) {
|
|
|
|
|
root.accountLimitWarning()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-07 11:43:34 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.doSecondaryAction()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
|
id: primaryButton
|
|
|
|
|
objectName: "PrimaryButton"
|
|
|
|
|
height: Constants.keycard.general.footerButtonsHeight
|
|
|
|
|
text: {
|
2023-03-03 10:24:50 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.noPCSCService) {
|
|
|
|
|
return qsTr("Retry")
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
switch (root.sharedKeycardModule.currentState.flowType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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-12-16 09:37:08 +00:00
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock)
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
return qsTr("Next")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2023-08-29 14:22:41 +00:00
|
|
|
|
case Constants.keycardSharedState.migratingKeypairToKeycard:
|
2022-11-07 11:43:34 +00:00
|
|
|
|
return qsTr("Done")
|
2022-11-09 10:22:08 +00:00
|
|
|
|
|
2023-09-01 13:32:21 +00:00
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateFailure:
|
|
|
|
|
return qsTr("Close app")
|
|
|
|
|
|
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
|
|
|
|
|
|
2022-12-16 09:37:08 +00:00
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardNewSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
|
|
|
|
return qsTr("Check what is stored on this Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
return qsTr("I don’t know the PIN")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
return qsTr("Factory reset this Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetSuccess:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseDisplay:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseEnterWords:
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.pinSet:
|
|
|
|
|
case Constants.keycardSharedState.enterKeycardName:
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock)
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.creatingAccountNewSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.creatingAccountNewSeedPhraseSuccess:
|
|
|
|
|
case Constants.keycardSharedState.creatingAccountNewSeedPhraseFailure:
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return qsTr("Finalise Keycard")
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-12-26 12:52:21 +00:00
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardOldSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
|
|
|
|
return qsTr("Check what is stored on this Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
return qsTr("I don’t know the PIN")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
return qsTr("Factory reset this Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetSuccess:
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.pinSet:
|
|
|
|
|
case Constants.keycardSharedState.enterKeycardName:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock)
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.creatingAccountOldSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.creatingAccountOldSeedPhraseSuccess:
|
|
|
|
|
case Constants.keycardSharedState.creatingAccountOldSeedPhraseFailure:
|
2022-12-27 13:20:58 +00:00
|
|
|
|
case Constants.keycardSharedState.seedPhraseAlreadyInUse:
|
2022-12-26 12:52:21 +00:00
|
|
|
|
return qsTr("Done")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return qsTr("Finalise Keycard")
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-12-27 13:20:58 +00:00
|
|
|
|
case Constants.keycardSharedFlow.importFromKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseAlreadyInUse:
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
return qsTr("Name accounts")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
return qsTr("I don’t know the PIN")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
if (root.sharedKeycardModule.keyPairHelper.accounts.count === root.sharedKeycardModule.keyPairForProcessing.accounts.count) {
|
|
|
|
|
return qsTr("Finalise import")
|
|
|
|
|
}
|
|
|
|
|
return qsTr("Next account")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.importingFromKeycard:
|
|
|
|
|
case Constants.keycardSharedState.importingFromKeycardSuccess:
|
|
|
|
|
case Constants.keycardSharedState.importingFromKeycardFailure:
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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:
|
2023-08-30 15:54:41 +00:00
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
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) {
|
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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
|
|
|
|
|
|
2023-10-27 17:14:39 +00:00
|
|
|
|
case Constants.keycardSharedFlow.sign:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2023-10-27 17:14:39 +00:00
|
|
|
|
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.enterPin:
|
|
|
|
|
return qsTr("Sign")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongKeychainPin:
|
|
|
|
|
return qsTr("Update PIN & authenticate")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
|
|
|
|
return qsTr("Try biometrics again")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
case Constants.keycardSharedFlow.unlockKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
2023-01-04 15:01:10 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardAlreadyUnlocked:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
2023-01-27 16:04:07 +00:00
|
|
|
|
case Constants.keycardSharedState.unlockingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardFailure:
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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-12-16 09:37:08 +00:00
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock &&
|
|
|
|
|
!(root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.offerPukForUnlock)) {
|
|
|
|
|
// In case max puk retries or free pairing slots is reached and user is running unlock flow from a flow
|
|
|
|
|
// where we cannot determine key pair, than we should should display only "Close" button and inform him
|
|
|
|
|
// to run unlock flow directly.
|
|
|
|
|
return ""
|
|
|
|
|
}
|
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-12-16 09:37:08 +00:00
|
|
|
|
if (root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock) {
|
|
|
|
|
return ""
|
|
|
|
|
}
|
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-18 08:16:02 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.createCopyOfAKeycard:
|
|
|
|
|
let copyFromAKeycardPartDone = root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.copyFromAKeycardPartDone
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
if (copyFromAKeycardPartDone) {
|
|
|
|
|
return qsTr("I don’t know the PIN")
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
case Constants.keycardSharedState.copyingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.copyingKeycardSuccess:
|
|
|
|
|
case Constants.keycardSharedState.copyingKeycardFailure:
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
case Constants.keycardSharedState.removeKeycard:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetSuccess:
|
|
|
|
|
case Constants.keycardSharedState.copyToKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
if (copyFromAKeycardPartDone) {
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
}
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.wrongSeedPhrase:
|
|
|
|
|
return qsTr("Try entering seed phrase again")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.sameKeycard:
|
|
|
|
|
return qsTr("Try inserting a different Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
if (copyFromAKeycardPartDone) {
|
|
|
|
|
return qsTr("Try inserting a different Keycard")
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keycardNotEmpty:
|
|
|
|
|
return qsTr("Check what is stored on this Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
return qsTr("Factory reset this Keycard")
|
|
|
|
|
}
|
|
|
|
|
break
|
2023-08-29 14:22:41 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.migrateFromKeycardToApp:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.migrateKeypairToApp:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
case Constants.keycardSharedState.wrongSeedPhrase:
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.migratingKeypairToApp:
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
|
2023-09-01 13:32:21 +00:00
|
|
|
|
case Constants.keycardSharedState.createPassword:
|
|
|
|
|
return qsTr("Create Password")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.confirmPassword:
|
|
|
|
|
return qsTr("Finalize Status Password Creation")
|
|
|
|
|
|
2023-08-29 14:22:41 +00:00
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateFailure:
|
2023-09-06 09:16:23 +00:00
|
|
|
|
return qsTr("Close App")
|
2023-09-01 13:32:21 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.biometrics:
|
|
|
|
|
return qsTr("Yes, use Touch ID")
|
2023-08-29 14:22:41 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateSuccess:
|
|
|
|
|
if (root.sharedKeycardModule.migratingProfileKeyPair())
|
|
|
|
|
return qsTr("Restart App & Sign In Using Your New Password")
|
|
|
|
|
return qsTr("Done")
|
|
|
|
|
}
|
|
|
|
|
break
|
2023-09-06 09:16:23 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.migrateFromAppToKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
case Constants.keycardSharedState.migrateKeypairToKeycard:
|
|
|
|
|
case Constants.keycardSharedState.pinVerified:
|
|
|
|
|
return qsTr("Next")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmpty:
|
|
|
|
|
case Constants.keycardSharedState.keycardEmptyMetadata:
|
|
|
|
|
return qsTr("Try again")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.maxPinRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPukRetriesReached:
|
|
|
|
|
case Constants.keycardSharedState.maxPairingSlotsReached:
|
|
|
|
|
return qsTr("Unlock Keycard")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.biometrics:
|
|
|
|
|
return qsTr("Yes, use Touch ID")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateFailure:
|
|
|
|
|
return qsTr("Close App")
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.keyPairMigrateSuccess:
|
|
|
|
|
return qsTr("Restart App & Sign In Using Your Keycard")
|
|
|
|
|
}
|
|
|
|
|
break
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
visible: text !== ""
|
|
|
|
|
enabled: {
|
2023-01-04 15:01:10 +00:00
|
|
|
|
if (root.disableActionPopupButtons) {
|
|
|
|
|
return false
|
2022-11-07 11:43:34 +00:00
|
|
|
|
}
|
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.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
|
|
|
|
|
|
2022-12-16 09:37:08 +00:00
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardNewSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseDisplay:
|
|
|
|
|
case Constants.keycardSharedState.seedPhraseEnterWords:
|
|
|
|
|
case Constants.keycardSharedState.enterKeycardName:
|
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-12-26 12:52:21 +00:00
|
|
|
|
case Constants.keycardSharedFlow.setupNewKeycardOldSeedPhrase:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
case Constants.keycardSharedState.enterKeycardName:
|
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.createPin:
|
|
|
|
|
case Constants.keycardSharedState.repeatPin:
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-12-27 13:20:58 +00:00
|
|
|
|
case Constants.keycardSharedFlow.importFromKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
2024-08-05 13:44:32 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardMetadataDisplay:
|
|
|
|
|
return root.sharedKeycardModule.keyPairHelper.accounts.count <= root.sharedKeycardModule.remainingAccountCapacity()
|
|
|
|
|
|
2022-12-27 13:20:58 +00:00
|
|
|
|
case Constants.keycardSharedState.manageKeycardAccounts:
|
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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.insertKeycard:
|
|
|
|
|
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
|
|
|
|
|
|
2023-10-27 17:14:39 +00:00
|
|
|
|
case Constants.keycardSharedFlow.sign:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongPin:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeychainPin:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
case Constants.keycardSharedState.enterPin:
|
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
|
2022-11-09 10:22:08 +00:00
|
|
|
|
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-12-16 09:37:08 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.unlockKeycardOptions:
|
|
|
|
|
return !(root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.disableSeedPhraseForUnlock)
|
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-18 08:16:02 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.createCopyOfAKeycard:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmation:
|
|
|
|
|
case Constants.keycardSharedState.factoryResetConfirmationDisplayMetadata:
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
|
|
|
|
break
|
2023-08-29 14:22:41 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.migrateFromKeycardToApp:
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedState.enterSeedPhrase:
|
2023-09-01 13:32:21 +00:00
|
|
|
|
case Constants.keycardSharedState.createPassword:
|
|
|
|
|
case Constants.keycardSharedState.confirmPassword:
|
2023-08-29 14:22:41 +00:00
|
|
|
|
return root.primaryButtonEnabled
|
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
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.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
|
2023-10-27 17:14:39 +00:00
|
|
|
|
|
|
|
|
|
case Constants.keycardSharedFlow.sign:
|
|
|
|
|
if (userProfile.usingBiometricLogin) {
|
|
|
|
|
switch (root.sharedKeycardModule.currentState.stateType) {
|
|
|
|
|
|
2024-04-11 17:25:26 +00:00
|
|
|
|
case Constants.keycardSharedState.keycardFlowStarted:
|
2023-10-27 17:14:39 +00:00
|
|
|
|
case Constants.keycardSharedState.pluginReader:
|
|
|
|
|
case Constants.keycardSharedState.insertKeycard:
|
|
|
|
|
case Constants.keycardSharedState.keycardInserted:
|
|
|
|
|
case Constants.keycardSharedState.readingKeycard:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinFailed:
|
|
|
|
|
case Constants.keycardSharedState.biometricsPinInvalid:
|
|
|
|
|
case Constants.keycardSharedState.biometricsReadyToSign:
|
|
|
|
|
case Constants.keycardSharedState.notKeycard:
|
|
|
|
|
case Constants.keycardSharedState.wrongKeycard:
|
|
|
|
|
return "touch-id"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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: {
|
2024-08-05 13:44:32 +00:00
|
|
|
|
if (root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycardNewSeedPhrase ||
|
|
|
|
|
root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.setupNewKeycardOldSeedPhrase) {
|
|
|
|
|
|
|
|
|
|
if (root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.manageKeycardAccounts &&
|
|
|
|
|
!!root.sharedKeycardModule.keyPairForProcessing &&
|
|
|
|
|
root.sharedKeycardModule.remainingAccountCapacity() - root.sharedKeycardModule.keyPairForProcessing.accounts.count < 0) {
|
|
|
|
|
root.accountLimitWarning()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-07 11:43:34 +00:00
|
|
|
|
root.sharedKeycardModule.currentState.doPrimaryAction()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|