Merge lp:~lore-mattei/onehundredscopes/shotwell-precise into lp:~davidc3/onehundredscopes/shotwell

Proposed by Lorenzo Mattei
Status: Merged
Merged at revision: 14
Proposed branch: lp:~lore-mattei/onehundredscopes/shotwell-precise
Merge into: lp:~davidc3/onehundredscopes/shotwell
Diff against target: 87 lines (+20/-31)
2 files modified
debian/control (+1/-1)
src/unity-scope-shotwell (+19/-30)
To merge this branch: bzr merge lp:~lore-mattei/onehundredscopes/shotwell-precise
Reviewer Review Type Date Requested Status
David Callé Pending
Review via email: mp+94523@code.launchpad.net

Description of the change

Message handling updated to Unity 5 interface.

To post a comment you must log in.
14. By David Callé

Now works on Precise. Thanks Lorenzo\!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2012-01-08 15:28:40 +0000
+++ debian/control 2012-02-24 11:34:17 +0000
@@ -17,7 +17,7 @@
17Depends: ${shlibs:Depends},17Depends: ${shlibs:Depends},
18 ${misc:Depends},18 ${misc:Depends},
19 ${python:Depends},19 ${python:Depends},
20 gir1.2-unity-4.0,20 gir1.2-unity-5.0,
21 gir1.2-dee-0.5,21 gir1.2-dee-0.5,
22 python-lxml,22 python-lxml,
23 python-pyexiv2,23 python-pyexiv2,
2424
=== modified file 'src/unity-scope-shotwell'
--- src/unity-scope-shotwell 2012-01-12 08:54:19 +0000
+++ src/unity-scope-shotwell 2012-02-24 11:34:17 +0000
@@ -36,10 +36,8 @@
36 def __init__ (self):36 def __init__ (self):
37 self.scope = Unity.Scope.new ("/net/launchpad/scope/image/shotwell")37 self.scope = Unity.Scope.new ("/net/launchpad/scope/image/shotwell")
38 self.scope.search_in_global = False38 self.scope.search_in_global = False
39 self.scope.connect ("notify::active-search", self.on_search_changed)39 self.scope.connect ("search-changed", self.on_search_changed)
40 self.scope.connect ("notify::active", self.on_search_changed)40 self.scope.connect ("filters-changed", self.on_search_changed)
41 self.scope.connect ("notify::active-global-search", self.on_global_search_changed)
42 self.scope.connect ("filters-changed", self.on_search_changed);
43 self.scope.connect ("activate-uri", self.on_activate_uri);41 self.scope.connect ("activate-uri", self.on_activate_uri);
44 self.scope.export()42 self.scope.export()
4543
@@ -47,31 +45,22 @@
47 GLib.spawn_command_line_async("xdg-open %s" % uri.replace(' ', '\ '))45 GLib.spawn_command_line_async("xdg-open %s" % uri.replace(' ', '\ '))
48 return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri='')46 return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri='')
4947
50
51 def get_search_string (self):
52 search = self.scope.props.active_search
53 return search.props.search_string if search else None
54 48
55 def get_global_search_string (self):49 def on_search_changed (self, scope, search=None, search_type=0, cancellable=None):
56 search = self.scope.props.active_global_search50 if search:
57 return search.props.search_string if search else None51 search_string = search.props.search_string.strip()
5852 print "Search changed to: '%s'" %search_string
59 def on_search_changed (self, scope, param_spec=None):53 else:
60 search = self.get_search_string()54 search_string=''
61 print "Search changed to: '%s'" % search55 if search_type == Unity.SearchType.DEFAULT:
62 results = self.scope.props.results_model56 model = self.scope.props.results_model
63 results.clear()57 else:
64 self.update_results_model (search, results)58 model = self.scope.props.global_results_model
65 results.flush_revision_queue ()59 model.clear()
66 60 self.update_results_model (search_string, model)
67 def on_global_search_changed (self, scope, param_spec=None):61 model.flush_revision_queue ()
68 search = self.get_global_search_string()62 if search:
69 print "Global search changed to: '%s'" % search63 search.finished()
70 results = self.scope.props.global_results_model
71 results.clear()
72 self.update_results_model (search, results)
73 results.flush_revision_queue ()
74
7564
76 def update_results_model(self, search, model):65 def update_results_model(self, search, model):
77 date = self.check_filters("date")66 date = self.check_filters("date")
@@ -91,8 +80,8 @@
91 icon_hint = i[2]80 icon_hint = i[2]
92 model.append (uri, icon_hint, 1,"text/html", title, comment, uri)81 model.append (uri, icon_hint, 1,"text/html", title, comment, uri)
9382
94 if self.scope.props.active_search:83# if self.scope.props.active_search:
95 self.scope.props.active_search.emit("finished")84# self.scope.props.active_search.emit("finished")
9685
97 def check_filters(self, filter_name):86 def check_filters(self, filter_name):
98 try:87 try:

Subscribers

People subscribed via source and target branches

to all changes: