Wallet tutorial: more polish

This commit is contained in:
mDuo13
2022-02-01 15:16:33 -08:00
parent c955314b6c
commit 3e824759fd
4 changed files with 32 additions and 25 deletions

View File

@@ -202,9 +202,7 @@ class SendXRPDialog(wx.Dialog):
def on_to_edit(self, event):
"""
When the user edits the "To" field, check that the address is well-
formatted. If it's an X-address, fill in the destination tag and disable
it.
When the user edits the "To" field, check that the address is valid.
"""
v = self.txt_to.GetValue().strip()
@@ -565,9 +563,11 @@ class TWaXLFrame(wx.Frame):
resp = dlg.ShowModal()
if resp != wx.ID_OK:
print("Send XRP canceled")
dlg.Destroy()
return
paydata = dlg.get_payment_data()
dlg.Destroy()
self.run_bg_job(self.worker.send_xrp(paydata))
notif = wx.adv.NotificationMessage(title="Sending!", message =
f"Sending a payment for {paydata['amt']} XRP!")

View File

@@ -338,7 +338,12 @@ class SendXRPDialog(wx.Dialog):
destination address.
"""
# Keep existing error message if there is one
err_msg = self.err_to.GetToolTip().GetTip().strip()
try:
err_msg = self.err_to.GetToolTip().GetTip().strip()
except RuntimeError:
# This method can be called after the dialog it belongs to has been
# closed. In that case, there's nothing to do here.
return
if not dest_status["funded"]:
err_msg = ("Warning: this account does not exist. The payment will "
@@ -723,9 +728,11 @@ class TWaXLFrame(wx.Frame):
resp = dlg.ShowModal()
if resp != wx.ID_OK:
print("Send XRP canceled")
dlg.Destroy()
return
paydata = dlg.get_payment_data()
dlg.Destroy()
self.run_bg_job(self.worker.send_xrp(paydata))
notif = wx.adv.NotificationMessage(title="Sending!", message =
f"Sending a payment for {paydata['amt']} XRP!")