Merge lp:~submarine/unity-lens-photos/unlock-remote-in-home into lp:~submarine/unity-lens-photos/libunity-7-compatible

Proposed by David Callé
Status: Needs review
Proposed branch: lp:~submarine/unity-lens-photos/unlock-remote-in-home
Merge into: lp:~submarine/unity-lens-photos/libunity-7-compatible
Diff against target: 311 lines (+97/-113)
4 files modified
src/unity_facebook_daemon.py (+32/-35)
src/unity_flickr_daemon.py (+32/-35)
src/unity_picasa_daemon.py (+15/-18)
src/unity_shotwell_daemon.py (+18/-25)
To merge this branch: bzr merge lp:~submarine/unity-lens-photos/unlock-remote-in-home
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Submarine Pending
Review via email: mp+155639@code.launchpad.net

Commit message

Scopes (flickr/facebook/picasa) that were previously prevented from being searched from the Dash home (12.10) are now available from it.

Description of the change

Scopes (flickr/facebook/picasa) that were previously prevented from being searched from the Dash home (12.10) are now available from it.

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

Comment out sources filter status detection, they are not used in the Dash anymore, but don't delete it just in case they make an unexpected comeback

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

145. By David Callé

Comment out sources filter status detection, they are not used in the Dash anymore, but don't delete it just in case they make an unexpected comeback

144. By David Callé

