2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-09-29 06:39:29 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-12 18:26:02 +00:00
|
|
|
|
|
|
|
import "../../../../shared"
|
2021-10-14 11:33:34 +00:00
|
|
|
import "../../../../shared/popups"
|
2021-10-14 13:09:35 +00:00
|
|
|
import "../../../../shared/panels"
|
2021-10-14 12:22:50 +00:00
|
|
|
import "../../../../shared/controls"
|
2021-10-12 18:26:02 +00:00
|
|
|
import "../../../../shared/status"
|
2020-06-12 20:47:44 +00:00
|
|
|
|
2021-10-14 11:33:34 +00:00
|
|
|
// TODO: replace with StatusModal
|
2020-06-12 20:47:44 +00:00
|
|
|
ModalPopup {
|
|
|
|
property var onConfirmSeedClick: function () {}
|
|
|
|
id: popup
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Enter seed phrase"
|
|
|
|
title: qsTrId("enter-seed-phrase")
|
2020-06-12 20:47:44 +00:00
|
|
|
height: 400
|
|
|
|
|
|
|
|
onOpened: {
|
2021-04-14 20:50:09 +00:00
|
|
|
seedPhraseTextArea.textArea.text = "";
|
|
|
|
seedPhraseTextArea.textArea.forceActiveFocus(Qt.MouseFocusReason)
|
2020-06-12 20:47:44 +00:00
|
|
|
}
|
2021-04-14 20:50:09 +00:00
|
|
|
|
|
|
|
SeedPhraseTextArea {
|
|
|
|
id: seedPhraseTextArea
|
2020-09-30 12:33:26 +00:00
|
|
|
anchors.top: parent.top
|
2021-01-06 13:11:26 +00:00
|
|
|
anchors.topMargin: 40
|
2021-04-14 20:50:09 +00:00
|
|
|
width: parent.width
|
|
|
|
hideRectangle: true
|
2020-06-12 20:47:44 +00:00
|
|
|
|
2021-04-14 20:50:09 +00:00
|
|
|
textArea.anchors.leftMargin: 76
|
|
|
|
textArea.anchors.rightMargin: 76
|
2020-10-03 13:53:46 +00:00
|
|
|
|
2021-04-14 20:50:09 +00:00
|
|
|
onEnterPressed: submitBtn.clicked()
|
2020-09-30 12:33:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: helpText
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Enter 12, 15, 18, 21 or 24 words.\nSeperate words by a single space."
|
2020-07-07 19:25:20 +00:00
|
|
|
text: qsTrId("enter-12--15--18--21-or-24-words--nseperate-words-by-a-single-space-")
|
2020-06-12 20:47:44 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 0
|
2021-01-06 13:11:26 +00:00
|
|
|
horizontalAlignment: TextEdit.AlignHCenter
|
2020-09-29 06:39:29 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-12 20:47:44 +00:00
|
|
|
font.pixelSize: 12
|
|
|
|
}
|
|
|
|
|
2020-09-30 12:33:26 +00:00
|
|
|
footer: StatusRoundButton {
|
2020-06-12 20:47:44 +00:00
|
|
|
id: submitBtn
|
|
|
|
anchors.bottom: parent.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-12 20:47:44 +00:00
|
|
|
anchors.right: parent.right
|
2020-09-30 12:33:26 +00:00
|
|
|
icon.name: "arrow-right"
|
|
|
|
icon.width: 20
|
|
|
|
icon.height: 16
|
2021-04-14 20:50:09 +00:00
|
|
|
enabled: seedPhraseTextArea.correctWordCount
|
2020-06-12 20:47:44 +00:00
|
|
|
|
|
|
|
onClicked : {
|
2021-04-14 20:50:09 +00:00
|
|
|
if (seedPhraseTextArea.textArea.text === "") {
|
2020-06-12 20:47:44 +00:00
|
|
|
return
|
|
|
|
}
|
2021-04-14 20:50:09 +00:00
|
|
|
if (seedPhraseTextArea.validateSeed()) {
|
|
|
|
onConfirmSeedClick(seedPhraseTextArea.textArea.text)
|
|
|
|
}
|
2020-06-12 20:47:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|