From db6779bf048bba6402c956b8a8be75cd6c7f4478 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 7 Jul 2023 20:48:29 +0200 Subject: [PATCH] qt: show send tab if payment identifier is passed on the cmdline --- electrum/gui/qt/__init__.py | 1 + run_electrum | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index 7891d1f21..f09af5368 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -393,6 +393,7 @@ class ElectrumGui(BaseElectrumGui, Logger): window.setWindowState(window.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive) window.activateWindow() if uri: + window.show_send_tab() window.send_tab.set_payment_identifier(uri) return window diff --git a/run_electrum b/run_electrum index 46aca8a67..413e7b4b8 100755 --- a/run_electrum +++ b/run_electrum @@ -365,12 +365,6 @@ def main(): if not config_options.get('verbosity'): warnings.simplefilter('ignore', DeprecationWarning) - # check if we received a valid payment identifier - uri = config_options.get('url') - if uri and not PaymentIdentifier(None, uri).is_valid(): - print_stderr('unknown command:', uri) - sys.exit(1) - config = SimpleConfig(config_options) cmdname = config.get('cmd') @@ -398,6 +392,12 @@ def main(): elif config.get('signet'): constants.set_signet() + # check if we received a valid payment identifier + uri = config_options.get('url') + if uri and not PaymentIdentifier(None, uri).is_valid(): + print_stderr('unknown command:', uri) + sys.exit(1) + if cmdname == 'daemon' and config.get("detach"): # detect lockfile. # This is not as good as get_file_descriptor, but that would require the asyncio loop