Merge lp:~stolowski/unity-lens-video/preview-on-lmb into lp:~unity-team/unity-lens-video/libunity7-compatible

Proposed by Paweł Stołowski
Status: Merged
Approved by: Martin Mrazik
Approved revision: 129
Merged at revision: 126
Proposed branch: lp:~stolowski/unity-lens-video/preview-on-lmb
Merge into: lp:~unity-team/unity-lens-video/libunity7-compatible
Diff against target: 99 lines (+23/-9)
3 files modified
configure.ac (+2/-2)
debian/control (+1/-1)
src/remote-scope.vala (+20/-6)
To merge this branch: bzr merge lp:~stolowski/unity-lens-video/preview-on-lmb
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michal Hruby (community) Needs Fixing
Review via email: mp+160348@code.launchpad.net

Commit message

Open preview on left-click for More Suggestions.

Description of the change

Open preview on left-click for More Suggestions.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

14 + if (rawuri.has_prefix ("https://videosearch.ubuntu.com"))
15 + return new Unity.ActivationResponse (Unity.HandledType.SHOW_PREVIEW);

This won't work, both "Online" and "More suggestions" results use this prefix.

review: Needs Fixing
125. By Paweł Stołowski

Use activate_result handler added to libunity API to handle preview-on-activation based on category index.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
126. By Paweł Stołowski

Put real category into metadata.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
127. By Paweł Stołowski

Merged libunity-7 branch.

128. By Paweł Stołowski

Just store a bool in metadata to indiciate preview on LMB for more suggestions. Set schema.

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

Looks good, but please bump the debian/control file as well.

review: Needs Fixing
129. By Paweł Stołowski

Bumped required libunity version in debian control.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Martin Mrazik (mrazik) wrote :

Jenkins error. Reapproving.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2013-04-23 08:07:54 +0000
+++ configure.ac 2013-04-24 11:33:26 +0000
@@ -76,8 +76,8 @@
76 libsoup-gnome-2.476 libsoup-gnome-2.4
77 json-glib-1.077 json-glib-1.0
78 zeitgeist-1.0 >= 0.3.878 zeitgeist-1.0 >= 0.3.8
79 unity >= 6.90.279 unity >= 6.91.11
80 unity-extras >= 6.90.280 unity-extras >= 6.91.11
81 )81 )
8282
83AC_SUBST(SCOPE_DAEMON_CFLAGS)83AC_SUBST(SCOPE_DAEMON_CFLAGS)
8484
=== modified file 'debian/control'
--- debian/control 2013-03-15 13:16:17 +0000
+++ debian/control 2013-04-24 11:33:26 +0000
@@ -11,7 +11,7 @@
11 libglib2.0-dev (>= 2.27),11 libglib2.0-dev (>= 2.27),
12 libjson-glib-dev,12 libjson-glib-dev,
13 libsoup-gnome2.4-dev,13 libsoup-gnome2.4-dev,
14 libunity-dev (>= 6.91),14 libunity-dev (>= 6.91.11),
15 libzeitgeist-dev (>= 0.3.8),15 libzeitgeist-dev (>= 0.3.8),
16 valac-0.18,16 valac-0.18,
17 xvfb,17 xvfb,
1818
=== modified file 'src/remote-scope.vala'
--- src/remote-scope.vala 2013-04-11 15:31:07 +0000
+++ src/remote-scope.vala 2013-04-24 11:33:26 +0000
@@ -27,6 +27,7 @@
27 private static int REFRESH_INTERVAL = 3600; // fetch sources & recommendations once an hour27 private static int REFRESH_INTERVAL = 3600; // fetch sources & recommendations once an hour
28 private static int RETRY_INTERVAL = 60; // retry sources/recommendations after a minute28 private static int RETRY_INTERVAL = 60; // retry sources/recommendations after a minute
2929
30 private static string PREVIEW_ON_LMB = "lmb-preview";
30 private Soup.Session session;31 private Soup.Session session;
31 private PreferencesManager preferences = PreferencesManager.get_default ();32 private PreferencesManager preferences = PreferencesManager.get_default ();
32 Gee.ArrayList<RemoteVideoFile?> recommendations;33 Gee.ArrayList<RemoteVideoFile?> recommendations;
@@ -34,8 +35,6 @@
34 Zeitgeist.DataSourceRegistry zg_sources;35 Zeitgeist.DataSourceRegistry zg_sources;
35 bool use_zeitgeist;36 bool use_zeitgeist;
3637
37 private Variant empty_asv;
38
39 public RemoteVideoScope ()38 public RemoteVideoScope ()
40 {39 {
41 Object (dbus_path: "/net/launchpad/scope/remotevideos", id: "video-remote.scope");40 Object (dbus_path: "/net/launchpad/scope/remotevideos", id: "video-remote.scope");
@@ -45,7 +44,7 @@
45 {44 {
46 base.constructed ();45 base.constructed ();
4746
48 empty_asv = new Variant.array (VariantType.VARDICT.element (), {});47 schema.add_field (PREVIEW_ON_LMB, "b", Unity.Schema.FieldType.OPTIONAL);
4948
50 recommendations = new Gee.ArrayList<RemoteVideoFile?> ();49 recommendations = new Gee.ArrayList<RemoteVideoFile?> ();
5150
@@ -82,8 +81,6 @@
82 queue_search_changed (SearchType.DEFAULT);81 queue_search_changed (SearchType.DEFAULT);
83 });82 });
8483
85 activate_uri.connect (on_activate_uri);
86
87 populate_categories ();84 populate_categories ();
88 query_list_of_sources ();85 query_list_of_sources ();
8986
@@ -181,6 +178,19 @@
181 });178 });
182 }179 }
183180
181 public override async Unity.ActivationResponse? activate_result (ScopeResult result)
182 {
183 var realcat = result.metadata.lookup (PREVIEW_ON_LMB);
184 // activation of More Suggestions should display a preview.
185 if (realcat != null && realcat.get_boolean ())
186 {
187 var preview = yield preview_result (result);
188 return new Unity.ActivationResponse.with_preview (preview);
189 }
190
191 return on_activate_uri (result.uri);
192 }
193
184 private Unity.ActivationResponse on_activate_uri (string rawuri)194 private Unity.ActivationResponse on_activate_uri (string rawuri)
185 {195 {
186 var fakeuri = RemoteUri.from_rawuri (rawuri);196 var fakeuri = RemoteUri.from_rawuri (rawuri);
@@ -475,7 +485,11 @@
475 result_icon = anno_icon.to_string ();485 result_icon = anno_icon.to_string ();
476 }486 }
477487
478 model.append (fake_uri.to_rawuri (), result_icon, video.category, ResultType.DEFAULT, "text/html", video.title, video.comment, video.uri, empty_asv);488 // aggregator scope remaps categories, so we won't get real category back;
489 // put real category into metadata
490 var realcat = new Variant.dict_entry (PREVIEW_ON_LMB, new Variant.variant (video.category == CAT_INDEX_MORE));
491 var metadata = new Variant.array (VariantType.VARDICT.element (), {realcat});
492 model.append (fake_uri.to_rawuri (), result_icon, video.category, ResultType.DEFAULT, "text/html", video.title, video.comment, video.uri, metadata);
479 }493 }
480 }494 }
481 }495 }

Subscribers

People subscribed via source and target branches