1
0

qml: don't show error when textfield is empty, don't log error when optional propert is undefined

This commit is contained in:
Sander van Grieken
2023-10-23 15:30:56 +02:00
parent b0dbdfd5e4
commit eb676b3dc1

View File

@@ -15,7 +15,7 @@ WizardComponent {
property int cosigner: 0 property int cosigner: 0
property int participants: 0 property int participants: 0
property string multisigMasterPubkey: wizard_data['multisig_master_pubkey'] property string multisigMasterPubkey
function apply() { function apply() {
applyMasterKey(masterkey_ta.text) applyMasterKey(masterkey_ta.text)
@@ -35,6 +35,11 @@ WizardComponent {
validationtext.text = '' validationtext.text = ''
key = key.trim() key = key.trim()
if (!key) {
validationtext.text = ''
return false
}
if (!bitcoin.verifyMasterKey(key, wizard_data['wallet_type'])) { if (!bitcoin.verifyMasterKey(key, wizard_data['wallet_type'])) {
validationtext.text = qsTr('Error: invalid master key') validationtext.text = qsTr('Error: invalid master key')
return false return false
@@ -179,7 +184,9 @@ WizardComponent {
Bitcoin { Bitcoin {
id: bitcoin id: bitcoin
onValidationMessageChanged: validationtext.text = validationMessage onValidationMessageChanged: {
validationtext.text = validationMessage
}
} }
Component.onCompleted: { Component.onCompleted: {
@@ -187,6 +194,10 @@ WizardComponent {
if ('multisig_current_cosigner' in wizard_data) if ('multisig_current_cosigner' in wizard_data)
cosigner = wizard_data['multisig_current_cosigner'] cosigner = wizard_data['multisig_current_cosigner']
participants = wizard_data['multisig_participants'] participants = wizard_data['multisig_participants']
if ('multisig_master_pubkey' in wizard_data) {
multisigMasterPubkey = wizard_data['multisig_master_pubkey']
}
} }
Qt.callLater(masterkey_ta.forceActiveFocus) Qt.callLater(masterkey_ta.forceActiveFocus)
} }