commit af7e7b397f7e9b11bdc1aa9191272260bf2d2c8a
parent af282d8d2c92333e6c10a73ff675c5e1d7dc1e76
Author: ThomasV <thomasv@electrum.org>
Date: Mon, 15 Feb 2016 04:18:58 +0100
kivy: update request status
Diffstat:
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py
@@ -299,6 +299,9 @@ class ReceiveScreen(CScreen):
def update(self):
if not self.screen.address:
self.get_new_address()
+ else:
+ status = self.app.wallet.get_request_status(self.screen.address)
+ self.screen.status = pr_receive_text[status]
def get_new_address(self):
addr = self.app.wallet.get_unused_address(None)
@@ -315,10 +318,9 @@ class ReceiveScreen(CScreen):
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')
+ self.screen.amount = self.app.format_amount_and_units(amount) if amount else ''
+ status = req.get('status', PR_UNKNOWN)
+ self.screen.status = pr_receive_text[status]
Clock.schedule_once(lambda dt: self.update_qr())
def amount_callback(self, popup):
@@ -384,6 +386,12 @@ pr_text = {
PR_PAID:_('Paid'),
PR_EXPIRED:_('Expired')
}
+pr_receive_text = {
+ PR_UNPAID: '',
+ PR_UNKNOWN: '',
+ PR_PAID: _('Payment received'),
+ PR_EXPIRED: ''
+}
pr_icon = {
PR_UNPAID: 'atlas://gui/kivy/theming/light/important',
PR_UNKNOWN: 'atlas://gui/kivy/theming/light/important',