2020-06-17 19:18:31 +00:00
import QtQuick 2.13
2022-03-04 23:31:31 +00:00
import QtQuick . Layouts 1.12
2020-06-17 19:18:31 +00:00
import QtQuick . Controls 2.13
2020-12-10 21:26:39 +00:00
import QtQuick . Controls . Universal 2.12
2021-10-12 18:26:02 +00:00
2021-10-20 12:23:58 +00:00
import StatusQ . Controls 0.1
2022-03-04 23:31:31 +00:00
import StatusQ . Core 0.1
import StatusQ . Core . Theme 0.1
2022-11-30 09:25:47 +00:00
import StatusQ . Components 0.1
2021-10-20 12:23:58 +00:00
2021-10-27 21:27:49 +00:00
import shared 1.0
import shared . panels 1.0
2021-10-12 18:26:02 +00:00
import "../popups"
2022-03-07 22:59:38 +00:00
import "../controls"
2022-07-20 12:34:44 +00:00
import "../stores"
2021-09-28 15:04:06 +00:00
import utils 1.0
2020-05-19 13:22:38 +00:00
2022-07-20 12:34:44 +00:00
Item {
2022-03-04 23:31:31 +00:00
id: root
2022-07-20 12:34:44 +00:00
property StartupStore startupStore
2021-06-28 11:11:54 +00:00
2022-11-30 09:25:47 +00:00
QtObject {
id: d
readonly property int infoWidth: 292
readonly property int infoHeight: 309
readonly property int infoMargin: 24
readonly property int infoTextWidth: d . infoWidth - 2 * d . infoMargin
readonly property int imgKeysWH: 160
readonly property int imgSeedPhraseWH: 257
}
ColumnLayout {
2022-06-20 09:50:57 +00:00
anchors.centerIn: parent
2022-11-30 09:25:47 +00:00
height: Constants . keycard . general . onboardingHeight
spacing: Style . current . bigPadding
2020-05-19 13:22:38 +00:00
2022-11-30 09:25:47 +00:00
Image {
id: keysImg
Layout.alignment: Qt . AlignHCenter
mipmap: true
2020-06-15 15:20:38 +00:00
}
2020-05-19 13:22:38 +00:00
2020-06-19 18:06:58 +00:00
StyledText {
2022-03-04 23:31:31 +00:00
id: txtTitle
2022-11-30 09:25:47 +00:00
Layout.alignment: Qt . AlignHCenter
2020-06-15 15:20:38 +00:00
font.bold: true
font.letterSpacing: - 0.2
2022-11-30 09:25:47 +00:00
font.pixelSize: Constants . onboarding . fontSize1
2020-06-15 15:20:38 +00:00
}
2020-05-19 13:22:38 +00:00
2020-06-19 18:06:58 +00:00
StyledText {
2022-03-04 23:31:31 +00:00
id: txtDesc
2022-11-30 09:25:47 +00:00
Layout.alignment: Qt . AlignHCenter
2022-05-25 15:24:01 +00:00
color: Style . current . secondaryText
horizontalAlignment: Text . AlignHCenter
wrapMode: Text . WordWrap
2022-11-30 09:25:47 +00:00
font.pixelSize: Constants . onboarding . fontSize3
}
Item {
id: spacer
Layout.preferredHeight: Style . current . padding
Layout.preferredWidth: 1
2020-06-15 15:20:38 +00:00
}
2022-05-25 15:24:01 +00:00
2022-11-30 09:25:47 +00:00
Row {
id: whatYouLoseGet
visible: root . startupStore . currentStartupState . stateType === Constants . startupState . userProfileCreateSameChatKey
2022-03-04 23:31:31 +00:00
spacing: Style . current . bigPadding
2022-11-30 09:25:47 +00:00
Layout.alignment: Qt . AlignHCenter
Rectangle {
width: d . infoWidth
height: d . infoHeight
radius: Constants . onboarding . radius
color: Theme . palette . baseColor5
2020-05-19 13:22:38 +00:00
2022-11-30 09:25:47 +00:00
ColumnLayout {
2022-05-25 15:24:01 +00:00
anchors.fill: parent
2022-11-30 09:25:47 +00:00
anchors.margins: d . infoMargin
spacing: Style . current . bigPadding
RowLayout {
StyledText {
text: qsTr ( "What you lose" )
font.pixelSize: Constants . onboarding . fontSize2
font.bold: true
}
Item {
Layout.fillWidth: true
Layout.preferredHeight: 1
}
StatusEmoji {
width: 24
height: 24
emojiId: "1f622"
}
2022-05-25 15:24:01 +00:00
}
2022-11-30 09:25:47 +00:00
ColumnLayout {
StyledText {
text: qsTr ( "Chat history" )
font.pixelSize: Constants . onboarding . fontSize3
font.bold: true
}
StyledText {
Layout.preferredWidth: d . infoTextWidth
text: qsTr ( "Past is in the past. Move on :)" )
font.pixelSize: Constants . onboarding . fontSize3
wrapMode: Text . WordWrap
}
2022-05-25 15:24:01 +00:00
}
2022-11-30 09:25:47 +00:00
ColumnLayout {
StyledText {
text: qsTr ( "Contacts" )
font.pixelSize: Constants . onboarding . fontSize3
font.bold: true
}
StyledText {
Layout.preferredWidth: d . infoTextWidth
text: qsTr ( "You can add them back to your contact list" )
font.pixelSize: Constants . onboarding . fontSize3
wrapMode: Text . WordWrap
}
}
ColumnLayout {
StyledText {
text: qsTr ( "Community memberships" )
font.pixelSize: Constants . onboarding . fontSize3
font.bold: true
}
StyledText {
Layout.preferredWidth: d . infoTextWidth
text: qsTr ( "You’ ll need to rejoin communities" )
font.pixelSize: Constants . onboarding . fontSize3
wrapMode: Text . WordWrap
}
2022-05-25 15:24:01 +00:00
}
}
}
2022-03-04 23:31:31 +00:00
2022-11-30 09:25:47 +00:00
Rectangle {
width: d . infoWidth
height: d . infoHeight
radius: Constants . onboarding . radius
color: Theme . palette . baseColor5
ColumnLayout {
2022-03-04 23:31:31 +00:00
anchors.fill: parent
2022-11-30 09:25:47 +00:00
anchors.margins: d . infoMargin
spacing: Style . current . bigPadding
RowLayout {
StyledText {
text: qsTr ( "What you keep" )
font.pixelSize: Constants . onboarding . fontSize2
font.bold: true
}
Item {
Layout.fillWidth: true
Layout.preferredHeight: 1
}
StatusEmoji {
width: 24
height: 24
emojiId: "1f389"
}
2022-03-04 23:31:31 +00:00
}
2022-11-30 09:25:47 +00:00
ColumnLayout {
StyledText {
text: qsTr ( "Chatkey" )
font.pixelSize: Constants . onboarding . fontSize3
font.bold: true
}
StyledText {
Layout.preferredWidth: d . infoTextWidth
text: qsTr ( "Your contacts can still reach you just like before" )
font.pixelSize: Constants . onboarding . fontSize3
wrapMode: Text . WordWrap
}
2022-03-04 23:31:31 +00:00
}
2022-11-30 09:25:47 +00:00
ColumnLayout {
StyledText {
text: qsTr ( "Wallet accounts" )
font.pixelSize: Constants . onboarding . fontSize3
font.bold: true
}
StyledText {
Layout.preferredWidth: d . infoTextWidth
text: qsTr ( "All your assets and collectibles are safe in your accounts" )
font.pixelSize: Constants . onboarding . fontSize3
wrapMode: Text . WordWrap
}
2022-03-04 23:31:31 +00:00
}
}
}
2020-06-15 15:20:38 +00:00
}
2022-11-30 09:25:47 +00:00
StatusButton {
id: button1
objectName: "keysMainViewPrimaryActionButton"
Layout.alignment: Qt . AlignHCenter
visible: text !== ""
onClicked: {
root . startupStore . doPrimaryAction ( )
}
}
StatusBaseText {
id: button2
Layout.alignment: Qt . AlignHCenter
visible: text !== ""
color: Theme . palette . primaryColor1
font.pixelSize: Constants . onboarding . fontSize3
MouseArea {
anchors.fill: parent
cursorShape: Qt . PointingHandCursor
hoverEnabled: true
onEntered: {
parent . font . underline = true
}
onExited: {
parent . font . underline = false
}
onClicked: {
root . startupStore . doSecondaryAction ( )
}
}
}
StatusBaseText {
id: button3
Layout.alignment: Qt . AlignHCenter
visible: text !== ""
color: Theme . palette . primaryColor1
font.pixelSize: Constants . onboarding . fontSize3
MouseArea {
anchors.fill: parent
cursorShape: Qt . PointingHandCursor
hoverEnabled: true
onEntered: {
parent . font . underline = true
}
onExited: {
parent . font . underline = false
}
onClicked: {
root . startupStore . doTertiaryAction ( )
}
}
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
2022-03-04 23:31:31 +00:00
}
2021-09-24 12:03:57 +00:00
2022-03-04 23:31:31 +00:00
states: [
State {
2022-07-20 12:34:44 +00:00
name: Constants . startupState . welcomeOldStatusUser
when: root . startupStore . currentStartupState . stateType === Constants . startupState . welcomeOldStatusUser
2022-05-25 15:24:01 +00:00
PropertyChanges {
target: keysImg
2022-11-30 09:25:47 +00:00
Layout.preferredWidth: d . imgKeysWH
Layout.preferredHeight: d . imgKeysWH
source: Style . png ( "onboarding/keys" )
2022-05-25 15:24:01 +00:00
}
2023-01-16 09:45:33 +00:00
PropertyChanges {
target: txtTitle
text: qsTr ( "Sync to other device" )
}
PropertyChanges {
target: txtDesc
text: qsTr ( "Get your data straight from your other device." )
height: Constants . onboarding . loginInfoHeight2
}
PropertyChanges {
target: button1
text: qsTr ( "Scan sync code" )
enabled: false // TODO: we don't have the sync flow developed yet
}
PropertyChanges {
target: button2
text: qsTr ( "I don’ t have other device" )
}
PropertyChanges {
target: button3
text: ""
}
} ,
State {
name: Constants . startupState . recoverOldUser
when: root . startupStore . currentStartupState . stateType === Constants . startupState . recoverOldUser
PropertyChanges {
target: keysImg
Layout.preferredWidth: d . imgKeysWH
Layout.preferredHeight: d . imgKeysWH
source: Style . png ( "onboarding/keys" )
}
2022-03-04 23:31:31 +00:00
PropertyChanges {
target: txtTitle
text: qsTr ( "Connect your keys" )
}
PropertyChanges {
target: txtDesc
text: qsTr ( "Use your existing Status keys to login to this device." )
2022-11-30 09:25:47 +00:00
height: Constants . onboarding . loginInfoHeight2
2022-03-04 23:31:31 +00:00
}
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button1
2023-01-16 09:45:33 +00:00
text: ""
2022-03-04 23:31:31 +00:00
}
2022-10-27 09:26:34 +00:00
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button2
text: qsTr ( "Login with Keycard" )
}
2022-03-04 23:31:31 +00:00
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button3
2022-03-04 23:31:31 +00:00
text: qsTr ( "Enter a seed phrase" )
}
} ,
State {
2022-07-20 12:34:44 +00:00
name: Constants . startupState . welcomeNewStatusUser
when: root . startupStore . currentStartupState . stateType === Constants . startupState . welcomeNewStatusUser
2022-05-25 15:24:01 +00:00
PropertyChanges {
target: keysImg
2022-11-30 09:25:47 +00:00
Layout.preferredWidth: d . imgKeysWH
Layout.preferredHeight: d . imgKeysWH
source: Style . png ( "onboarding/keys" )
2022-05-25 15:24:01 +00:00
}
2022-03-04 23:31:31 +00:00
PropertyChanges {
target: txtTitle
text: qsTr ( "Get your keys" )
}
PropertyChanges {
target: txtDesc
text: qsTr ( "A set of keys controls your account. Your keys live on your\ndevice, so only you can use them." )
2022-11-30 09:25:47 +00:00
height: Constants . onboarding . loginInfoHeight2
2022-03-04 23:31:31 +00:00
}
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button1
2022-03-04 23:31:31 +00:00
text: qsTr ( "Generate new keys" )
}
2022-07-21 11:29:18 +00:00
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button2
2022-07-21 11:29:18 +00:00
text: qsTr ( "Generate keys for a new Keycard" )
}
2022-03-04 23:31:31 +00:00
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button3
2022-03-29 19:15:42 +00:00
text: qsTr ( "Import a seed phrase" )
2022-03-04 23:31:31 +00:00
}
} ,
State {
2022-07-20 12:34:44 +00:00
name: Constants . startupState . userProfileImportSeedPhrase
when: root . startupStore . currentStartupState . stateType === Constants . startupState . userProfileImportSeedPhrase
2022-03-04 23:31:31 +00:00
PropertyChanges {
target: txtTitle
2022-03-29 19:15:42 +00:00
text: qsTr ( "Import a seed phrase" )
2022-03-04 23:31:31 +00:00
}
2022-04-27 08:32:41 +00:00
PropertyChanges {
target: keysImg
2022-11-30 09:25:47 +00:00
Layout.preferredWidth: d . imgSeedPhraseWH
Layout.preferredHeight: d . imgSeedPhraseWH
2022-04-27 08:32:41 +00:00
source: Style . png ( "onboarding/seed-phrase" )
}
2022-03-04 23:31:31 +00:00
PropertyChanges {
target: txtDesc
2022-05-25 15:24:01 +00:00
text: qsTr ( "Seed phrases are used to back up and restore your keys. Only use this option if you already have a seed phrase." )
2022-11-30 09:25:47 +00:00
height: Constants . onboarding . loginInfoHeight2
2022-03-04 23:31:31 +00:00
}
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button1
2022-03-29 19:15:42 +00:00
text: qsTr ( "Import a seed phrase" )
2022-03-04 23:31:31 +00:00
}
2022-07-21 11:29:18 +00:00
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button2
2022-07-21 11:29:18 +00:00
text: qsTr ( "Import a seed phrase into a new Keycard" )
}
2022-03-04 23:31:31 +00:00
PropertyChanges {
2022-11-30 09:25:47 +00:00
target: button3
2022-03-04 23:31:31 +00:00
text: ""
2022-11-30 09:25:47 +00:00
}
} ,
State {
name: Constants . startupState . profileFetchingAnnouncement
when: root . startupStore . currentStartupState . stateType === Constants . startupState . profileFetchingAnnouncement
PropertyChanges {
target: keysImg
Layout.preferredWidth: d . imgKeysWH
Layout.preferredHeight: d . imgKeysWH
source: Style . png ( "onboarding/keys" )
}
PropertyChanges {
target: txtTitle
text: qsTr ( "Unable to fetch your profile" )
}
PropertyChanges {
target: txtDesc
text: qsTr ( "We cannot retrieve your profile data. If you have another device\nwith the Status profile, make sure that Status is running on the\nother device and that both devices are online." )
height: Constants . onboarding . loginInfoHeight3
}
PropertyChanges {
target: button1
text: qsTr ( "Try to fetch profile again" )
}
PropertyChanges {
target: button2
text: qsTr ( "Create new profile with the same chatkey" )
}
PropertyChanges {
target: button3
text: ""
}
} ,
State {
name: Constants . startupState . userProfileCreateSameChatKey
when: root . startupStore . currentStartupState . stateType === Constants . startupState . userProfileCreateSameChatKey
PropertyChanges {
target: keysImg
2022-03-04 23:31:31 +00:00
visible: false
}
2022-11-30 09:25:47 +00:00
PropertyChanges {
target: txtTitle
text: qsTr ( "Create a new profile with the same chatkey" )
}
PropertyChanges {
target: txtDesc
text: qsTr ( "We cannot fetch your profile data, but you still can create a profile with a same\nchatkey, name and avatar so you contacts will be able to reach you. " )
height: Constants . onboarding . loginInfoHeight2
}
PropertyChanges {
target: button1
text: qsTr ( "Continue" )
}
PropertyChanges {
target: button2
text: ""
}
PropertyChanges {
target: button3
text: ""
}
2022-03-04 23:31:31 +00:00
}
]
2020-05-19 13:22:38 +00:00
}