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)
This commit is contained in:
2026-02-19 09:09:51 +01:00
parent a90475a98e
commit 8592fd24d7
2 changed files with 12 additions and 9 deletions

View File

@@ -845,7 +845,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
self.help_menu.addSeparator() 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) 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: 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.addAction(_("&Report Bug"), self.show_report_bug)
self.help_menu.addSeparator() self.help_menu.addSeparator()
self.help_menu.addAction(_("&Donate to server"), self.donate_to_server) self.help_menu.addAction(_("&Donate to server"), self.donate_to_server)

View File

@@ -1337,14 +1337,17 @@ def font_height(widget: QWidget = None) -> int:
def webopen(url: str): def webopen(url: str):
if sys.platform == 'linux' and os.environ.get('APPIMAGE'): if sys.platform == 'linux':
# When on Linux webbrowser.open can fail in AppImage because it can't find the correct libdbus. if os.environ.get('APPIMAGE'):
# We just fork the process and unset LD_LIBRARY_PATH before opening the URL. # When on Linux webbrowser.open can fail in AppImage because it can't find the correct libdbus.
# See #5425 # We just fork the process and unset LD_LIBRARY_PATH before opening the URL.
if os.fork() == 0: # See #5425
del os.environ['LD_LIBRARY_PATH'] if os.fork() == 0:
webbrowser.open(url) del os.environ['LD_LIBRARY_PATH']
os._exit(0) os.system(f'xdg-open "{url}" &')
os._exit(0)
else:
os.system(f'xdg-open "{url}" &')
else: else:
webbrowser.open(url) webbrowser.open(url)