qml: remove ready signal hack, wizard_data now available at WizardComponent construction time
This commit is contained in:
@@ -52,8 +52,7 @@ WizardComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onReadyChanged: {
|
Component.onCompleted: {
|
||||||
if (ready)
|
customwordstext.visible = wizard_data['seed_extend']
|
||||||
customwordstext.visible = wizard_data['seed_extend']
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,7 @@ WizardComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onReadyChanged: {
|
Component.onCompleted: {
|
||||||
if (!ready)
|
|
||||||
return
|
|
||||||
|
|
||||||
participants = wizard_data['multisig_participants']
|
participants = wizard_data['multisig_participants']
|
||||||
|
|
||||||
// cosigner index is determined here and put on the wizard_data dict in apply()
|
// cosigner index is determined here and put on the wizard_data dict in apply()
|
||||||
|
|||||||
@@ -23,10 +23,7 @@ WCHaveSeed {
|
|||||||
wizard_data['cosigner_seed_extra_words'] = seed_extra_words
|
wizard_data['cosigner_seed_extra_words'] = seed_extra_words
|
||||||
}
|
}
|
||||||
|
|
||||||
onReadyChanged: {
|
Component.onCompleted: {
|
||||||
if (!ready)
|
|
||||||
return
|
|
||||||
|
|
||||||
participants = wizard_data['multisig_participants']
|
participants = wizard_data['multisig_participants']
|
||||||
cosigner = wizard_data['multisig_current_cosigner']
|
cosigner = wizard_data['multisig_current_cosigner']
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,9 +76,7 @@ WizardComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onReadyChanged: {
|
Component.onCompleted: {
|
||||||
if (!ready)
|
|
||||||
return
|
|
||||||
bitcoin.generate_seed(wizard_data['seed_type'])
|
bitcoin.generate_seed(wizard_data['seed_type'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,14 +168,9 @@ WizardComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
if (wizard_data['wallet_type'] == '2fa')
|
||||||
|
root.is2fa = true
|
||||||
setSeedTypeHelpText()
|
setSeedTypeHelpText()
|
||||||
}
|
}
|
||||||
|
|
||||||
onReadyChanged: {
|
|
||||||
if (!ready)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (wizard_data['wallet_type'] == '2fa')
|
|
||||||
root.is2fa = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,10 +52,7 @@ WizardComponent {
|
|||||||
id: bitcoin
|
id: bitcoin
|
||||||
}
|
}
|
||||||
|
|
||||||
onReadyChanged: {
|
Component.onCompleted: {
|
||||||
if (!ready)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (wizard_data['seed_variant'] == 'electrum') {
|
if (wizard_data['seed_variant'] == 'electrum') {
|
||||||
masterPubkey = bitcoin.getMultisigMasterPubkey(wizard_data['seed_variant'], wizard_data['seed'], wizard_data['seed_extra_words'])
|
masterPubkey = bitcoin.getMultisigMasterPubkey(wizard_data['seed_variant'], wizard_data['seed'], wizard_data['seed_extra_words'])
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -38,7 +38,11 @@ Dialog {
|
|||||||
console.log(comp.errorString())
|
console.log(comp.errorString())
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
var page = comp.createObject(pages)
|
|
||||||
|
// make a deepcopy of wdata and pass it to the component
|
||||||
|
var wdata_copy={}
|
||||||
|
Object.assign(wdata_copy, wdata)
|
||||||
|
var page = comp.createObject(pages, {wizard_data: wdata_copy})
|
||||||
page.validChanged.connect(function() {
|
page.validChanged.connect(function() {
|
||||||
pages.pagevalid = page.valid
|
pages.pagevalid = page.valid
|
||||||
} )
|
} )
|
||||||
@@ -58,8 +62,7 @@ Dialog {
|
|||||||
var wdata = wiz.prev()
|
var wdata = wiz.prev()
|
||||||
console.log('prev view data: ' + JSON.stringify(wdata))
|
console.log('prev view data: ' + JSON.stringify(wdata))
|
||||||
})
|
})
|
||||||
Object.assign(page.wizard_data, wdata) // deep copy
|
|
||||||
page.ready = true // signal page it can access wizard_data
|
|
||||||
pages.pagevalid = page.valid
|
pages.pagevalid = page.valid
|
||||||
pages.lastpage = page.last
|
pages.lastpage = page.last
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user