mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
kivy: open last wallet
This commit is contained in:
parent
d3d0e3bacb
commit
80b1b2716c
3 changed files with 16 additions and 9 deletions
|
@ -50,8 +50,10 @@ class ElectrumGui:
|
||||||
self.plugins = plugins
|
self.plugins = plugins
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
|
self.config.open_last_wallet()
|
||||||
w = ElectrumWindow(config=self.config,
|
w = ElectrumWindow(config=self.config,
|
||||||
network=self.network,
|
network=self.network,
|
||||||
plugins = self.plugins,
|
plugins = self.plugins,
|
||||||
gui_object=self)
|
gui_object=self)
|
||||||
w.run()
|
w.run()
|
||||||
|
self.config.save_last_wallet(w.wallet)
|
||||||
|
|
|
@ -174,19 +174,13 @@ class ElectrumGui:
|
||||||
self.windows.remove(window)
|
self.windows.remove(window)
|
||||||
self.build_tray_menu()
|
self.build_tray_menu()
|
||||||
# save wallet path of last open window
|
# save wallet path of last open window
|
||||||
if self.config.get('wallet_path') is None and not self.windows:
|
if not self.windows:
|
||||||
path = window.wallet.storage.path
|
self.config.save_last_wallet(window.wallet)
|
||||||
self.config.set_key('gui_last_wallet', path)
|
|
||||||
run_hook('on_close_window', window)
|
run_hook('on_close_window', window)
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
# open last wallet
|
self.config.open_last_wallet()
|
||||||
if self.config.get('wallet_path') is None:
|
|
||||||
last_wallet = self.config.get('gui_last_wallet')
|
|
||||||
if last_wallet is not None and os.path.exists(last_wallet):
|
|
||||||
self.config.cmdline_options['default_wallet_path'] = last_wallet
|
|
||||||
|
|
||||||
if not self.start_new_window(self.config.get_wallet_path(),
|
if not self.start_new_window(self.config.get_wallet_path(),
|
||||||
self.config.get('url')):
|
self.config.get('url')):
|
||||||
return
|
return
|
||||||
|
|
|
@ -174,6 +174,17 @@ class SimpleConfig(PrintError):
|
||||||
def get_session_timeout(self):
|
def get_session_timeout(self):
|
||||||
return self.get('session_timeout', 300)
|
return self.get('session_timeout', 300)
|
||||||
|
|
||||||
|
def open_last_wallet(self):
|
||||||
|
if self.get('wallet_path') is None:
|
||||||
|
last_wallet = self.get('gui_last_wallet')
|
||||||
|
if last_wallet is not None and os.path.exists(last_wallet):
|
||||||
|
self.cmdline_options['default_wallet_path'] = last_wallet
|
||||||
|
|
||||||
|
def save_last_wallet(self, wallet):
|
||||||
|
if self.get('wallet_path') is None:
|
||||||
|
path = wallet.storage.path
|
||||||
|
self.set_key('gui_last_wallet', path)
|
||||||
|
|
||||||
|
|
||||||
def read_system_config(path=SYSTEM_CONFIG_PATH):
|
def read_system_config(path=SYSTEM_CONFIG_PATH):
|
||||||
"""Parse and return the system config settings in /etc/electrum.conf."""
|
"""Parse and return the system config settings in /etc/electrum.conf."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue