Better waiting dialog for trustedcoin

This commit is contained in:
Neil Booth 2015-12-23 22:21:29 +09:00
parent ffd081ac21
commit d70ad3df93
1 changed files with 8 additions and 6 deletions

View File

@ -85,15 +85,18 @@ class Plugin(TrustedCoinPlugin):
self.print_error("twofactor: xpub3 not needed") self.print_error("twofactor: xpub3 not needed")
window.wallet.auth_code = auth_code window.wallet.auth_code = auth_code
def waiting_dialog(self, window, on_success=None):
task = partial(self.request_billing_info, window.wallet)
return WaitingDialog(window, 'Getting billing information...', task,
on_success=on_success)
@hook @hook
def abort_send(self, window): def abort_send(self, window):
wallet = window.wallet wallet = window.wallet
if type(wallet) is Wallet_2fa and not wallet.can_sign_without_server(): if type(wallet) is Wallet_2fa and not wallet.can_sign_without_server():
if wallet.billing_info is None: if wallet.billing_info is None:
# request billing info before forming the transaction # request billing info before forming the transaction
task = partial(self.request_billing_info, wallet) waiting_dialog(self, window).wait()
dialog = WaitingDialog(window, 'please wait...', task)
dialog.wait()
if wallet.billing_info is None: if wallet.billing_info is None:
window.show_message('Could not contact server') window.show_message('Could not contact server')
return True return True
@ -101,9 +104,8 @@ class Plugin(TrustedCoinPlugin):
def settings_dialog(self, window): def settings_dialog(self, window):
task = partial(self.request_billing_info, window.wallet) on_success = partial(self.show_settings_dialog, window)
WaitingDialog(window, 'please wait...', task, self.waiting_dialog(window, on_success)
on_success=partial(self.show_settings_dialog, window))
def show_settings_dialog(self, window, success): def show_settings_dialog(self, window, success):
if not success: if not success: