[kupfer: 26/51] applications: Port OpenWith to use wants_context



commit b97ae0112b3a47f91875f6ed932ad1c0051fe919
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Mar 28 16:51:45 2011 +0200

    applications: Port OpenWith to use wants_context

 kupfer/plugin/applications.py |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/kupfer/plugin/applications.py b/kupfer/plugin/applications.py
index d71dbd2..0543211 100644
--- a/kupfer/plugin/applications.py
+++ b/kupfer/plugin/applications.py
@@ -69,14 +69,18 @@ class OpenWith (Action):
 	def __init__(self):
 		Action.__init__(self, _("Open With..."))
 
-	def _activate(self, app_leaf, paths):
-		app_leaf.launch(paths=paths)
-	def activate(self, leaf, iobj):
-		self._activate(iobj, (leaf.object, ))
-	def activate_multiple(self, objects, iobjects):
+	def _activate(self, app_leaf, paths, ctx):
+		app_leaf.launch(paths=paths, ctx=ctx)
+
+	def wants_context(self):
+		return True
+
+	def activate(self, leaf, iobj, ctx):
+		self._activate(iobj, (leaf.object, ), ctx)
+	def activate_multiple(self, objects, iobjects, ctx):
 		# for each application, launch all the files
 		for iobj_app in iobjects:
-			self._activate(iobj_app, [L.object for L in objects])
+			self._activate(iobj_app, [L.object for L in objects], ctx)
 
 	def item_types(self):
 		yield FileLeaf



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