Merge lp:~stolowski/unity-lens-applications/preview-on-lmb into lp:unity-lens-applications

Proposed by Paweł Stołowski
Status: Merged
Approved by: Nick Dedekind
Approved revision: 325
Merged at revision: 324
Proposed branch: lp:~stolowski/unity-lens-applications/preview-on-lmb
Merge into: lp:unity-lens-applications
Diff against target: 75 lines (+52/-5)
2 files modified
src/daemon.vala (+10/-5)
tests/manual/apps-lens-tests.txt (+42/-0)
To merge this branch: bzr merge lp:~stolowski/unity-lens-applications/preview-on-lmb
Reviewer Review Type Date Requested Status
Nick Dedekind (community) Approve
Michal Hruby (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+150839@code.launchpad.net

Commit message

Show preview for installable/purchasable applications on activation (i.e. left-mouse-button in the Dash).

Description of the change

Show preview for installable/purchasable applications on activation (i.e. left-mouse-button in the Dash).
All activation requests for unity-install:// uris result in ActivationResponse.with_preview response.

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

Looks fine.

review: Approve
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

LGTM.
Passes Manual tests.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/daemon.vala'
2--- src/daemon.vala 2012-11-30 09:12:34 +0000
3+++ src/daemon.vala 2013-02-27 16:21:25 +0000
4@@ -1315,11 +1315,16 @@
5 string exec_or_dir = null;
6 if (uri.has_prefix ("unity-install://"))
7 {
8- unowned string pkg = uri.offset (16); // strip off "unity-install://" prefix
9- debug ("Installing: %s", pkg);
10- args = new string[2];
11- args[0] = "software-center";
12- args[1] = pkg;
13+ var prv = preview (uri);
14+ if (prv != null)
15+ {
16+ return new Unity.ActivationResponse.with_preview (prv);
17+ }
18+ else
19+ {
20+ warning ("Failed to generate preview for %s", uri);
21+ return new Unity.ActivationResponse(Unity.HandledType.NOT_HANDLED);
22+ }
23 }
24 else if (uri.has_prefix ("unity-runner://"))
25 {
26
27=== modified file 'tests/manual/apps-lens-tests.txt'
28--- tests/manual/apps-lens-tests.txt 2012-11-30 09:12:34 +0000
29+++ tests/manual/apps-lens-tests.txt 2013-02-27 16:21:25 +0000
30@@ -56,3 +56,45 @@
31 Expected Result:
32 'Recently used', 'Installed', 'More suggestions' categories are displayed.
33 The new application is listed in the 'Installed' category (note: this may take a few seconds after installation finished).
34+
35+Preview activation
36+------------------
37+LMB activates an application preview for installable/purchasable applications.
38+
39+Setup:
40+Software-Center cache is updated (launch Software-Center at least once).
41+
42+Actions:
43+1. Left-click an application from 'More Suggestions' category of Applications Lens.
44+
45+Expected Result:
46+Application preview is displayed in the Dash, with buttons to download/buy the application and visit developer's site (may not always
47+be present if not available).
48+
49+Preview activation (RMB)
50+------------------------
51+RMB activates an application preview for all categories of applications (Installed/Recently Used/More Suggestions).
52+
53+Setup:
54+Software-Center cache is updated (launch Software-Center at least once).
55+
56+Actions:
57+1. Right-click an application in any of the Applications Lens categories.
58+
59+Expected Result:
60+Application preview is displayed in the Dash, with buttons to download/buy the application and visit developer's site (may not always
61+be present if not available) for installable apps or Uninstall/Launch for installed apps (Uninstall may not be available for some
62+important base packages).
63+
64+Starting applications
65+---------------------
66+LMB starts an application from Recently Used/Installed category.
67+
68+Setup:
69+Software-Center cache is updated (launch Software-Center at least once).
70+
71+Actions:
72+1. Left-click an application from 'Installed' or 'Recently Used' category of Applications Lens.
73+
74+Expected Result:
75+Application gets started and Dash hides.

Subscribers

People subscribed via source and target branches