electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit b0ddd7dc2779eeb2b328bea05d63a7343ab404ae
parent 19dcc5789f3c32236e3437eda879b1de5617d7aa
Author: ThomasV <thomasv@electrum.org>
Date:   Sat,  7 Mar 2020 20:57:48 +0100

kivy receive screen:
 - change behavior of delete button
 - screen must call parent's methods

Diffstat:
Melectrum/gui/kivy/uix/screens.py | 7+++----
Melectrum/gui/kivy/uix/ui_screens/receive.kv | 4++--
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/electrum/gui/kivy/uix/screens.py b/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() diff --git a/electrum/gui/kivy/uix/ui_screens/receive.kv b/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