More cleanup of WaitingDialog
Simplify its interface
This commit is contained in:
@@ -116,7 +116,7 @@ class Plugin(BasePlugin):
|
||||
amodem.main.recv(config=self.modem_config, src=src, dst=dst)
|
||||
return dst.getvalue()
|
||||
|
||||
def on_success(blob):
|
||||
def on_finished(blob):
|
||||
if blob:
|
||||
blob = zlib.decompress(blob)
|
||||
print_msg('Received:', repr(blob))
|
||||
@@ -124,4 +124,4 @@ class Plugin(BasePlugin):
|
||||
|
||||
kbps = self.modem_config.modem_bps / 1e3
|
||||
msg = 'Receiving from Audio MODEM ({0:.1f} kbps)...'.format(kbps)
|
||||
WaitingDialog(parent, msg, receiver_thread, on_success=on_success)
|
||||
WaitingDialog(parent, msg, receiver_thread, on_finished)
|
||||
|
||||
@@ -85,10 +85,10 @@ class Plugin(TrustedCoinPlugin):
|
||||
self.print_error("twofactor: xpub3 not needed")
|
||||
window.wallet.auth_code = auth_code
|
||||
|
||||
def waiting_dialog(self, window, on_success=None):
|
||||
def waiting_dialog(self, window, on_finished=None):
|
||||
task = partial(self.request_billing_info, window.wallet)
|
||||
return WaitingDialog(window, 'Getting billing information...', task,
|
||||
on_success=on_success)
|
||||
on_finished)
|
||||
|
||||
@hook
|
||||
def abort_send(self, window):
|
||||
@@ -104,8 +104,7 @@ class Plugin(TrustedCoinPlugin):
|
||||
|
||||
|
||||
def settings_dialog(self, window):
|
||||
on_success = partial(self.show_settings_dialog, window)
|
||||
self.waiting_dialog(window, on_success)
|
||||
self.waiting_dialog(window, partial(self.show_settings_dialog, window))
|
||||
|
||||
def show_settings_dialog(self, window, success):
|
||||
if not success:
|
||||
|
||||
Reference in New Issue
Block a user