2022-05-26 13:40:41 +00:00
|
|
|
import QtQuick 2.12
|
2022-06-28 10:55:33 +00:00
|
|
|
import QtQuick.Layouts 1.12
|
2022-05-26 13:40:41 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2022-06-28 10:55:33 +00:00
|
|
|
|
2022-07-20 14:54:30 +00:00
|
|
|
import StatusQ.Core 0.1
|
2022-05-26 13:40:41 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-06-28 10:55:33 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2022-05-26 13:40:41 +00:00
|
|
|
|
|
|
|
import shared.panels 1.0
|
|
|
|
import utils 1.0
|
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.Profile.stores 1.0 as ProfileStores
|
|
|
|
|
2022-05-26 13:40:41 +00:00
|
|
|
BackupSeedStepBase {
|
|
|
|
id: root
|
2022-06-28 10:55:33 +00:00
|
|
|
|
|
|
|
property var seedPhrase: []
|
2022-05-26 13:40:41 +00:00
|
|
|
property bool hideSeed: true
|
2024-05-22 08:13:39 +00:00
|
|
|
property ProfileStores.PrivacyStore privacyStore
|
2022-05-26 13:40:41 +00:00
|
|
|
|
|
|
|
titleText: qsTr("Write down your 12-word seed phrase to keep offline")
|
|
|
|
|
2022-06-28 10:55:33 +00:00
|
|
|
Item {
|
|
|
|
implicitHeight: 304
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2022-07-20 14:54:30 +00:00
|
|
|
StatusGridView {
|
2022-06-28 10:55:33 +00:00
|
|
|
id: grid
|
2022-07-11 15:20:35 +00:00
|
|
|
leftMargin: grid.spacing/2
|
|
|
|
width: cellWidth*2
|
|
|
|
height: parent.height
|
|
|
|
anchors.centerIn: parent
|
2022-06-28 10:55:33 +00:00
|
|
|
visible: !hideSeed
|
|
|
|
flow: GridView.FlowTopToBottom
|
|
|
|
cellWidth: 208
|
|
|
|
cellHeight: 48
|
|
|
|
interactive: false
|
|
|
|
model: 12
|
2022-07-11 15:20:35 +00:00
|
|
|
readonly property var wordIndex: ["1", "3", "5", "7", "9", "11", "2", "4", "6", "8", "10", "12"]
|
|
|
|
readonly property int spacing: 4
|
2022-06-28 10:55:33 +00:00
|
|
|
delegate: StatusSeedPhraseInput {
|
|
|
|
id: seedWordInput
|
2022-08-16 16:35:10 +00:00
|
|
|
objectName: "ConfirmSeedPhrasePanel_StatusSeedPhraseInput_" + grid.wordIndex[index]
|
2022-07-11 15:20:35 +00:00
|
|
|
width: (grid.cellWidth - grid.spacing)
|
|
|
|
height: (grid.cellHeight - grid.spacing)
|
2022-06-28 10:55:33 +00:00
|
|
|
textEdit.input.edit.enabled: false
|
|
|
|
text: {
|
2022-07-11 15:20:35 +00:00
|
|
|
const idx = parseInt(leftComponentText) - 1;
|
|
|
|
if (!root.seedPhrase || idx < 0 || idx > root.seedPhrase.length - 1)
|
2022-06-28 10:55:33 +00:00
|
|
|
return "";
|
2022-07-11 15:20:35 +00:00
|
|
|
return root.seedPhrase[idx];
|
2022-06-28 10:55:33 +00:00
|
|
|
}
|
|
|
|
leftComponentText: grid.wordIndex[index]
|
|
|
|
}
|
2022-05-26 13:40:41 +00:00
|
|
|
}
|
|
|
|
|
2022-06-28 10:55:33 +00:00
|
|
|
GaussianBlur {
|
|
|
|
id: blur
|
|
|
|
anchors.fill: grid
|
|
|
|
visible: hideSeed
|
|
|
|
source: grid
|
|
|
|
radius: 16
|
|
|
|
samples: 16
|
2022-07-11 15:20:35 +00:00
|
|
|
transparentBorder: true
|
2022-06-28 10:55:33 +00:00
|
|
|
}
|
2022-05-26 13:40:41 +00:00
|
|
|
|
2022-06-28 10:55:33 +00:00
|
|
|
StatusButton {
|
2022-08-16 16:35:10 +00:00
|
|
|
objectName: "ConfirmSeedPhrasePanel_RevealSeedPhraseButton"
|
2022-06-28 10:55:33 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: hideSeed
|
|
|
|
icon.name: "view"
|
|
|
|
text: qsTr("Reveal seed phrase")
|
|
|
|
onClicked: {
|
2023-12-06 15:24:10 +00:00
|
|
|
privacyStore.mnemonicWasShown();
|
2022-06-28 10:55:33 +00:00
|
|
|
hideSeed = false;
|
|
|
|
}
|
2022-05-26 13:40:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: text
|
|
|
|
visible: hideSeed
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: Style.current.primaryTextFontSize
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
textFormat: Text.RichText
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
text: qsTr("The next screen contains your seed phrase.\n<b>Anyone</b> who sees it can use it to access to your funds.")
|
2022-06-28 10:55:33 +00:00
|
|
|
Layout.fillWidth: true
|
2022-05-26 13:40:41 +00:00
|
|
|
}
|
|
|
|
}
|