qml: fix wizard_data not available to 'last' check on have seed wizard page
also refactor seed verification, split off seed_variant from seed_type (partial disambiguation), fix bip39 wallet creation
This commit is contained in:
@@ -14,38 +14,37 @@ WizardComponent {
|
||||
|
||||
property bool is2fa: false
|
||||
|
||||
onAccept: {
|
||||
function apply() {
|
||||
wizard_data['seed'] = seedtext.text
|
||||
wizard_data['seed_variant'] = seed_variant.currentValue
|
||||
wizard_data['seed_type'] = bitcoin.seed_type
|
||||
wizard_data['seed_extend'] = extendcb.checked
|
||||
wizard_data['seed_extra_words'] = extendcb.checked ? customwordstext.text : ''
|
||||
wizard_data['seed_bip39'] = seed_type.getTypeCode() == 'BIP39'
|
||||
wizard_data['seed_slip39'] = seed_type.getTypeCode() == 'SLIP39'
|
||||
}
|
||||
|
||||
function setSeedTypeHelpText() {
|
||||
var t = {
|
||||
'Electrum': [
|
||||
'electrum': [
|
||||
qsTr('Electrum seeds are the default seed type.'),
|
||||
qsTr('If you are restoring from a seed previously created by Electrum, choose this option')
|
||||
].join(' '),
|
||||
'BIP39': [
|
||||
'bip39': [
|
||||
qsTr('BIP39 seeds can be imported in Electrum, so that users can access funds locked in other wallets.'),
|
||||
'<br/><br/>',
|
||||
qsTr('However, we do not generate BIP39 seeds, because they do not meet our safety standard.'),
|
||||
qsTr('BIP39 seeds do not include a version number, which compromises compatibility with future software.')
|
||||
].join(' '),
|
||||
'SLIP39': [
|
||||
'slip39': [
|
||||
qsTr('SLIP39 seeds can be imported in Electrum, so that users can access funds locked in other wallets.'),
|
||||
'<br/><br/>',
|
||||
qsTr('However, we do not generate SLIP39 seeds.')
|
||||
].join(' ')
|
||||
}
|
||||
infotext.text = t[seed_type.currentText]
|
||||
infotext.text = t[seed_variant.currentValue]
|
||||
}
|
||||
|
||||
function checkValid() {
|
||||
bitcoin.verify_seed(seedtext.text, seed_type.getTypeCode() == 'BIP39', seed_type.getTypeCode() == 'SLIP39', wizard_data['wallet_type'])
|
||||
bitcoin.verify_seed(seedtext.text, seed_variant.currentValue, wizard_data['wallet_type'])
|
||||
}
|
||||
|
||||
Flickable {
|
||||
@@ -65,16 +64,20 @@ WizardComponent {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
ComboBox {
|
||||
id: seed_type
|
||||
id: seed_variant
|
||||
visible: !is2fa
|
||||
model: ['Electrum', 'BIP39'/*, 'SLIP39'*/]
|
||||
|
||||
textRole: 'text'
|
||||
valueRole: 'value'
|
||||
model: [
|
||||
{ text: qsTr('Electrum'), value: 'electrum' },
|
||||
{ text: qsTr('BIP39'), value: 'bip39' }
|
||||
]
|
||||
onActivated: {
|
||||
setSeedTypeHelpText()
|
||||
checkIsLast()
|
||||
checkValid()
|
||||
}
|
||||
function getTypeCode() {
|
||||
return currentText
|
||||
}
|
||||
}
|
||||
InfoTextArea {
|
||||
id: infotext
|
||||
|
||||
Reference in New Issue
Block a user