Commit 206c2812 authored by André's avatar André

[preview] Remove reference to unavailable setting

parent 41054309
......@@ -44,8 +44,7 @@ class UrlImagePreviewConfigDialog(SettingsDialog):
('save_as_menuitem', _('Save as')),
('open_folder_menuitem', _('Open Folder')),
('copy_link_location_menuitem', _('Copy Link Location')),
('open_link_in_browser_menuitem', _('Open Link in Browser')),
('open_file_in_browser_menuitem', _('Open File in Browser'))]
('open_link_in_browser_menuitem', _('Open Link in Browser'))]
geo_providers = [
('no_preview', _('No map preview')),
......
......@@ -50,19 +50,5 @@
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="extras_separator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="open_file_in_browser_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Open _Downloaded File in Browser</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</interface>
[info]
name: Url image preview
short_name: url_image_preview
version: 2.3.38
version: 2.3.39
description: Displays a preview of links to images
authors = Denis Fomin <fominde@gmail.com>
Yann Leboulanger <asterix@lagaule.org>
......
......@@ -33,7 +33,6 @@ from gi.repository import GLib
from gi.repository import GdkPixbuf
from gajim.common import app
from gajim.common import helpers
from gajim.common import configpaths
from gajim.common.helpers import open_file
from gajim.common.helpers import open_uri
......@@ -615,16 +614,9 @@ class Base:
'copy_link_location_menuitem')
open_link_in_browser_menuitem = xml.get_object(
'open_link_in_browser_menuitem')
open_file_in_browser_menuitem = xml.get_object(
'open_file_in_browser_menuitem')
extras_separator = xml.get_object('extras_separator')
if data['encrypted']:
open_link_in_browser_menuitem.hide()
if app.config.get('autodetect_browser_mailer') \
or app.config.get('custombrowser') == '':
extras_separator.hide()
open_file_in_browser_menuitem.hide()
id_ = open_menuitem.connect(
'activate', self._on_open_menuitem_activate, data)
......@@ -641,9 +633,6 @@ class Base:
id_ = open_link_in_browser_menuitem.connect(
'activate', self._on_open_link_in_browser_menuitem_activate, data)
self.handlers[id_] = open_link_in_browser_menuitem
id_ = open_file_in_browser_menuitem.connect(
'activate', self._on_open_file_in_browser_menuitem_activate, data)
self.handlers[id_] = open_file_in_browser_menuitem
return menu
......@@ -692,26 +681,6 @@ class Base:
else:
open_uri(url)
def _on_open_file_in_browser_menuitem_activate(self, menu, data):
if os.name == 'nt':
filepath = 'file://' + os.path.abspath(data['filepath'])
else:
filepath = 'file://' + data['filepath']
if app.config.get('autodetect_browser_mailer') \
or app.config.get('custombrowser') == '':
ErrorDialog(
_('Cannot open downloaded file in browser'),
_('You have to set a custom browser executable '
'in Gajim\'s Preferences for this to work.'),
transient_for=app.app.get_active_window())
return
command = app.config.get('custombrowser')
command = helpers.build_command(command, filepath)
try:
helpers.exec_command(command)
except Exception:
pass
def _on_button_press_event(self, eb, event, filepath, original_filename,
url, encrypted):
data = {'filepath': filepath,
......
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