Browse Source
kivy: settings dialog: call update() from __init__
this is a clearer/easier-to-understand API
patch-4
SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
3 changed files with
7 additions and
2 deletions
-
electrum/gui/kivy/main_window.py
-
electrum/gui/kivy/uix/dialogs/addresses.py
-
electrum/gui/kivy/uix/dialogs/settings.py
|
|
@ -723,7 +723,8 @@ class ElectrumWindow(App, Logger): |
|
|
|
from .uix.dialogs.settings import SettingsDialog |
|
|
|
if self._settings_dialog is None: |
|
|
|
self._settings_dialog = SettingsDialog(self) |
|
|
|
self._settings_dialog.update() |
|
|
|
else: |
|
|
|
self._settings_dialog.update() |
|
|
|
self._settings_dialog.open() |
|
|
|
|
|
|
|
def lightning_open_channel_dialog(self): |
|
|
@ -1183,7 +1184,8 @@ class ElectrumWindow(App, Logger): |
|
|
|
from .uix.dialogs.addresses import AddressesDialog |
|
|
|
if self._addresses_dialog is None: |
|
|
|
self._addresses_dialog = AddressesDialog(self) |
|
|
|
self._addresses_dialog.update() |
|
|
|
else: |
|
|
|
self._addresses_dialog.update() |
|
|
|
self._addresses_dialog.open() |
|
|
|
|
|
|
|
def fee_dialog(self): |
|
|
|
|
|
@ -237,6 +237,7 @@ class AddressesDialog(Factory.Popup): |
|
|
|
def __init__(self, app: 'ElectrumWindow'): |
|
|
|
Factory.Popup.__init__(self) |
|
|
|
self.app = app |
|
|
|
self.update() |
|
|
|
|
|
|
|
def get_card(self, addr, balance, is_used, label): |
|
|
|
ci = {} |
|
|
|
|
|
@ -122,6 +122,8 @@ class SettingsDialog(Factory.Popup): |
|
|
|
self._unit_dialog = None |
|
|
|
self._coinselect_dialog = None |
|
|
|
|
|
|
|
self.update() |
|
|
|
|
|
|
|
def update(self): |
|
|
|
self.wallet = self.app.wallet |
|
|
|
self.use_encryption = self.wallet.has_password() if self.wallet else False |
|
|
|