tkivy: group network calback registrations - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 732679aa3dd8eab99f1d77e1e5644fe6b3105066 DIR parent ce977e0385f7eaa910df5f47ed90c6347c2c7d99 HTML Author: ThomasV <thomasv@electrum.org> Date: Fri, 21 Jul 2017 10:38:50 +0200 kivy: group network calback registrations Diffstat: M gui/kivy/main_window.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) --- DIR diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py t@@ -448,12 +448,8 @@ class ElectrumWindow(App): self.load_wallet_by_name(self.electrum_config.get_wallet_path()) # init plugins run_hook('init_kivy', self) - # fiat currency self.fiat_unit = self.fx.ccy if self.fx.is_enabled() else '' - self.network.register_callback(self.on_quotes, ['on_quotes']) - self.network.register_callback(self.on_history, ['on_history']) - # default tab self.switch_to('history') # bind intent for bitcoin: URI scheme t@@ -464,12 +460,18 @@ class ElectrumWindow(App): mactivity = PythonActivity.mActivity self.on_new_intent(mactivity.getIntent()) activity.bind(on_new_intent=self.on_new_intent) - + # connect callbacks + if self.network: + interests = ['updated', 'status', 'new_transaction', 'verified', 'interfaces'] + self.network.register_callback(self.on_network_event, interests) + self.network.register_callback(self.on_quotes, ['on_quotes']) + self.network.register_callback(self.on_history, ['on_history']) # URI passed in config uri = self.electrum_config.get('url') if uri: self.set_URI(uri) + def get_wallet_path(self): if self.wallet: return self.wallet.storage.path t@@ -585,13 +587,7 @@ class ElectrumWindow(App): self.invoices_screen = None self.receive_screen = None self.requests_screen = None - self.icon = "icons/electrum.png" - - # connect callbacks - if self.network: - interests = ['updated', 'status', 'new_transaction', 'verified', 'interfaces'] - self.network.register_callback(self.on_network_event, interests) self.tabs = self.root.ids['tabs'] def update_interfaces(self, dt):