digitalbitbox: (trivial) user handler instead of handler.win
This commit is contained in:
@@ -234,10 +234,9 @@ class DigitalBitbox_Client(HardwareClientBase):
|
|||||||
(_("Load a wallet from the micro SD card (the current seed is overwritten)")),
|
(_("Load a wallet from the micro SD card (the current seed is overwritten)")),
|
||||||
(_("Erase the Digital Bitbox"))
|
(_("Erase the Digital Bitbox"))
|
||||||
]
|
]
|
||||||
try:
|
reply = self.handler.query_choice(msg, choices)
|
||||||
reply = self.handler.win.query_choice(msg, choices)
|
if reply is None:
|
||||||
except Exception:
|
return # user cancelled
|
||||||
return # Back button pushed
|
|
||||||
if reply == 2:
|
if reply == 2:
|
||||||
self.dbb_erase()
|
self.dbb_erase()
|
||||||
elif reply == 1:
|
elif reply == 1:
|
||||||
@@ -256,10 +255,9 @@ class DigitalBitbox_Client(HardwareClientBase):
|
|||||||
(_("Generate a new random wallet")),
|
(_("Generate a new random wallet")),
|
||||||
(_("Load a wallet from the micro SD card"))
|
(_("Load a wallet from the micro SD card"))
|
||||||
]
|
]
|
||||||
try:
|
reply = self.handler.query_choice(msg, choices)
|
||||||
reply = self.handler.win.query_choice(msg, choices)
|
if reply is None:
|
||||||
except Exception:
|
return # user cancelled
|
||||||
return # Back button pushed
|
|
||||||
if reply == 0:
|
if reply == 0:
|
||||||
self.dbb_generate_wallet()
|
self.dbb_generate_wallet()
|
||||||
else:
|
else:
|
||||||
@@ -297,10 +295,9 @@ class DigitalBitbox_Client(HardwareClientBase):
|
|||||||
_('Do not pair'),
|
_('Do not pair'),
|
||||||
_('Import pairing from the Digital Bitbox desktop app'),
|
_('Import pairing from the Digital Bitbox desktop app'),
|
||||||
]
|
]
|
||||||
try:
|
reply = self.handler.query_choice(_('Mobile pairing options'), choices)
|
||||||
reply = self.handler.win.query_choice(_('Mobile pairing options'), choices)
|
if reply is None:
|
||||||
except Exception:
|
return # user cancelled
|
||||||
return # Back button pushed
|
|
||||||
|
|
||||||
if reply == 0:
|
if reply == 0:
|
||||||
if self.plugin.is_mobile_paired():
|
if self.plugin.is_mobile_paired():
|
||||||
@@ -338,10 +335,9 @@ class DigitalBitbox_Client(HardwareClientBase):
|
|||||||
backups = self.hid_send_encrypt(b'{"backup":"list"}')
|
backups = self.hid_send_encrypt(b'{"backup":"list"}')
|
||||||
if 'error' in backups:
|
if 'error' in backups:
|
||||||
raise UserFacingException(backups['error']['message'])
|
raise UserFacingException(backups['error']['message'])
|
||||||
try:
|
f = self.handler.query_choice(_("Choose a backup file:"), backups['backup'])
|
||||||
f = self.handler.win.query_choice(_("Choose a backup file:"), backups['backup'])
|
if f is None:
|
||||||
except Exception:
|
return False # user cancelled
|
||||||
return False # Back button pushed
|
|
||||||
key = self.backup_password_dialog()
|
key = self.backup_password_dialog()
|
||||||
if key is None:
|
if key is None:
|
||||||
raise Exception('Canceled by user')
|
raise Exception('Canceled by user')
|
||||||
|
|||||||
Reference in New Issue
Block a user