2024-02-14 13:50:14 +00:00
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
import QtGraphicalEffects 1.15
|
2022-03-15 22:27:36 +00:00
|
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-07-20 14:54:30 +00:00
|
|
|
|
|
2024-02-14 13:50:14 +00:00
|
|
|
|
import AppLayouts.Onboarding.controls 1.0
|
|
|
|
|
import AppLayouts.Onboarding.stores 1.0
|
|
|
|
|
|
2022-03-15 22:27:36 +00:00
|
|
|
|
import utils 1.0
|
2024-02-14 13:50:14 +00:00
|
|
|
|
import shared.panels 1.0
|
2022-03-31 11:46:25 +00:00
|
|
|
|
import shared.stores 1.0
|
2022-05-05 15:16:05 +00:00
|
|
|
|
import shared.controls 1.0
|
2022-07-20 14:54:30 +00:00
|
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
|
Item {
|
2022-03-15 22:27:36 +00:00
|
|
|
|
id: root
|
|
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
|
property StartupStore startupStore
|
2022-03-15 22:27:36 +00:00
|
|
|
|
|
2023-01-18 11:53:38 +00:00
|
|
|
|
QtObject {
|
|
|
|
|
id: d
|
|
|
|
|
|
|
|
|
|
property bool wrongSeedPhrase: root.startupStore.startupModuleInst.keycardData & Constants.predefinedKeycardData.wrongSeedPhrase
|
|
|
|
|
|
|
|
|
|
onWrongSeedPhraseChanged: {
|
|
|
|
|
if (wrongSeedPhrase) {
|
2023-01-23 11:41:59 +00:00
|
|
|
|
if (root.startupStore.startupModuleInst.flowType === Constants.startupFlow.firstRunOldUserImportSeedPhrase) {
|
2024-06-07 13:29:09 +00:00
|
|
|
|
seedPhraseView.setWrongSeedPhraseMessage(qsTr("Profile key pair for the inserted seed phrase is already set up"))
|
2023-01-23 11:41:59 +00:00
|
|
|
|
return
|
|
|
|
|
}
|
2024-02-14 13:50:14 +00:00
|
|
|
|
seedPhraseView.setWrongSeedPhraseMessage(qsTr("Seed phrase doesn’t match the profile of an existing Keycard user on this device"))
|
2023-01-18 11:53:38 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
2024-02-14 13:50:14 +00:00
|
|
|
|
seedPhraseView.setWrongSeedPhraseMessage("")
|
2023-01-18 11:53:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-14 13:50:14 +00:00
|
|
|
|
ColumnLayout {
|
|
|
|
|
width: 565
|
|
|
|
|
implicitHeight: contentItem.implicitHeight
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
spacing: 24
|
2022-04-28 07:32:17 +00:00
|
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
|
id: headlineText
|
|
|
|
|
font.pixelSize: 22
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
color: Theme.palette.directColor1
|
2024-02-14 13:50:14 +00:00
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-04-28 07:32:17 +00:00
|
|
|
|
text: qsTr("Enter seed phrase")
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-14 13:50:14 +00:00
|
|
|
|
EnterSeedPhrase {
|
|
|
|
|
id: seedPhraseView
|
|
|
|
|
isSeedPhraseValid: root.startupStore.validMnemonic
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-03-15 22:27:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
|
id: submitButton
|
2022-07-29 22:51:34 +00:00
|
|
|
|
objectName: "seedPhraseViewSubmitButton"
|
2024-02-14 13:50:14 +00:00
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
enabled: seedPhraseView.seedPhraseIsValid
|
2022-07-21 11:29:18 +00:00
|
|
|
|
text: {
|
|
|
|
|
if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserImportSeedPhrase) {
|
|
|
|
|
return qsTr("Import")
|
|
|
|
|
}
|
|
|
|
|
else if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunOldUserImportSeedPhrase) {
|
|
|
|
|
return qsTr("Restore Status Profile")
|
|
|
|
|
}
|
|
|
|
|
else if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunOldUserKeycardImport ||
|
|
|
|
|
root.startupStore.currentStartupState.flowType === Constants.startupFlow.appLogin) {
|
|
|
|
|
return qsTr("Recover Keycard")
|
|
|
|
|
}
|
2023-01-18 11:53:38 +00:00
|
|
|
|
else if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserImportSeedPhraseIntoKeycard ||
|
2023-01-26 11:52:01 +00:00
|
|
|
|
root.startupStore.currentStartupState.flowType === Constants.startupFlow.lostKeycardReplacement ||
|
|
|
|
|
root.startupStore.currentStartupState.flowType === Constants.startupFlow.lostKeycardConvertToRegularAccount) {
|
2022-07-21 11:29:18 +00:00
|
|
|
|
return qsTr("Next")
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2024-02-14 13:50:14 +00:00
|
|
|
|
onClicked: root.startupStore.doPrimaryAction()
|
2022-03-15 22:27:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|