1
0

qml: use new wizard approach in qml and also implement 2FA/trustedcoin

This commit is contained in:
Sander van Grieken
2022-09-22 12:43:51 +02:00
parent a4195267ff
commit 43bac2edff
22 changed files with 874 additions and 217 deletions

View File

@@ -12,6 +12,8 @@ WizardComponent {
id: root
valid: false
property bool is2fa: false
onAccept: {
wizard_data['seed'] = seedtext.text
wizard_data['seed_type'] = bitcoin.seed_type
@@ -43,7 +45,7 @@ WizardComponent {
}
function checkValid() {
bitcoin.verify_seed(seedtext.text, seed_type.getTypeCode() == 'BIP39', seed_type.getTypeCode() == 'SLIP39')
bitcoin.verify_seed(seedtext.text, seed_type.getTypeCode() == 'BIP39', seed_type.getTypeCode() == 'SLIP39', wizard_data['wallet_type'])
}
Flickable {
@@ -58,11 +60,13 @@ WizardComponent {
columns: 2
Label {
visible: !is2fa
text: qsTr('Seed Type')
Layout.fillWidth: true
}
ComboBox {
id: seed_type
visible: !is2fa
model: ['Electrum', 'BIP39'/*, 'SLIP39'*/]
onActivated: {
setSeedTypeHelpText()
@@ -91,7 +95,7 @@ WizardComponent {
Rectangle {
anchors.fill: contentText
color: 'green'
color: root.valid ? 'green' : 'red'
border.color: Material.accentColor
radius: 2
}
@@ -148,4 +152,12 @@ WizardComponent {
Component.onCompleted: {
setSeedTypeHelpText()
}
onReadyChanged: {
if (!ready)
return
if (wizard_data['wallet_type'] == '2fa')
root.is2fa = true
}
}