2024-10-15 19:26:12 +00:00
import QtQuick 2.15
import QtQuick . Controls 2.15
import QtQuick . Layouts 1.15
2023-03-22 15:48:44 +00:00
import StatusQ . Controls 0.1
import StatusQ . Core . Theme 0.1
import StatusQ . Core 0.1
import utils 1.0
import "../stores"
Item {
id: root
property AddAccountStore store
implicitHeight: layout . implicitHeight
Component.onCompleted: {
if ( root . store . addingNewMasterKeyConfirmed ) {
havePen . checked = true
writeDown . checked = true
storeIt . checked = true
}
}
QtObject {
id: d
2024-10-15 19:26:12 +00:00
readonly property int width1: layout . width - 2 * Theme . padding
readonly property int width2: d . width1 - 2 * Theme . padding
2023-03-22 15:48:44 +00:00
readonly property int checkboxHeight: 24
readonly property real lineHeight: 1.2
readonly property bool allAccepted: havePen . checked && writeDown . checked && storeIt . checked
onAllAcceptedChanged: {
root . store . addingNewMasterKeyConfirmed = allAccepted
}
}
ColumnLayout {
id: layout
anchors.horizontalCenter: parent . horizontalCenter
2024-10-15 19:26:12 +00:00
width: parent . width - 2 * Theme . padding
spacing: Theme . padding
2023-03-22 15:48:44 +00:00
Image {
Layout.alignment: Qt . AlignHCenter
2024-10-15 19:26:12 +00:00
Layout.topMargin: Theme . padding
2023-03-22 15:48:44 +00:00
Layout.preferredWidth: 120
Layout.preferredHeight: 120
fillMode: Image . PreserveAspectFit
2024-10-15 19:26:12 +00:00
source: Theme . png ( "onboarding/keys" )
2023-03-22 15:48:44 +00:00
mipmap: true
2023-04-26 15:33:24 +00:00
cache: false
2023-03-22 15:48:44 +00:00
}
StatusBaseText {
Layout.preferredWidth: d . width1
Layout.alignment: Qt . AlignHCenter
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . WordWrap
font.bold: true
font.pixelSize: 22
text: qsTr ( "Secure Your Assets and Funds" )
}
StatusBaseText {
Layout.preferredWidth: d . width1
Layout.alignment: Qt . AlignHCenter
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . WordWrap
textFormat: Text . RichText
2024-10-15 19:26:12 +00:00
font.pixelSize: Theme . primaryTextFontSize
2023-03-22 15:48:44 +00:00
lineHeight: d . lineHeight
text: qsTr ( "Your seed phrase is a 12-word passcode to your funds.<br/><br/>Your seed phrase cannot be recovered if lost. Therefore, you <b>must</b> back it up. The simplest way is to <b>write it down offline and store it somewhere secure.</b>" )
}
StatusCheckBox {
id: havePen
2023-04-13 10:27:56 +00:00
objectName: "AddAccountPopup-HavePenAndPaper"
2023-03-22 15:48:44 +00:00
Layout.preferredWidth: d . width2
Layout.preferredHeight: d . checkboxHeight
2024-10-15 19:26:12 +00:00
Layout.topMargin: Theme . padding
2023-03-22 15:48:44 +00:00
Layout.alignment: Qt . AlignHCenter
2024-10-15 19:26:12 +00:00
spacing: Theme . padding
font.pixelSize: Theme . primaryTextFontSize
2023-03-22 15:48:44 +00:00
text: qsTr ( "I have a pen and paper" )
}
StatusCheckBox {
id: writeDown
2023-04-13 10:27:56 +00:00
objectName: "AddAccountPopup-SeedPhraseWritten"
2023-03-22 15:48:44 +00:00
Layout.preferredWidth: d . width2
Layout.preferredHeight: d . checkboxHeight
Layout.alignment: Qt . AlignHCenter
2024-10-15 19:26:12 +00:00
spacing: Theme . padding
font.pixelSize: Theme . primaryTextFontSize
2023-03-22 15:48:44 +00:00
text: qsTr ( "I am ready to write down my seed phrase" )
}
StatusCheckBox {
id: storeIt
2023-04-13 10:27:56 +00:00
objectName: "AddAccountPopup-StoringSeedPhraseConfirmed"
2023-03-22 15:48:44 +00:00
Layout.preferredWidth: d . width2
Layout.preferredHeight: d . checkboxHeight
Layout.alignment: Qt . AlignHCenter
2024-10-15 19:26:12 +00:00
spacing: Theme . padding
font.pixelSize: Theme . primaryTextFontSize
2023-03-22 15:48:44 +00:00
text: qsTr ( "I know where I’ ll store it" )
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 60
2024-10-15 19:26:12 +00:00
Layout.topMargin: Theme . padding
radius: Theme . radius
2023-03-22 15:48:44 +00:00
color: Theme . palette . dangerColor3
StatusBaseText {
anchors.fill: parent
2024-10-15 19:26:12 +00:00
anchors.margins: Theme . halfPadding
2023-03-22 15:48:44 +00:00
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
2024-10-15 19:26:12 +00:00
font.pixelSize: Theme . primaryTextFontSize
2023-03-22 15:48:44 +00:00
wrapMode: Text . WordWrap
color: Theme . palette . dangerColor1
lineHeight: d . lineHeight
text: qsTr ( "You can only complete this process once. Status will not store your seed phrase and can never help you recover it." )
}
}
}
}