Browse Source

kivy: hide qr code if request is paid

283
ThomasV 9 years ago
parent
commit
73caa89c44
  1. 5
      gui/kivy/uix/screens.py
  2. 15
      gui/kivy/uix/ui_screens/receive.kv

5
gui/kivy/uix/screens.py

@ -310,12 +310,15 @@ class ReceiveScreen(CScreen):
return True
def on_address(self, addr):
req = self.app.wallet.receive_requests.get(addr)
req = self.app.wallet.get_payment_request(addr, self.app.electrum_config)
self.screen.status = ''
if req:
self.screen.message = unicode(req.get('memo', ''))
amount = req.get('amount')
if amount:
self.screen.amount = self.app.format_amount_and_units(amount)
if req.get('status') == PR_PAID:
self.screen.status = _('Payment received')
Clock.schedule_once(lambda dt: self.update_qr())
def amount_callback(self, popup):

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

@ -13,6 +13,7 @@ ReceiveScreen:
address: ''
amount: ''
message: ''
status: ''
on_address:
self.parent.on_address(self.address)
@ -37,6 +38,20 @@ ReceiveScreen:
on_touch_down:
self.shaded = not self.shaded
self.foreground_color = (0, 0, 0, 0.5) if self.shaded else (0, 0, 0, 0)
Label:
text: root.status
opacity: 1 if root.status else 0
pos_hint: {'center': (.5, .5)}
size_hint: None, 1
width: min(self.height, bl.width)
bcolor: 0.3, 0.3, 0.3, 0.9
canvas.before:
Color:
rgba: self.bcolor
Rectangle:
pos: self.pos
size: self.size
SendReceiveBlueBottom:
id: blue_bottom

Loading…
Cancel
Save