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-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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
GridView {
|
|
|
|
id: grid
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: !hideSeed
|
|
|
|
flow: GridView.FlowTopToBottom
|
|
|
|
cellWidth: 208
|
|
|
|
cellHeight: 48
|
|
|
|
interactive: false
|
|
|
|
model: 12
|
|
|
|
property var wordIndex: ["1", "3", "5", "7", "9", "11", "2", "4", "6", "8", "10", "12"]
|
|
|
|
delegate: StatusSeedPhraseInput {
|
|
|
|
id: seedWordInput
|
|
|
|
width: (grid.cellWidth - 4)
|
|
|
|
height: (grid.cellHeight - 4)
|
|
|
|
textEdit.input.edit.enabled: false
|
|
|
|
text: {
|
|
|
|
var index = parseInt(leftComponentText) - 1;
|
|
|
|
if (!root.seedPhrase || index < 0 || index > root.seedPhrase.length - 1)
|
|
|
|
return "";
|
|
|
|
return root.seedPhrase[index];
|
|
|
|
}
|
|
|
|
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-05-26 13:40:41 +00:00
|
|
|
|
2022-06-28 10:55:33 +00:00
|
|
|
StatusButton {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: hideSeed
|
|
|
|
icon.name: "view"
|
|
|
|
text: qsTr("Reveal seed phrase")
|
|
|
|
onClicked: {
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|