1
0

qml: remove ready signal hack, wizard_data now available at WizardComponent construction time

This commit is contained in:
Sander van Grieken
2022-11-09 10:32:15 +01:00
parent 3c903d8fd7
commit 97254bb0ed
7 changed files with 14 additions and 28 deletions

View File

@@ -52,8 +52,7 @@ WizardComponent {
}
}
onReadyChanged: {
if (ready)
customwordstext.visible = wizard_data['seed_extend']
Component.onCompleted: {
customwordstext.visible = wizard_data['seed_extend']
}
}

View File

@@ -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()

View File

@@ -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']
}

View File

@@ -76,9 +76,7 @@ WizardComponent {
}
}
onReadyChanged: {
if (!ready)
return
Component.onCompleted: {
bitcoin.generate_seed(wizard_data['seed_type'])
}

View File

@@ -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
}
}

View File

@@ -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 {

View File

@@ -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