Browse Source

kivy: add save_request button

283
ThomasV 9 years ago
parent
commit
680c9c888a
  1. 13
      gui/kivy/uix/screens.py
  2. 5
      gui/kivy/uix/ui_screens/receive.kv

13
gui/kivy/uix/screens.py

@ -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()

5
gui/kivy/uix/ui_screens/receive.kv

@ -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

Loading…
Cancel
Save