2020-06-22 11:43:34 +00:00
|
|
|
import QtQuick 2.12
|
2022-05-26 13:40:41 +00:00
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtQuick.Layouts 1.14
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.controls 1.0
|
2021-10-20 10:03:09 +00:00
|
|
|
|
2022-05-26 13:40:41 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
2021-10-20 10:03:09 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2022-05-26 13:40:41 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-10-20 10:03:09 +00:00
|
|
|
|
2022-05-26 13:40:41 +00:00
|
|
|
import "backupseed"
|
|
|
|
|
|
|
|
StatusModal {
|
2020-06-22 11:43:34 +00:00
|
|
|
id: popup
|
2022-05-26 13:40:41 +00:00
|
|
|
width: 480
|
|
|
|
height: 748
|
|
|
|
header.title: qsTr("Back up your seed phrase")
|
2021-12-30 12:39:47 +00:00
|
|
|
|
|
|
|
property var privacyStore
|
2022-02-09 09:43:23 +00:00
|
|
|
|
2022-05-26 13:40:41 +00:00
|
|
|
rightButtons: [
|
|
|
|
StatusFlatButton {
|
|
|
|
text: "Not Now"
|
|
|
|
visible: (stack.currentIndex === 0)
|
|
|
|
border.color: Theme.palette.baseColor2
|
|
|
|
onClicked: {
|
|
|
|
popup.close();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
StatusButton {
|
|
|
|
enabled: {
|
|
|
|
if (stack.currentIndex === 0) {
|
|
|
|
return acknowledgment.allAccepted;
|
|
|
|
} else {
|
|
|
|
switch (backUp.bar.currentIndex) {
|
|
|
|
case 0:
|
|
|
|
return !backUp.seedHidden;
|
|
|
|
case 1:
|
|
|
|
return backUp.validFirstSeedWord;
|
|
|
|
case 2:
|
|
|
|
return backUp.validSecondSeedWord;
|
|
|
|
case 3:
|
|
|
|
return backUp.seedStored;
|
|
|
|
default:
|
|
|
|
return true;
|
2020-08-25 20:19:46 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-22 11:43:34 +00:00
|
|
|
}
|
2022-05-26 13:40:41 +00:00
|
|
|
text: {
|
|
|
|
if (stack.currentIndex === 1) {
|
|
|
|
if (backUp.bar.currentIndex === 0) {
|
|
|
|
return qsTr("Confirm Seed Phrase");
|
|
|
|
} else if (backUp.bar.currentIndex === 1 ||
|
|
|
|
backUp.bar.currentIndex === 2) {
|
|
|
|
return qsTr("Continue");
|
|
|
|
} else {
|
|
|
|
return qsTr("Complete & Delete My Seed Phrase");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return qsTr("Confirm Seed Phrase");
|
2021-04-26 15:23:14 +00:00
|
|
|
}
|
2022-05-26 13:40:41 +00:00
|
|
|
}
|
|
|
|
onClicked: {
|
|
|
|
if (stack.currentIndex === 0) {
|
|
|
|
stack.currentIndex = 1;
|
|
|
|
} else {
|
|
|
|
switch (backUp.bar.currentIndex) {
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
backUp.bar.currentIndex++;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
popup.privacyStore.removeMnemonic();
|
|
|
|
popup.close();
|
|
|
|
break;
|
|
|
|
}
|
2021-04-26 15:23:14 +00:00
|
|
|
}
|
2020-10-26 20:20:31 +00:00
|
|
|
}
|
|
|
|
}
|
2022-05-26 13:40:41 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
leftButtons: [
|
|
|
|
StatusRoundButton {
|
|
|
|
visible: (stack.currentIndex === 1)
|
|
|
|
icon.name: "arrow-right"
|
|
|
|
rotation: 180
|
|
|
|
onClicked: {
|
|
|
|
if (backUp.bar.currentIndex === 0) {
|
|
|
|
stack.currentIndex = 0;
|
2020-10-26 20:20:31 +00:00
|
|
|
} else {
|
2022-05-26 13:40:41 +00:00
|
|
|
backUp.bar.currentIndex--;
|
2020-10-26 20:20:31 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-25 20:19:46 +00:00
|
|
|
}
|
2022-05-26 13:40:41 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
contentItem: StackLayout {
|
|
|
|
id: stack
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 80
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 88
|
|
|
|
Acknowledgements { id: acknowledgment }
|
|
|
|
Backup { id: backUp; privacyStore: popup.privacyStore }
|
2020-06-22 11:43:34 +00:00
|
|
|
}
|
|
|
|
}
|