changed icon. Added filter code, but wont display

This commit is contained in:
Jean-Francois Dockes 2012-03-22 19:13:04 +01:00
parent 7ee3039f7a
commit 093bffda4d
7 changed files with 56 additions and 34 deletions

View File

@ -3,7 +3,7 @@ NULL =
EXTRA_DIST = \
bin/unity-recoll-daemon.in \
data/recoll.lens.in \
data/recoll-lens.svg \
data/recollbg24.png \
data/unity-lens-recoll.service.in \
$(docs_DATA) \
$(NULL)
@ -50,7 +50,7 @@ dotlens_DATA = \
######################################################
iconsdir = $(datadir)/unity-lens-recoll
icons_DATA = \
data/recoll-lens.svg \
data/recollbg24.png \
$(NULL)
######################################################

View File

@ -179,7 +179,7 @@ NULL =
EXTRA_DIST = \
bin/unity-recoll-daemon.in \
data/recoll.lens.in \
data/recoll-lens.svg \
data/recollbg24.png \
data/unity-lens-recoll.service.in \
$(docs_DATA) \
$(NULL)
@ -228,7 +228,7 @@ dotlens_DATA = \
######################################################
iconsdir = $(datadir)/unity-lens-recoll
icons_DATA = \
data/recoll-lens.svg \
data/recollbg24.png \
$(NULL)

View File

@ -29,7 +29,7 @@ or if you checked the code out from a bazaar branch:
RESOURCES
---------
The source code and releases packages can be found on
https://www.recoll.org.
http://www.recoll.org.
Bugs should be reported on the bitbucket recoll issues tracker:
https://bitbucket.org/medoc/recoll/issues
https://bitbucket.org/medoc/recoll/issues

View File

@ -44,6 +44,9 @@ if result != 1 :
print >> sys.stderr, "Failed to own name %s. Bailing out." % BUS_NAME
raise SystemExit (1)
rcltrace = open("/tmp/recolenstrace", "a")
print >> rcltrace, "UNITY RECOLL DAEMON"
def create_lens ():
# The path for the Lens *must* also match the one in our .lens file
from gi.repository import Unity
@ -51,23 +54,41 @@ def create_lens ():
lens.props.search_hint = "Recoll search string"
lens.props.visible = True;
lens.props.search_in_global = True;
lens.props.search_in_global = False;
# Populate categories TODO FIX THIS
# Populate categories
cats = []
cats.append (Unity.Category.new ("Documents",
Gio.ThemedIcon.new("document"),
Unity.CategoryRenderer.HORIZONTAL_TILE))
lens.props.categories = cats
# Populate filters
lens.props.filters = []
# We should get the categories from the config but the python
# module currently has no code for this.
filter = Unity.RadioOptionFilter.new("rclcat", "Category",
Gio.ThemedIcon.new(""), False)
filter.add_option("text", "Text", None);
filter.add_option("spreadsheet", "Spreadsheet", None);
filter.add_option("presentation", "Presentation", None);
filter.add_option("media", "Media", None);
filter.add_option("message", "Message", None);
filter.add_option("other", "Other", None);
lens.props.filters.append(filter)
return lens
print >> rcltrace, "UNITY RECOLL DAEMON: create lens"
lens = create_lens ()
print >> rcltrace, "UNITY RECOLL DAEMON: add local scope"
lens.add_local_scope (recollscope.rclsearch.Scope())
# add more local scopes here (remote dbus scopes added automagically)
print >> rcltrace, "UNITY RECOLL DAEMON: add local export"
lens.export ()
print >> rcltrace, "UNITY RECOLL DAEMON: add local main loop"
GObject.MainLoop().run()

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<g>
<g>
<path fill="#FFFFFF" d="M9.5,21c0,0.55,0.45,1,1,1h3c0.55,0,1-0.45,1-1V8h-5V21z M6.5,2H3.501c-0.55,0-1,0.45-1,1L2.5,21
c0,0.55,0.45,1,1,1h2.999c0.55,0,1-0.45,1-1v-2.969H5.5v-1h1.999V14H5.5v-1h2v-3h-2V9h2V6h-2V5h2V3C7.5,2.45,7.05,2,6.5,2z
M7.5,10V9V10L7.5,10z M7.5,14v-1h0L7.5,14L7.5,14z M7.5,18.031v-1H7.499L7.5,18.031L7.5,18.031z M19,8.015
c1.104,0,2.5-1.119,2.5-2.5c0-0.933-1.408-2.79-2-3.515v1.515c0.293,0.174,0.5,0.48,0.5,0.847c0,0.553-0.447,1-1,1s-1-0.447-1-1
c0-0.366,0.207-0.673,0.5-0.847V2c-0.592,0.725-2,2.582-2,3.515C16.5,6.896,17.896,8.015,19,8.015z M9.438,7H14.5l-2.531-5
L9.438,7z M16.5,21c0,0.55,0.45,1,1,1h3c0.55,0,1-0.45,1-1V9h-5V21z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -2,7 +2,7 @@
DBusName=org.recoll.UnityLensRecoll.Lens
DBusPath=/org/recoll/unitylensrecoll/lens
Name=Recoll Lens
Icon=@DATADIR@/unity-lens-recoll/recoll-lens.svg
Icon=@DATADIR@/unity-lens-recoll/recollbg24.png
Description=Search documents indexed by Recoll
SearchHint=Type to search
Shortcut=a

