[preview] Adapt to Gajim changes

- Open files with open_file()
This commit is contained in:
Philipp Hörist
2019-11-09 10:50:01 +01:00
parent 28e83510d5
commit 2517c0e849

View File

@@ -35,6 +35,8 @@ from gi.repository import GdkPixbuf
from gajim.common import app from gajim.common import app
from gajim.common import helpers 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_uri
from gajim.gtkgui_helpers import add_css_to_widget from gajim.gtkgui_helpers import add_css_to_widget
from gajim.gtk.dialogs import ErrorDialog from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.filechoosers import FileSaveDialog from gajim.gtk.filechoosers import FileSaveDialog
@@ -650,9 +652,9 @@ class Base:
original_filename = data['original_filename'] original_filename = data['original_filename']
url = data['url'] url = data['url']
if original_filename.startswith('location_'): if original_filename.startswith('location_'):
helpers.open_uri(url) open_uri(url)
return return
helpers.launch_file_manager(filepath) open_file(filepath)
def _on_save_as_menuitem_activate(self, menu, data): def _on_save_as_menuitem_activate(self, menu, data):
filepath = data['filepath'] filepath = data['filepath']
@@ -675,7 +677,7 @@ class Base:
transient_for=app.app.get_active_window()) transient_for=app.app.get_active_window())
def _on_open_folder_menuitem_activate(self, menu, data): def _on_open_folder_menuitem_activate(self, menu, data):
helpers.launch_file_manager(self.directory) open_file(self.directory)
def _on_copy_link_location_menuitem_activate(self, menu, data): def _on_copy_link_location_menuitem_activate(self, menu, data):
url = data['url'] url = data['url']
@@ -688,7 +690,7 @@ class Base:
if data['encrypted']: if data['encrypted']:
self._on_open_menuitem_activate(self, data) self._on_open_menuitem_activate(self, data)
else: else:
helpers.open_uri(url) open_uri(url)
def _on_open_file_in_browser_menuitem_activate(self, menu, data): def _on_open_file_in_browser_menuitem_activate(self, menu, data):
if os.name == 'nt': if os.name == 'nt':