churchyard pushed to cura-lulzbot (master). "Patch: Open directories with xdg-open (#1217961)"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri May 29 09:18:29 UTC 2015


From e5e577e7d4f77ed1c2869855667236abf3da40c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro at hroncok.cz>
Date: Fri, 29 May 2015 11:18:10 +0200
Subject: Patch: Open directories with xdg-open (#1217961)


diff --git a/cura-lulzbot-xdg-open.patch b/cura-lulzbot-xdg-open.patch
new file mode 100644
index 0000000..6b0dbf0
--- /dev/null
+++ b/cura-lulzbot-xdg-open.patch
@@ -0,0 +1,50 @@
+From b18336db6e109d381d1e265475adb85c8ba82357 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro at hroncok.cz>
+Date: Fri, 29 May 2015 10:28:17 +0200
+Subject: [PATCH] Replace direct calls to Nautilus and Dolphin with xdg-open
+
+This will still work in GNOME and KDE, but will also enable
+the functions for other Linux desktop environments, such as Xfce or MATE
+---
+ Cura/util/explorer.py | 16 +++++-----------
+ 1 file changed, 5 insertions(+), 11 deletions(-)
+
+diff --git a/Cura/util/explorer.py b/Cura/util/explorer.py
+index 1e2a5a0..8726c56 100644
+--- a/Cura/util/explorer.py
++++ b/Cura/util/explorer.py
+@@ -13,9 +13,7 @@ def hasExplorer():
+ 	if sys.platform == 'win32' or sys.platform == 'cygwin' or sys.platform == 'darwin':
+ 		return True
+ 	if sys.platform == 'linux2':
+-		if os.path.isfile('/usr/bin/nautilus'):
+-			return True
+-		if os.path.isfile('/usr/bin/dolphin'):
++		if os.path.isfile('/usr/bin/xdg-open'):
+ 			return True
+ 	return False
+ 
+@@ -27,10 +25,8 @@ def openExplorer(filename):
+ 		subprocess.Popen(['open', '-R', filename])
+ 	if sys.platform.startswith('linux'):
+ 		#TODO: On linux we cannot seem to select a certain file, only open the specified path.
+-		if os.path.isfile('/usr/bin/nautilus'):
+-			subprocess.Popen(['/usr/bin/nautilus', os.path.split(filename)[0]])
+-		elif os.path.isfile('/usr/bin/dolphin'):
+-			subprocess.Popen(['/usr/bin/dolphin', os.path.split(filename)[0]])
++		if os.path.isfile('/usr/bin/xdg-open'):
++			subprocess.Popen(['/usr/bin/xdg-open', os.path.split(filename)[0]])
+ 
+ def openExplorerPath(filename):
+ 	"""Open a file dialog inside a directory, without selecting any file."""
+@@ -39,8 +35,6 @@ def openExplorerPath(filename):
+ 	if sys.platform == 'darwin':
+ 		subprocess.Popen(['open', filename])
+ 	if sys.platform.startswith('linux'):
+-		if os.path.isfile('/usr/bin/nautilus'):
+-			subprocess.Popen(['/usr/bin/nautilus', filename])
+-		elif os.path.isfile('/usr/bin/dolphin'):
+-			subprocess.Popen(['/usr/bin/dolphin', filename])
++		if os.path.isfile('/usr/bin/xdg-open'):
++			subprocess.Popen(['/usr/bin/xdg-open', filename])
+ 
diff --git a/cura-lulzbot.spec b/cura-lulzbot.spec
index 2f987b1..a39d9bc 100644
--- a/cura-lulzbot.spec
+++ b/cura-lulzbot.spec
@@ -1,6 +1,6 @@
 Name:           cura-lulzbot
 Version:        14.12
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Cura LulzBot Edition, 3D printer control software
 
 # Code is AGPLv3
@@ -22,6 +22,10 @@ Patch2:         %{name}-version.patch
 # Disable installation of firmwares Fedora doesn't ship
 Patch3:         %{name}-no-firmware.patch
 
+# Open directories with xdg-open
+# https://bugzilla.redhat.com/show_bug.cgi?id=1217961
+Patch4:         %{name}-xdg-open.patch
+
 BuildArch:      noarch
 BuildRequires:  python2-devel
 BuildRequires:  dos2unix
@@ -47,6 +51,7 @@ the operation of your LulzBot 3D printer.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 dos2unix resources/example/Attribution.txt
 
@@ -115,6 +120,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
 %{_bindir}/%{name}
 
 %changelog
+* Fri May 29 2015 Miro Hrončok <mhroncok at redhat.com> - 14.12-5
+- Patch: Open directories with xdg-open (#1217961)
+
 * Mon Apr 20 2015 Miro Hrončok <mhroncok at redhat.com> - 14.12-4
 - Handle files from the command line (#1213220)
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/cura-lulzbot.git/commit/?h=master&id=e5e577e7d4f77ed1c2869855667236abf3da40c4


More information about the scm-commits mailing list