ifself.win.payto_e.is_multiline():# only supports single line entries atm
returnFalse
return
url=str(self.win.payto_e.toPlainText())
url=url.replace('@','.')# support email-style addresses, per the OA standard
ifurl==self.win.previous_payto_e:
return
self.win.previous_payto_e=url
url=url.replace('@','.')# support email-style addresses, per the OA standard
if('.'inurl)and(not'<'inurl)and(not''inurl):
ifnotOA_READY:# handle a failed DNSPython load
ifnotOA_READY:# handle a failed DNSPython load
QMessageBox.warning(self.win,_('Error'),'Could not load DNSPython libraries, please ensure they are available and/or Electrum has been built correctly',_('OK'))
returnFalse
return
else:
returnFalse
return
data=self.resolve(url)
ifnotdata:
self.win.previous_payto_e=url
returnTrue
(address,name)=data
self.win.payto_e.setText(url+' <'+address+'>')
new_url=url+' <'+address+'>'
self.win.payto_e.setText(new_url)
self.win.previous_payto_e=new_url
@hook
defbefore_send(self):
'''
ChangeURLtoaddressbeforemakingasend.
IMPORTANT:
returnFalsetocontinueexecutionofthesend
returnTruetostopexecutionofthesend
'''
ifself.win.payto_e.is_multiline():# only supports single line entries atm
returnFalse
payto_e=str(self.win.payto_e.toPlainText())
regex=re.compile(r'^([^\s]+) <([A-Za-z0-9]+)>')# only do that for converted addresses
try:
(url,address)=regex.search(payto_e).groups()
exceptAttributeError:
returnFalse
ifnotOA_READY:# handle a failed DNSPython load
QMessageBox.warning(self.win,_('Error'),'Could not load DNSPython libraries, please ensure they are available and/or Electrum has been built correctly',_('OK'))
returnTrue
ifnotself.validate_dnssec(url):
msgBox=QMessageBox()
msgBox.setText(_('WARNING: the address '+address+' could not be validated via an additional security check, DNSSEC, and thus may not be correct.'))
msgBox.setText(_('WARNING: the address '+address+' could not be validated via an additional security check, DNSSEC, and thus may not be correct.'))
msgBox.setInformativeText(_('Do you wish to continue?'))