kivy: update request status
This commit is contained in:
@@ -299,6 +299,9 @@ class ReceiveScreen(CScreen):
|
|||||||
def update(self):
|
def update(self):
|
||||||
if not self.screen.address:
|
if not self.screen.address:
|
||||||
self.get_new_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):
|
def get_new_address(self):
|
||||||
addr = self.app.wallet.get_unused_address(None)
|
addr = self.app.wallet.get_unused_address(None)
|
||||||
@@ -315,10 +318,9 @@ class ReceiveScreen(CScreen):
|
|||||||
if req:
|
if req:
|
||||||
self.screen.message = unicode(req.get('memo', ''))
|
self.screen.message = unicode(req.get('memo', ''))
|
||||||
amount = req.get('amount')
|
amount = req.get('amount')
|
||||||
if amount:
|
self.screen.amount = self.app.format_amount_and_units(amount) if amount else ''
|
||||||
self.screen.amount = self.app.format_amount_and_units(amount)
|
status = req.get('status', PR_UNKNOWN)
|
||||||
if req.get('status') == PR_PAID:
|
self.screen.status = pr_receive_text[status]
|
||||||
self.screen.status = _('Payment received')
|
|
||||||
Clock.schedule_once(lambda dt: self.update_qr())
|
Clock.schedule_once(lambda dt: self.update_qr())
|
||||||
|
|
||||||
def amount_callback(self, popup):
|
def amount_callback(self, popup):
|
||||||
@@ -384,6 +386,12 @@ pr_text = {
|
|||||||
PR_PAID:_('Paid'),
|
PR_PAID:_('Paid'),
|
||||||
PR_EXPIRED:_('Expired')
|
PR_EXPIRED:_('Expired')
|
||||||
}
|
}
|
||||||
|
pr_receive_text = {
|
||||||
|
PR_UNPAID: '',
|
||||||
|
PR_UNKNOWN: '',
|
||||||
|
PR_PAID: _('Payment received'),
|
||||||
|
PR_EXPIRED: ''
|
||||||
|
}
|
||||||
pr_icon = {
|
pr_icon = {
|
||||||
PR_UNPAID: 'atlas://gui/kivy/theming/light/important',
|
PR_UNPAID: 'atlas://gui/kivy/theming/light/important',
|
||||||
PR_UNKNOWN: 'atlas://gui/kivy/theming/light/important',
|
PR_UNKNOWN: 'atlas://gui/kivy/theming/light/important',
|
||||||
|
|||||||
Reference in New Issue
Block a user