qml: remove ready signal hack, wizard_data now available at WizardComponent construction time
This commit is contained in:
@@ -52,8 +52,7 @@ WizardComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onReadyChanged: {
|
||||
if (ready)
|
||||
customwordstext.visible = wizard_data['seed_extend']
|
||||
Component.onCompleted: {
|
||||
customwordstext.visible = wizard_data['seed_extend']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,7 @@ WizardComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onReadyChanged: {
|
||||
if (!ready)
|
||||
return
|
||||
|
||||
Component.onCompleted: {
|
||||
participants = wizard_data['multisig_participants']
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
onReadyChanged: {
|
||||
if (!ready)
|
||||
return
|
||||
|
||||
Component.onCompleted: {
|
||||
participants = wizard_data['multisig_participants']
|
||||
cosigner = wizard_data['multisig_current_cosigner']
|
||||
}
|
||||
|
||||
@@ -76,9 +76,7 @@ WizardComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onReadyChanged: {
|
||||
if (!ready)
|
||||
return
|
||||
Component.onCompleted: {
|
||||
bitcoin.generate_seed(wizard_data['seed_type'])
|
||||
}
|
||||
|
||||
|
||||
@@ -168,14 +168,9 @@ WizardComponent {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (wizard_data['wallet_type'] == '2fa')
|
||||
root.is2fa = true
|
||||
setSeedTypeHelpText()
|
||||
}
|
||||
|
||||
onReadyChanged: {
|
||||
if (!ready)
|
||||
return
|
||||
|
||||
if (wizard_data['wallet_type'] == '2fa')
|
||||
root.is2fa = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,10 +52,7 @@ WizardComponent {
|
||||
id: bitcoin
|
||||
}
|
||||
|
||||
onReadyChanged: {
|
||||
if (!ready)
|
||||
return
|
||||
|
||||
Component.onCompleted: {
|
||||
if (wizard_data['seed_variant'] == 'electrum') {
|
||||
masterPubkey = bitcoin.getMultisigMasterPubkey(wizard_data['seed_variant'], wizard_data['seed'], wizard_data['seed_extra_words'])
|
||||
} else {
|
||||
|
||||
@@ -38,7 +38,11 @@ Dialog {
|
||||
console.log(comp.errorString())
|
||||
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() {
|
||||
pages.pagevalid = page.valid
|
||||
} )
|
||||
@@ -58,8 +62,7 @@ Dialog {
|
||||
var wdata = wiz.prev()
|
||||
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.lastpage = page.last
|
||||
|
||||
|
||||
Reference in New Issue
Block a user