View File

@ -1,6 +1,7 @@
import sys
from gi.repository import GLib, GObject, Gio
from gi.repository import Dee
from gi.repository import Unity
import recoll
@ -9,13 +10,19 @@ import recoll
CATEGORY_ALL = 0
# typing timeout: we don't want to start a search for every
# char. Unity does batch on its side, but we may want more control ?
# Or not ? Set to 0 to not use it.
# char? Unity does batch on its side, but we may want more control ?
# Or not ? I'm not sure this does any good on a moderate size index.
# Set to 0 to not use it (default). Kept around because this still might be
# useful with a very big index ?
TYPING_TIMEOUT = 0
class Scope (Unity.Scope):
def __init__ (self):
self.trcfile = open("/tmp/recolenstrace", "w")
print >> self.trcfile, "Scope init"
self.trcfile.flush()
Unity.Scope.__init__ (self, dbus_path="/org/recoll/unitylensrecoll/scope/main")
# Listen for changes and requests
@ -24,12 +31,16 @@ class Scope (Unity.Scope):
# Bliss loaded the apps_tree menu here, let's connect to
# the index
print >> self.trcfile, "Connecting to db"
self.db = recoll.connect()
print >> self.trcfile, "Done"
self.trcfile.flush()
self.db.setAbstractParams(maxchars=200,
contextwords=4)
self.timeout_id = None
def get_search_string (self):
search = self.props.active_search
return search.props.search_string if search else None
@ -47,7 +58,6 @@ class Scope (Unity.Scope):
search = self.props.active_global_search
if search:
search.emit("finished")
def reset (self):
self._do_browse (self.props.results_model)
self._do_browse (self.props.global_results_model)
@ -106,17 +116,25 @@ class Scope (Unity.Scope):
search_string, model)
def _really_do_search(self, search_string, model):
# print "really_do_search:", search_string
print >> self.trcfile, "really_do_search:[", search_string, "]"
self.trcfile.flush()
model.clear ()
if search_string == "":
return True
# Do the recoll thing
query = self.db.query()
nres = query.execute(search_string)
try:
nres = query.execute(search_string)
except:
return
actual_results = 0
while query.next >= 0 and query.next < nres:
doc = query.fetchone()
try:
doc = query.fetchone()
except:
break
# No sense in returning unusable results (until
# I get an idea of what to do with them)