[preview] Remove reference to unavailable setting
This commit is contained in:
@@ -44,8 +44,7 @@ class UrlImagePreviewConfigDialog(SettingsDialog):
|
|||||||
('save_as_menuitem', _('Save as')),
|
('save_as_menuitem', _('Save as')),
|
||||||
('open_folder_menuitem', _('Open Folder')),
|
('open_folder_menuitem', _('Open Folder')),
|
||||||
('copy_link_location_menuitem', _('Copy Link Location')),
|
('copy_link_location_menuitem', _('Copy Link Location')),
|
||||||
('open_link_in_browser_menuitem', _('Open Link in Browser')),
|
('open_link_in_browser_menuitem', _('Open Link in Browser'))]
|
||||||
('open_file_in_browser_menuitem', _('Open File in Browser'))]
|
|
||||||
|
|
||||||
geo_providers = [
|
geo_providers = [
|
||||||
('no_preview', _('No map preview')),
|
('no_preview', _('No map preview')),
|
||||||
|
|||||||
@@ -50,19 +50,5 @@
|
|||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</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>
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[info]
|
[info]
|
||||||
name: Url image preview
|
name: Url image preview
|
||||||
short_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
|
description: Displays a preview of links to images
|
||||||
authors = Denis Fomin <fominde@gmail.com>
|
authors = Denis Fomin <fominde@gmail.com>
|
||||||
Yann Leboulanger <asterix@lagaule.org>
|
Yann Leboulanger <asterix@lagaule.org>
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ from gi.repository import GLib
|
|||||||
from gi.repository import GdkPixbuf
|
from gi.repository import GdkPixbuf
|
||||||
|
|
||||||
from gajim.common import app
|
from gajim.common import app
|
||||||
from gajim.common import helpers
|
|
||||||
from gajim.common import configpaths
|
from gajim.common import configpaths
|
||||||
from gajim.common.helpers import open_file
|
from gajim.common.helpers import open_file
|
||||||
from gajim.common.helpers import open_uri
|
from gajim.common.helpers import open_uri
|
||||||
@@ -615,16 +614,9 @@ class Base:
|
|||||||
'copy_link_location_menuitem')
|
'copy_link_location_menuitem')
|
||||||
open_link_in_browser_menuitem = xml.get_object(
|
open_link_in_browser_menuitem = xml.get_object(
|
||||||
'open_link_in_browser_menuitem')
|
'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']:
|
if data['encrypted']:
|
||||||
open_link_in_browser_menuitem.hide()
|
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(
|
id_ = open_menuitem.connect(
|
||||||
'activate', self._on_open_menuitem_activate, data)
|
'activate', self._on_open_menuitem_activate, data)
|
||||||
@@ -641,9 +633,6 @@ class Base:
|
|||||||
id_ = open_link_in_browser_menuitem.connect(
|
id_ = open_link_in_browser_menuitem.connect(
|
||||||
'activate', self._on_open_link_in_browser_menuitem_activate, data)
|
'activate', self._on_open_link_in_browser_menuitem_activate, data)
|
||||||
self.handlers[id_] = open_link_in_browser_menuitem
|
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
|
return menu
|
||||||
|
|
||||||
@@ -692,26 +681,6 @@ class Base:
|
|||||||
else:
|
else:
|
||||||
open_uri(url)
|
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,
|
def _on_button_press_event(self, eb, event, filepath, original_filename,
|
||||||
url, encrypted):
|
url, encrypted):
|
||||||
data = {'filepath': filepath,
|
data = {'filepath': filepath,
|
||||||
|
|||||||
Reference in New Issue
Block a user