Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim
Commits: b3da8835 by lovetox at 2021-02-27T10:11:37+01:00 Windows: Open uris with webbrowser lib
Trying to work around #10455
- - - - -
1 changed file:
- gajim/common/helpers.py
Changes:
===================================== gajim/common/helpers.py ===================================== @@ -47,6 +47,7 @@ import weakref import inspect import string +import webbrowser from string import Template import urllib from urllib.parse import unquote @@ -1097,13 +1098,22 @@ def open_uri(uri, account=None): open_file(uri.data)
elif uri.type == URIType.TEL: - Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}') + if sys.platform == 'win32': + webbrowser.open(f'tel:{uri.data}') + else: + Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}')
elif uri.type == URIType.MAIL: - Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}') + if sys.platform == 'win32': + webbrowser.open(f'mailto:{uri.data}') + else: + Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}')
elif uri.type in (URIType.WEB, URIType.GEO): - Gio.AppInfo.launch_default_for_uri(uri.data) + if sys.platform == 'win32': + webbrowser.open(uri.data) + else: + Gio.AppInfo.launch_default_for_uri(uri.data)
elif uri.type == URIType.AT: app.interface.new_chat_from_jid(account, uri.data)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/b3da8835e231c4512bf46de7a41203a3f...