Browse Source

kivy receive screen:

- change behavior of delete button
 - screen must call parent's methods
hard-fail-on-bad-server-string
ThomasV 5 years ago
parent
commit
b0ddd7dc27
  1. 7
      electrum/gui/kivy/uix/screens.py
  2. 4
      electrum/gui/kivy/uix/ui_screens/receive.kv

7
electrum/gui/kivy/uix/screens.py

@ -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()

4
electrum/gui/kivy/uix/ui_screens/receive.kv

@ -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

Loading…
Cancel
Save