~davidc3/onehundredscopes/shotwell

« back to all changes in this revision

Viewing changes to src/unity-scope-shotwell

  • Committer: David Callé
  • Date: 2012-03-02 16:13:09 UTC
  • mfrom: (16.1.1 shotwell)
  • Revision ID: davidc@framli.eu-20120302161309-xv2qrgrb4idhesqz
New on_filtering_changed method

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='')