~lore-mattei/onehundredscopes/shotwell-precise

« back to all changes in this revision

Viewing changes to src/unity-scope-shotwell

  • Committer: Lorenzo Mattei
  • Date: 2012-03-02 15:43:08 UTC
  • Revision ID: lore.mattei@gmail.com-20120302154308-djpo6bu5xlgfn2cm
Fixes bug #943254

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        self.scope = Unity.Scope.new ("/net/launchpad/scope/image/shotwell")
38
38
        self.scope.search_in_global = False
39
39
        self.scope.connect ("search-changed", self.on_search_changed)
40
 
        self.scope.connect ("filters-changed", self.on_search_changed)
 
40
        self.scope.connect ("filters-changed", self.on_filtering_changed)
41
41
        self.scope.connect ("activate-uri", self.on_activate_uri);
42
42
        self.scope.connect("notify::active", self.on_lens_active)
 
43
        self.scope.props.sources.connect("notify::filtering",
 
44
            self.on_filtering_changed)
43
45
        self.scope.export()
44
46
 
 
47
    def on_filtering_changed(self, *_):
 
48
        """Run another search when a filter change is notified."""
 
49
        self.scope.queue_search_changed(Unity.SearchType.DEFAULT)
 
50
        
45
51
    def on_activate_uri (self, scope, uri):
46
52
        GLib.spawn_command_line_async("xdg-open %s" % uri.replace(' ', '\ '))
47
53
        return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri='')