kivy: button to show seed, and show error if trying to spend from watching only wallet

This commit is contained in:
ThomasV 2016-02-11 12:54:04 +01:00
parent 535956149a
commit a03301c55f
3 changed files with 34 additions and 0 deletions

View File

@ -706,6 +706,18 @@ class ElectrumWindow(App):
else:
apply(f, args + (None,))
def show_seed(self, label):
self.protected(self._show_seed, (label,))
def _show_seed(self, label, password):
print label, password
try:
seed = self.wallet.get_seed(password)
except:
self.show_error("Invalid PIN")
return
label.text = _('Seed') + ':\n' + seed
def change_password(self):
self.protected(self._change_password, ())

View File

@ -272,6 +272,9 @@ class SendScreen(CScreen):
traceback.print_exc(file=sys.stdout)
self.app.show_error(str(e))
return
if not tx.is_complete():
self.app.show_info("Transaction is not complete")
return
# broadcast
ok, txid = self.app.wallet.sendtx(tx)
self.app.show_info(txid)

View File

@ -67,5 +67,24 @@ Popup:
opacity: 1 if root.unmatured else 0
text_size: self.size
halign: 'left'
Label:
text: ''
id: seed_label
text_size: self.width, None
size: self.texture_size
Widget:
size_hint: None, 1
BoxLayout:
size_hint: 1, None
height: '48dp'
Button:
size_hint: 0.5, None
height: '48dp'
text: _('Hide seed') if seed_label.text else _('Show seed')
on_release:
setattr(seed_label, 'text', '') if seed_label.text else app.show_seed(seed_label)
Button:
size_hint: 0.5, None
height: '48dp'
text: _('Close')
on_release: root.dismiss()