commit 73caa89c44f2104c5a3a0336c9c1de14a85b2e69
parent b3861bd54d980cc1a3fdfb15cf009ab78f02ab11
Author: ThomasV <thomasv@electrum.org>
Date: Sun, 14 Feb 2016 12:24:31 +0100
kivy: hide qr code if request is paid
Diffstat:
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/gui/kivy/uix/screens.py b/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):
diff --git a/gui/kivy/uix/ui_screens/receive.kv b/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