electrum

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

commit 305ca9064742d6bf6996d2757c1529fde30198e0
parent 863cc399951a7d816ac648b1266063c3fb4171c3
Author: ThomasV <thomasv@electrum.org>
Date:   Sun,  6 Dec 2020 11:51:15 +0100

revert a9fc440, use Clock.schedule_interval to set address. Fixes #6810 and #6817

Diffstat:
Melectrum/gui/kivy/uix/dialogs/addresses.py | 4+++-
Melectrum/gui/kivy/uix/screens.py | 2+-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/electrum/gui/kivy/uix/dialogs/addresses.py b/electrum/gui/kivy/uix/dialogs/addresses.py @@ -1,6 +1,7 @@ from typing import TYPE_CHECKING from kivy.app import App +from kivy.clock import Clock from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder @@ -206,7 +207,8 @@ class AddressPopup(Popup): self.dismiss() self.parent_dialog.dismiss() self.app.switch_to('receive') - self.app.receive_screen.set_address(self.address) + # retry until receive_screen is set + Clock.schedule_interval(lambda dt: bool(self.app.receive_screen.set_address(self.address) and False) if self.app.receive_screen else True, 0.1) def do_export(self, pk_label): self.app.export_private_keys(pk_label, self.address) diff --git a/electrum/gui/kivy/uix/screens.py b/electrum/gui/kivy/uix/screens.py @@ -71,6 +71,7 @@ class CScreen(Factory.Screen): pass def on_activate(self): + setattr(self.app, self.kvname + '_screen', self) self.update() def on_leave(self): @@ -618,7 +619,6 @@ class TabbedCarousel(Factory.TabbedPanel): if carousel.current_slide != slide: carousel.current_slide.dispatch('on_leave') carousel.load_slide(slide) - setattr(slide.app, slide.kvname + '_screen', slide) slide.dispatch('on_enter') def add_widget(self, widget, index=0):