Browse Source

commands: allow cmd to launch new gui window for wallet

e.g. imagine electrum Qt gui is already running, with some wallet (wallet_1) open,
running `$ ./run_electrum --testnet -w ~/.electrum/testnet/wallets/wallet_2` should
open a new window, for wallet_2.

related https://github.com/spesmilo/electrum/issues/8188#issuecomment-1419444675
master
SomberNight 3 years ago
parent
commit
d3a10c4225
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/daemon.py

5
electrum/daemon.py

@ -305,9 +305,12 @@ class CommandsServer(AuthenticatedServer):
return True return True
async def gui(self, config_options): async def gui(self, config_options):
# note: "config_options" is coming from the short-lived CLI-invocation,
# while self.config is the config of the long-lived daemon process.
# "config_options" should have priority.
if self.daemon.gui_object: if self.daemon.gui_object:
if hasattr(self.daemon.gui_object, 'new_window'): if hasattr(self.daemon.gui_object, 'new_window'):
path = self.config.get_wallet_path(use_gui_last_wallet=True) path = config_options.get('wallet_path') or self.config.get_wallet_path(use_gui_last_wallet=True)
self.daemon.gui_object.new_window(path, config_options.get('url')) self.daemon.gui_object.new_window(path, config_options.get('url'))
response = "ok" response = "ok"
else: else:

Loading…
Cancel
Save