From 8592fd24d764cbd92c97881371c1dd9bd853af60 Mon Sep 17 00:00:00 2001 From: davide3011 Date: Thu, 19 Feb 2026 09:09:51 +0100 Subject: [PATCH] qt: fix whitepaper URL and use xdg-open for web links on Linux - update whitepaper URL to github.com/palladium-coin/whitepaper - replace webbrowser.open() with xdg-open on Linux to ensure the desktop browser is used instead of text-based alternatives (w3m) --- electrum/gui/qt/main_window.py | 2 +- electrum/gui/qt/util.py | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 04b6b4b0c..7a98959eb 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -845,7 +845,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): self.help_menu.addSeparator() self.help_menu.addAction(_("&Documentation"), lambda: webopen("https://github.com/palladium-coin/pallectrum/blob/main/user-guide.md")).setShortcut(QKeySequence.StandardKey.HelpContents) if not constants.net.TESTNET: - self.help_menu.addAction(_("&White Paper"), lambda: webopen("https://github.com/palladium-coin/palladiumcore/blob/master/assets/whitepaper/(original)whitepaper.pdf")) + self.help_menu.addAction(_("&White Paper"), lambda: webopen("https://github.com/palladium-coin/whitepaper/blob/main/whitepaper.pdf")) self.help_menu.addAction(_("&Report Bug"), self.show_report_bug) self.help_menu.addSeparator() self.help_menu.addAction(_("&Donate to server"), self.donate_to_server) diff --git a/electrum/gui/qt/util.py b/electrum/gui/qt/util.py index 007c687fc..fe686bdfc 100644 --- a/electrum/gui/qt/util.py +++ b/electrum/gui/qt/util.py @@ -1337,14 +1337,17 @@ def font_height(widget: QWidget = None) -> int: def webopen(url: str): - if sys.platform == 'linux' and os.environ.get('APPIMAGE'): - # When on Linux webbrowser.open can fail in AppImage because it can't find the correct libdbus. - # We just fork the process and unset LD_LIBRARY_PATH before opening the URL. - # See #5425 - if os.fork() == 0: - del os.environ['LD_LIBRARY_PATH'] - webbrowser.open(url) - os._exit(0) + if sys.platform == 'linux': + if os.environ.get('APPIMAGE'): + # When on Linux webbrowser.open can fail in AppImage because it can't find the correct libdbus. + # We just fork the process and unset LD_LIBRARY_PATH before opening the URL. + # See #5425 + if os.fork() == 0: + del os.environ['LD_LIBRARY_PATH'] + os.system(f'xdg-open "{url}" &') + os._exit(0) + else: + os.system(f'xdg-open "{url}" &') else: webbrowser.open(url)