kivy: add save_request button

This commit is contained in:
ThomasV 2015-12-11 15:48:56 +01:00
parent c71b8d7328
commit 680c9c888a
2 changed files with 18 additions and 0 deletions

View File

@ -293,9 +293,22 @@ class ReceiveScreen(CScreen):
uri = self.get_URI()
self.app._clipboard.put(uri, 'text/plain')
def do_save(self):
addr = str(self.screen.address)
amount = str(self.screen.amount)
message = unicode(self.screen.message)
if not message and not amount:
self.app.show_error(_('No message or amount'))
return False
amount = self.app.get_amount(amount)
req = self.app.wallet.make_payment_request(addr, amount, message, None)
self.app.wallet.add_payment_request(req, self.app.electrum_config)
self.app.show_error(_('Request saved'))
def do_clear(self):
self.screen.amount = ''
self.screen.message = ''
self.update()

View File

@ -93,5 +93,10 @@ ReceiveScreen:
size_hint: 1, None
height: '48dp'
on_release: s.parent.do_clear()
Button:
text: _('Save')
size_hint: 1, None
height: '48dp'
on_release: s.parent.do_save()
Widget:
size_hint: 1, 0.3