kivy receive screen:
- change behavior of delete button - screen must call parent's methods
This commit is contained in:
@@ -516,16 +516,15 @@ class ReceiveScreen(CScreen):
|
||||
|
||||
def clear_requests_dialog(self):
|
||||
requests = self.app.wallet.get_sorted_requests()
|
||||
expired = [req for req in requests if get_request_status(req)[0] == PR_EXPIRED]
|
||||
if len(expired) == 0:
|
||||
if not requests:
|
||||
return
|
||||
def callback(c):
|
||||
if c:
|
||||
for req in expired:
|
||||
for req in requests:
|
||||
key = req.get('rhash') or req['address']
|
||||
self.app.wallet.delete_request(key)
|
||||
self.update()
|
||||
d = Question(_('Delete expired requests?'), callback)
|
||||
d = Question(_('Delete all requests?'), callback)
|
||||
d.open()
|
||||
|
||||
|
||||
|
||||
@@ -135,12 +135,12 @@ ReceiveScreen:
|
||||
icon: 'atlas://electrum/gui/kivy/theming/light/list'
|
||||
size_hint: 0.5, None
|
||||
height: '48dp'
|
||||
on_release: Clock.schedule_once(lambda dt: s.clear_requests_dialog())
|
||||
on_release: Clock.schedule_once(lambda dt: s.parent.clear_requests_dialog())
|
||||
IconButton:
|
||||
icon: 'atlas://electrum/gui/kivy/theming/light/clock1'
|
||||
size_hint: 0.5, None
|
||||
height: '48dp'
|
||||
on_release: Clock.schedule_once(lambda dt: s.expiration_dialog(s))
|
||||
on_release: Clock.schedule_once(lambda dt: s.parent.expiration_dialog(s))
|
||||
Button:
|
||||
text: _('Clear')
|
||||
size_hint: 1, None
|
||||
|
||||
Reference in New Issue
Block a user