[kupfer: 4/67] desktop_launch: Permit overriding in-terminal setting



commit 1fb6ee38f8a94c01f1d61a000d33cef75af7f40a
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Mar 15 22:52:25 2011 +0100

    desktop_launch: Permit overriding in-terminal setting

 kupfer/desktop_launch.py |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/desktop_launch.py b/kupfer/desktop_launch.py
index b5d6a5a..9f9a520 100644
--- a/kupfer/desktop_launch.py
+++ b/kupfer/desktop_launch.py
@@ -225,7 +225,12 @@ def _file_and_info_for_app_info(app_info):
 			error_log("Read error:", exc)
 	return desktop_file, desktop_info
 
-def launch_app_info(app_info, gfiles=[]):
+def launch_app_info(app_info, gfiles=[], in_terminal=None):
+	"""
+	Launch @app_info, opening @gfiles
+
+	@in_terminal: override Terminal flag
+	"""
 	desktop_file, desktop_info = _file_and_info_for_app_info(app_info)
 	if not desktop_file or not desktop_info:
 		# Allow in-memory app_info creations (without id or desktop file)
@@ -262,11 +267,10 @@ def launch_app_info(app_info, gfiles=[]):
 	notify = desktop_info["StartupNotify"]
 	workdir = desktop_info["Path"] or None
 
-	if desktop_info["Terminal"]:
-		in_terminal = True
+	if in_terminal is None:
+		in_terminal = desktop_info["Terminal"]
+	if in_terminal:
 		notify = notify or TERM_STARTUPNOTIFY
-	else:
-		in_terminal = False
 
 	for argv, gfiles in launch_records:
 		if in_terminal:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]