Browse Source

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

master
Sander van Grieken 2 years ago
parent
commit
eb676b3dc1
  1. 15
      electrum/gui/qml/components/wizard/WCHaveMasterKey.qml

15
electrum/gui/qml/components/wizard/WCHaveMasterKey.qml

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

Loading…
Cancel
Save