Unlock remote results in the Dash home

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity_facebook_daemon.py'
2--- src/unity_facebook_daemon.py 2013-03-21 17:03:01 +0000
3+++ src/unity_facebook_daemon.py 2013-03-27 00:46:22 +0000
4@@ -92,7 +92,7 @@
5 self._scope.connect("search-changed", self.on_search_changed)
6 self._scope.connect("notify::active", self.on_lens_active_or_preference_changed)
7 self._scope.connect('preview-uri', self.on_preview_uri)
8- self._scope.props.sources.connect("notify::filtering", self.on_filtering_changed)
9+# self._scope.props.sources.connect("notify::filtering", self.on_filtering_changed)
10
11 self.preferences = Unity.PreferencesManager.get_default()
12 self.preferences.connect("notify::remote-content-search", self.on_lens_active_or_preference_changed)
13@@ -313,18 +313,18 @@
14 self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
15
16
17- def on_filtering_changed(self, *_):
18- """Run another search when a filter change is notified."""
19- for source in self._sources_options:
20- filtering = self._scope.props.sources.props.filtering
21- active = self._scope.props.sources.get_option(source).props.active
22- if (active and filtering) or (not active and not filtering):
23- if self._enabled:
24- self._enabled = True
25- self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
26- else:
27- self.cancel_all_searches ()
28- print (" %s enabled : %s" % (source, self._enabled))
29+# def on_filtering_changed(self, *_):
30+# """Run another search when a filter change is notified."""
31+# for source in self._sources_options:
32+# filtering = self._scope.props.sources.props.filtering
33+# active = self._scope.props.sources.get_option(source).props.active
34+# if (active and filtering) or (not active and not filtering):
35+# if self._enabled:
36+# self._enabled = True
37+# self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
38+# else:
39+# self.cancel_all_searches ()
40+# print (" %s enabled : %s" % (source, self._enabled))
41
42
43 def cancel_all_searches (self):
44@@ -368,30 +368,27 @@
45 return
46 search_string = search.props.search_string.strip()
47 if self._enabled:
48- if search_type is Unity.SearchType.DEFAULT:
49- print ('Facebook : new search %s' % search_string)
50- date = self.check_date_filter (search)
51- i = 0
52- if search_string:
53+ print ('Facebook : new search %s' % search_string)
54+ date = self.check_date_filter (search)
55+ i = 0
56+ if search_string:
57 # for i in range(1,3):
58- if self._pending[i] is not None:
59- self._http[i].cancel_message(self._pending[i],
60- Soup.KnownStatusCode.CANCELLED)
61- url = self._url_maker(i, search_string, date)
62- if url:
63- self._pending[i] = Soup.Message.new("GET", url)
64- self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search])
65- else:
66+ if self._pending[i] is not None:
67+ self._http[i].cancel_message(self._pending[i],
68+ Soup.KnownStatusCode.CANCELLED)
69+ url = self._url_maker(i, search_string, date)
70+ if url:
71+ self._pending[i] = Soup.Message.new("GET", url)
72+ self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search])
73+ else:
74 # for i in range(3):
75- if self._pending[i] is not None:
76- self._http[i].cancel_message(self._pending[i],
77- Soup.KnownStatusCode.CANCELLED)
78- url = self._url_maker(i, search_string, date)
79- if url:
80- self._pending[i] = Soup.Message.new("GET", url)
81- self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search])
82- else:
83- search.emit('finished')
84+ if self._pending[i] is not None:
85+ self._http[i].cancel_message(self._pending[i],
86+ Soup.KnownStatusCode.CANCELLED)
87+ url = self._url_maker(i, search_string, date)
88+ if url:
89+ self._pending[i] = Soup.Message.new("GET", url)
90+ self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search])
91 else:
92 search.emit('finished')
93
94
95=== modified file 'src/unity_flickr_daemon.py'
96--- src/unity_flickr_daemon.py 2013-03-21 17:03:01 +0000
97+++ src/unity_flickr_daemon.py 2013-03-27 00:46:22 +0000
98@@ -92,7 +92,7 @@
99 self._get_accounts_for_service ('flickr')
100 self._scope.connect("search-changed", self.on_search_changed)
101 self._scope.connect("notify::active", self.on_lens_active_or_preference_changed)
102- self._scope.props.sources.connect("notify::filtering", self.on_filtering_changed)
103+# self._scope.props.sources.connect("notify::filtering", self.on_filtering_changed)
104 self._scope.connect('preview-uri', self.on_preview_uri)
105
106 self.preferences = Unity.PreferencesManager.get_default()
107@@ -377,18 +377,18 @@
108 self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
109
110
111- def on_filtering_changed(self, *_):
112- """Run another search when a filter change is notified."""
113- for source in self._sources_options:
114- filtering = self._scope.props.sources.props.filtering
115- active = self._scope.props.sources.get_option(source).props.active
116- if (active and filtering) or (not active and not filtering):
117- if not self._enabled:
118- self._enabled = True
119- self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
120- else:
121- self.cancel_all_searches ()
122- print (" %s enabled : %s" % (source, self._enabled))
123+# def on_filtering_changed(self, *_):
124+# """Run another search when a filter change is notified."""
125+# for source in self._sources_options:
126+# filtering = self._scope.props.sources.props.filtering
127+# active = self._scope.props.sources.get_option(source).props.active
128+# if (active and filtering) or (not active and not filtering):
129+# if not self._enabled:
130+# self._enabled = True
131+# self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
132+# else:
133+# self.cancel_all_searches ()
134+# print (" %s enabled : %s" % (source, self._enabled))
135
136
137 def cancel_all_searches (self):
138@@ -433,28 +433,25 @@
139 return
140 search_string = search.props.search_string.strip()
141 if self._enabled:
142- if search_type is Unity.SearchType.DEFAULT:
143- print ('Flickr : new search %s' % search_string)
144- for i in range(4):
145- if self._pending[i] is not None:
146- self._http[i].cancel_message(self._pending[i],
147- Soup.KnownStatusCode.CANCELLED)
148- if search_string:
149- if i > 0:
150- args = self.query_for_cat(i, search_string, search)
151- url = self._url_maker(args[0], args[1])
152- if url:
153- self._pending[i] = Soup.Message.new("GET", url)
154- self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search, 3])
155- else:
156- if i < 3:
157- args = self.query_for_cat(i, search_string, search)
158- url = self._url_maker(args[0], args[1])
159- if url:
160- self._pending[i] = Soup.Message.new("GET", url)
161- self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search, 2])
162- else:
163- search.emit('finished')
164+ print ('Flickr : new search %s' % search_string)
165+ for i in range(4):
166+ if self._pending[i] is not None:
167+ self._http[i].cancel_message(self._pending[i],
168+ Soup.KnownStatusCode.CANCELLED)
169+ if search_string:
170+ if i > 0:
171+ args = self.query_for_cat(i, search_string, search)
172+ url = self._url_maker(args[0], args[1])
173+ if url:
174+ self._pending[i] = Soup.Message.new("GET", url)
175+ self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search, 3])
176+ else:
177+ if i < 3:
178+ args = self.query_for_cat(i, search_string, search)
179+ url = self._url_maker(args[0], args[1])
180+ if url:
181+ self._pending[i] = Soup.Message.new("GET", url)
182+ self._http[i].queue_message(self._pending[i],self._search_cb,[search_string, model, i, search, 2])
183 else:
184 search.emit('finished')
185
186
187=== modified file 'src/unity_picasa_daemon.py'
188--- src/unity_picasa_daemon.py 2013-03-21 17:03:01 +0000
189+++ src/unity_picasa_daemon.py 2013-03-27 00:46:22 +0000
190@@ -88,7 +88,7 @@
191 self._get_accounts_for_service ('google')
192 self._scope.connect("search-changed", self._on_search_changed)
193 self._scope.connect("notify::active", self.on_lens_active_or_preference_changed)
194- self._scope.props.sources.connect("notify::filtering", self.on_filtering_changed)
195+# self._scope.props.sources.connect("notify::filtering", self.on_filtering_changed)
196 self._scope.connect('preview-uri', self.on_preview_uri)
197
198 self.preferences = Unity.PreferencesManager.get_default()
199@@ -229,18 +229,18 @@
200 self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
201
202
203- def on_filtering_changed(self, *_):
204- """Run another search when a filter change is notified."""
205- for source in self._sources_options:
206- filtering = self._scope.props.sources.props.filtering
207- active = self._scope.props.sources.get_option(source).props.active
208- if (active and filtering) or (not active and not filtering):
209- if not self._enabled:
210- self._enabled = True
211- self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
212- else:
213- self.cancel_all_searches ()
214- print (" %s enabled : %s" % (source, self._enabled))
215+# def on_filtering_changed(self, *_):
216+# """Run another search when a filter change is notified."""
217+# for source in self._sources_options:
218+# filtering = self._scope.props.sources.props.filtering
219+# active = self._scope.props.sources.get_option(source).props.active
220+# if (active and filtering) or (not active and not filtering):
221+# if not self._enabled:
222+# self._enabled = True
223+# self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
224+# else:
225+# self.cancel_all_searches ()
226+# print (" %s enabled : %s" % (source, self._enabled))
227
228
229 def cancel_all_searches (self):
230@@ -280,11 +280,8 @@
231
232 search_string = search.props.search_string
233 if self._enabled:
234- if search_type == Unity.SearchType.DEFAULT:
235- self.update_results_model (search_string, model, search)
236- print("Picasa : new search %s" % search_string)
237- else:
238- search.emit ('finished')
239+ self.update_results_model (search_string, model, search)
240+ print("Picasa : new search %s" % search_string)
241 else:
242 search.emit ('finished')
243
244
245=== modified file 'src/unity_shotwell_daemon.py'
246--- src/unity_shotwell_daemon.py 2013-03-21 17:03:01 +0000
247+++ src/unity_shotwell_daemon.py 2013-03-27 00:46:22 +0000
248@@ -77,7 +77,7 @@
249 self._scope = Scope (dbus_path="/com/canonical/unity/scope/photos/shotwell", id="shotwell")
250 self._scope.connect ("search-changed", self.on_search_changed)
251 self._scope.connect("notify::active", self.on_lens_active)
252- self._scope.connect("notify::filtering", self.on_filtering_changed)
253+# self._scope.connect("notify::filtering", self.on_filtering_changed)
254 self._scope.connect('preview-uri', self.on_preview_uri)
255 source_name = SOURCE
256 self.last_db_change = None
257@@ -123,19 +123,19 @@
258 def callback(object, result, user_data):
259 object.preview_result_finish(result)
260
261- def on_filtering_changed(self, *_):
262- """Update results when a filter change is notified."""
263- for source in self._sources_options:
264- filtering = self._scope.props.sources.props.filtering
265- active = self._scope.props.sources.get_option(source).props.active
266- if (active and filtering) or (not active and not filtering):
267- if not self._enabled:
268- self._enabled = True
269- self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
270- else:
271- self._enabled = False
272- self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
273- print (" %s enabled : %s" % (source, self._enabled))
274+# def on_filtering_changed(self, *_):
275+# """Update results when a filter change is notified."""
276+# for source in self._sources_options:
277+# filtering = self._scope.props.sources.props.filtering
278+# active = self._scope.props.sources.get_option(source).props.active
279+# if (active and filtering) or (not active and not filtering):
280+# if not self._enabled:
281+# self._enabled = True
282+# self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
283+# else:
284+# self._enabled = False
285+# self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
286+# print (" %s enabled : %s" % (source, self._enabled))
287
288
289 def on_lens_active(self, *_):
290@@ -154,18 +154,11 @@
291 print ("Search changed to \"%s\"" % search_string)
292 if self._enabled:
293 date = self.check_date_filter (search)
294- if search_type is Unity.SearchType.GLOBAL:
295- if len(search_string) > 0:
296- cats = [4]
297- GLib.idle_add(self.update_results_model,search_string, model, cats, date, search)
298- else:
299- search.emit('finished')
300+ if search_string or date:
301+ cats = [1]
302 else:
303- if search_string or date:
304- cats = [1]
305- else:
306- cats = [0,1]
307- GLib.idle_add(self.update_results_model,search_string, model, cats, date, search)
308+ cats = [0,1]
309+ GLib.idle_add(self.update_results_model,search_string, model, cats, date, search)
310 else:
311 search.emit('finished')
312

Subscribers

People subscribed via source and target branches

to all changes: