[kupfer] tracker: Port Search in Tracker to tracker 0.8



commit 542024ec2649f1e54e645c8841617a27746646c2
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat May 29 16:00:06 2010 +0200

    tracker: Port Search in Tracker to tracker 0.8
    
    Passing queries is now supported by later versions of 0.8.x
    tracker-search-tool.

 kupfer/plugin/tracker.py  |    7 +++----
 kupfer/plugin/tracker1.py |   18 +++++++++++++++---
 2 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/kupfer/plugin/tracker.py b/kupfer/plugin/tracker.py
index ca7c363..b9b72f8 100644
--- a/kupfer/plugin/tracker.py
+++ b/kupfer/plugin/tracker.py
@@ -1,7 +1,6 @@
 """
 Tracker plugins are versioned by the D-Bus API version
-This is version naught, working with the "original" tracker 0.6.x
-versions.
+This is version works with the "original" tracker 0.6.x dbus API.
 """
 __kupfer_name__ = _("Tracker 0.6")
 __kupfer_sources__ = ("TrackerTagsSource", )
@@ -42,11 +41,11 @@ class TrackerSearch (Action):
 		Action.__init__(self, _("Search in Tracker"))
 
 	def activate(self, leaf):
-		utils.launch_commandline("tracker-search-tool %s" % leaf.object)
+		utils.spawn_async(["tracker-search-tool", leaf.object])
 	def get_description(self):
 		return _("Open Tracker Search Tool and search for this term")
 	def get_icon_name(self):
-		return "search"
+		return "system-search"
 	def item_types(self):
 		yield TextLeaf
 
diff --git a/kupfer/plugin/tracker1.py b/kupfer/plugin/tracker1.py
index 25d9bea..6e91d91 100644
--- a/kupfer/plugin/tracker1.py
+++ b/kupfer/plugin/tracker1.py
@@ -1,14 +1,13 @@
 """
 Tracker plugins are versioned by the D-Bus API version
-This is version naught, working with tracker 0.8.x,
-where the API is called Tracker1
-versions.
+This is version works with tracker 0.8.x, where the API is called Tracker1
 """
 __kupfer_name__ = _("Tracker 0.8")
 __kupfer_sources__ = ()
 __kupfer_text_sources__ = ()
 __kupfer_contents__ = ("TrackerQuerySource", )
 __kupfer_actions__ = (
+		"TrackerSearch",
 		"TrackerSearchHere",
 	)
 __description__ = _("Tracker desktop search integration")
@@ -41,6 +40,19 @@ SEARCH_OBJECT1_PATH = "/org/freedesktop/Tracker1/Resources"
 SEARCH1_INTERFACE = "org.freedesktop.Tracker1.Resources"
 
 
+class TrackerSearch (Action):
+	def __init__(self):
+		Action.__init__(self, _("Search in Tracker"))
+
+	def activate(self, leaf):
+		utils.spawn_async(["tracker-search-tool", leaf.object])
+	def get_description(self):
+		return _("Open Tracker Search Tool and search for this term")
+	def get_icon_name(self):
+		return "system-search"
+	def item_types(self):
+		yield TextLeaf
+
 class TrackerSearchHere (Action):
 	def __init__(self):
 		Action.__init__(self, _("Get Tracker Results..."))



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