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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user