Philipp Hörist pushed to branch master at gajim / gajim
Commits: 36044900 by André Apitzsch at 2020-08-26T22:43:20+02:00 Helpers: Drop webbrowser
Gio.AppInfo on Windows supports web and mail types
- - - - - 0aba0f32 by André Apitzsch at 2020-08-26T22:43:20+02:00 Use system map application to open geo links if available
- - - - -
1 changed file:
- gajim/common/helpers.py
Changes:
===================================== gajim/common/helpers.py ===================================== @@ -32,7 +32,6 @@ import sys import re import os import subprocess -import webbrowser import base64 import hashlib import shlex @@ -1101,6 +1100,9 @@ def parse_uri(uri): if not lon: return URI(type=URIType.UNKNOWN, data=uri)
+ if Gio.AppInfo.get_default_for_uri_scheme('geo'): + return URI(type=URIType.GEO, data=uri) + uri = geo_provider_from_location(lat, lon) return URI(type=URIType.GEO, data=uri)
@@ -1119,17 +1121,10 @@ def open_uri(uri, account=None): open_file(uri.data)
elif uri.type == URIType.MAIL: - uri = 'mailto:%s' % uri.data - if os.name == 'nt': - webbrowser.open(uri) - else: - Gio.AppInfo.launch_default_for_uri(uri) + Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}')
elif uri.type in (URIType.WEB, URIType.GEO): - if os.name == 'nt': - webbrowser.open(uri.data) - else: - Gio.AppInfo.launch_default_for_uri(uri.data) + 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/-/compare/4934434a97da6e42b51a90de891cff3a...