[pitivi] Use a high-level API to open URLs
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Use a high-level API to open URLs
- Date: Thu, 6 Oct 2016 09:58:01 +0000 (UTC)
commit c3fadbf55b4aa148ba2627263c57066ba0bed11d
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Oct 4 15:34:08 2016 +0200
Use a high-level API to open URLs
This allows using portals when running in a sandbox.
Fixes https://phabricator.freedesktop.org/T7491
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1346
pitivi/mainwindow.py | 3 +--
pitivi/render.py | 5 +++--
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 3c2cb74..72048e7 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -17,7 +17,6 @@
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
import os
-import subprocess
from gettext import gettext as _
from hashlib import md5
from time import time
@@ -530,7 +529,7 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
# to do a better job (sizing, zooming, metadata, editing, etc.)
# than the user's favorite image viewer.
if asset.is_image():
- subprocess.call(['xdg-open', str(path_from_uri(asset.get_id()))])
+ Gio.AppInfo.launch_default_for_uri(asset.get_id(), None)
else:
preview_window = PreviewAssetWindow(asset, self)
preview_window.preview()
diff --git a/pitivi/render.py b/pitivi/render.py
index e080a59..6dee2b9 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -18,11 +18,11 @@
# Boston, MA 02110-1301, USA.
"""Rendering-related classes and utilities."""
import os
-import subprocess
import time
from gettext import gettext as _
from gi.repository import GES
+from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gst
@@ -366,7 +366,8 @@ class RenderingProgressDialog(GObject.Object):
self.main_render_dialog.window.show()
def _playRenderedFileButtonClickedCb(self, unused_button):
- subprocess.Popen(["xdg-open", self.main_render_dialog.outfile])
+ uri = Gst.filename_to_uri(self.main_render_dialog.outfile)
+ Gio.AppInfo.launch_default_for_uri(uri, None)
class RenderDialog(Loggable):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]