1
0

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
This commit is contained in:
SomberNight
2023-02-06 17:55:56 +00:00
parent 7adc8b1fbb
commit d3a10c4225

View File

@@ -305,9 +305,12 @@ class CommandsServer(AuthenticatedServer):
return True
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 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'))
response = "ok"
else: