Commit b3f938e2 authored by Philipp Hörist's avatar Philipp Hörist

Remove custom `open with` application settings

Feature bloat. There is no good use case why the system defaults should not be sufficient.
parent 491dad09
Pipeline #4463 passed with stages
in 2 minutes and 46 seconds
......@@ -64,10 +64,6 @@ class Config:
DEFAULT_ICONSET = 'dcraven'
DEFAULT_MOOD_ICONSET = 'default'
DEFAULT_ACTIVITY_ICONSET = 'default'
DEFAULT_OPENWITH = 'xdg-open'
DEFAULT_BROWSER = 'firefox'
DEFAULT_MAILAPP = 'mozilla-thunderbird -compose'
DEFAULT_FILE_MANAGER = 'xffm'
__options = ({
# name: [ type, default_value, help_string ]
......@@ -121,10 +117,6 @@ class Config:
'sounds_on': [opt_bool, True],
# 'aplay', 'play', 'esdplay', 'artsplay' detected first time only
'soundplayer': [opt_str, ''],
'openwith': [opt_str, DEFAULT_OPENWITH],
'custombrowser': [opt_str, DEFAULT_BROWSER],
'custommailapp': [opt_str, DEFAULT_MAILAPP],
'custom_file_manager': [opt_str, DEFAULT_FILE_MANAGER],
'gc_refer_to_nick_char': [opt_str, ',', _('Character to add after nickname when using nickname completion (tab) in group chat.')],
'gc_proposed_nick_char': [opt_str, '_', _('Character to propose to add after desired nickname when nickname is already used in group chat.')],
'msgwin-max-state': [opt_bool, False],
......@@ -176,7 +168,6 @@ class Config:
'always_english_wikipedia': [opt_bool, False],
'always_english_wiktionary': [opt_bool, True],
'remote_control': [opt_bool, False, _('If checked, Gajim can be controlled remotely using gajim-remote.'), True],
'autodetect_browser_mailer': [opt_bool, True, '', True],
'print_ichat_every_foo_minutes': [opt_int, 5, _('When not printing time for every message (\'print_time\'==sometimes), print it every x minutes.')],
'confirm_paste_image': [opt_bool, True, _('Ask before pasting an image.')],
'confirm_close_muc': [opt_bool, True, _('Ask before closing a group chat tab/window.')],
......
......@@ -625,13 +625,7 @@ def launch_file_manager(path_to_open):
except Exception:
pass
else:
if not app.config.get('autodetect_browser_mailer'):
command = app.config.get('custom_file_manager')
if command == '': # if no app is configured
return
else:
command = 'xdg-open'
command = build_command(command, path_to_open)
command = build_command('xdg-open', path_to_open)
try:
exec_command(command)
except Exception:
......@@ -1547,16 +1541,10 @@ def open_uri(uri, account=None):
elif uri.type == URIType.MAIL:
uri = 'mailto:%s' % uri.data
if not app.config.get('autodetect_browser_mailer'):
open_uri_with_custom('custommailapp', 'mailto:%s' % uri)
else:
webbrowser.open(uri)
webbrowser.open(uri)
elif uri.type in (URIType.WEB, URIType.GEO):
if not app.config.get('autodetect_browser_mailer'):
open_uri_with_custom('custombrowser', uri.data)
else:
webbrowser.open(uri.data)
webbrowser.open(uri.data)
elif uri.type == URIType.AT:
app.interface.new_chat_from_jid(account, uri.data)
......@@ -1580,18 +1568,6 @@ def open_uri(uri, account=None):
log.warning('Cant open URI: %s', uri)
def open_uri_with_custom(config_app, uri):
command = app.config.get(config_app)
if not command:
log.warning('No custom application set')
return
command = build_command(command, uri)
try:
exec_command(command)
except Exception:
pass
def geo_provider_from_location(lat, lon):
return ('https://www.openstreetmap.org/?'
'mlat=%s&mlon=%s&zoom=16') % (lat, lon)
......
This diff is collapsed.
......@@ -12,7 +12,6 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import os
import logging
from gi.repository import Gtk
......@@ -468,26 +467,6 @@ class Preferences(Gtk.ApplicationWindow):
self._ui.stun_server_entry.set_sensitive(False)
### Advanced tab ###
## Applications (open links with)
if os.name == 'nt':
self._ui.custom_apps_frame.set_no_show_all(True)
self._ui.custom_apps_frame.hide()
else:
self._ui.custom_apps_frame.hide()
self._ui.custom_apps_frame.set_no_show_all(True)
if app.config.get('autodetect_browser_mailer'):
self._ui.applications_combobox.set_active(0)
else:
self._ui.applications_combobox.set_active(1)
self._ui.custom_apps_frame.show()
self._ui.custom_browser_entry.set_text(
app.config.get('custombrowser'))
self._ui.custom_mail_client_entry.set_text(
app.config.get('custommailapp'))
self._ui.custom_file_manager_entry.set_text(
app.config.get('custom_file_manager'))
## Miscellaneous
# Proxy
......@@ -1060,24 +1039,6 @@ class Preferences(Gtk.ApplicationWindow):
app.config.set('stun_server', widget.get_text())
### Advanced tab ###
# Applications
def on_applications_combobox_changed(self, widget):
if widget.get_active() == 0:
app.config.set('autodetect_browser_mailer', True)
self._ui.custom_apps_frame.hide()
elif widget.get_active() == 1:
app.config.set('autodetect_browser_mailer', False)
self._ui.custom_apps_frame.show()
def on_custom_browser_entry_changed(self, widget):
app.config.set('custombrowser', widget.get_text())
def on_custom_mail_client_entry_changed(self, widget):
app.config.set('custommailapp', widget.get_text())
def on_custom_file_manager_entry_changed(self, widget):
app.config.set('custom_file_manager', widget.get_text())
# Proxies
def on_proxies_combobox_changed(self, widget):
active = widget.get_active()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment