[kupfer: 21/38] applications: Adjust "Open With..." action for multiple dispatch



commit 1171ddd9aa2901df6928e3e0b202c66c1c31df1d
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Fri Jan 15 18:29:43 2010 +0100

    applications: Adjust "Open With..." action for multiple dispatch

 kupfer/plugin/applications.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/plugin/applications.py b/kupfer/plugin/applications.py
index c902f89..bf20bd5 100644
--- a/kupfer/plugin/applications.py
+++ b/kupfer/plugin/applications.py
@@ -66,9 +66,17 @@ class AppSource (Source, FilesystemWatchMixin):
 class OpenWith (Action):
 	def __init__(self):
 		Action.__init__(self, _("Open With..."))
+
+	def _activate(self, desktop_item, paths):
+		utils.launch_app(desktop_item, paths=paths)
 	def activate(self, leaf, obj):
 		desktop_item = obj.object
-		utils.launch_app(desktop_item, paths=(leaf.object,))
+		self._activate(desktop_item, (leaf.object, ))
+	def activate_multiple(self, objects, iobjects):
+		# for each application, launch all the files
+		for iobj_app in iobjects:
+			self._activate(iobj_app.object, [L.object for L in objects])
+
 	def item_types(self):
 		yield FileLeaf
 	def requires_object(self):



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