1
0

kivy: settings dialog: call update() from __init__

this is a clearer/easier-to-understand API
This commit is contained in:
SomberNight
2021-06-11 14:51:09 +02:00
parent ad06398e4e
commit 325cd950a4
3 changed files with 7 additions and 2 deletions

View File

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

View File

@@ -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 = {}

View File

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