Browse Source

qt swap dialog: fix disabling "OK" btn if NotEnoughFunds

patch-4
SomberNight 4 years ago
parent
commit
fa8c751abf
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 8
      electrum/gui/qt/swap_dialog.py

8
electrum/gui/qt/swap_dialog.py

@ -142,8 +142,8 @@ class SwapDialog(WindowModalDialog):
self.recv_amount_e.setStyleSheet(ColorScheme.BLUE.as_stylesheet())
self.recv_amount_e.follows = False
self.send_follows = False
self.update_fee()
self.ok_button.setEnabled(recv_amount is not None)
self.update_fee() # note: this might disable the "OK" button
def on_recv_edited(self):
if self.recv_amount_e.follows:
@ -158,8 +158,8 @@ class SwapDialog(WindowModalDialog):
self.send_amount_e.setStyleSheet(ColorScheme.BLUE.as_stylesheet())
self.send_amount_e.follows = False
self.send_follows = True
self.update_fee()
self.ok_button.setEnabled(send_amount is not None)
self.update_fee() # note: this might disable the "OK" button
def update(self):
sm = self.swap_manager
@ -233,7 +233,9 @@ class SwapDialog(WindowModalDialog):
self.ok_button.setEnabled(False)
def do_normal_swap(self, lightning_amount, onchain_amount, password):
coro = self.swap_manager.normal_swap(lightning_amount, onchain_amount, password, tx=self.tx)
tx = self.tx
assert tx
coro = self.swap_manager.normal_swap(lightning_amount, onchain_amount, password, tx=tx)
self.window.run_coroutine_from_thread(coro)
def get_description(self):

Loading…
Cancel
Save