kivy: settings dialog: call update() from __init__
this is a clearer/easier-to-understand API
This commit is contained in:
@@ -723,7 +723,8 @@ class ElectrumWindow(App, Logger):
|
|||||||
from .uix.dialogs.settings import SettingsDialog
|
from .uix.dialogs.settings import SettingsDialog
|
||||||
if self._settings_dialog is None:
|
if self._settings_dialog is None:
|
||||||
self._settings_dialog = SettingsDialog(self)
|
self._settings_dialog = SettingsDialog(self)
|
||||||
self._settings_dialog.update()
|
else:
|
||||||
|
self._settings_dialog.update()
|
||||||
self._settings_dialog.open()
|
self._settings_dialog.open()
|
||||||
|
|
||||||
def lightning_open_channel_dialog(self):
|
def lightning_open_channel_dialog(self):
|
||||||
@@ -1183,7 +1184,8 @@ class ElectrumWindow(App, Logger):
|
|||||||
from .uix.dialogs.addresses import AddressesDialog
|
from .uix.dialogs.addresses import AddressesDialog
|
||||||
if self._addresses_dialog is None:
|
if self._addresses_dialog is None:
|
||||||
self._addresses_dialog = AddressesDialog(self)
|
self._addresses_dialog = AddressesDialog(self)
|
||||||
self._addresses_dialog.update()
|
else:
|
||||||
|
self._addresses_dialog.update()
|
||||||
self._addresses_dialog.open()
|
self._addresses_dialog.open()
|
||||||
|
|
||||||
def fee_dialog(self):
|
def fee_dialog(self):
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ class AddressesDialog(Factory.Popup):
|
|||||||
def __init__(self, app: 'ElectrumWindow'):
|
def __init__(self, app: 'ElectrumWindow'):
|
||||||
Factory.Popup.__init__(self)
|
Factory.Popup.__init__(self)
|
||||||
self.app = app
|
self.app = app
|
||||||
|
self.update()
|
||||||
|
|
||||||
def get_card(self, addr, balance, is_used, label):
|
def get_card(self, addr, balance, is_used, label):
|
||||||
ci = {}
|
ci = {}
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ class SettingsDialog(Factory.Popup):
|
|||||||
self._unit_dialog = None
|
self._unit_dialog = None
|
||||||
self._coinselect_dialog = None
|
self._coinselect_dialog = None
|
||||||
|
|
||||||
|
self.update()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
self.wallet = self.app.wallet
|
self.wallet = self.app.wallet
|
||||||
self.use_encryption = self.wallet.has_password() if self.wallet else False
|
self.use_encryption = self.wallet.has_password() if self.wallet else False
|
||||||
|
|||||||
Reference in New Issue
Block a user