Merge lp://qastaging/~kamstrup/unity/home-lenses into lp://qastaging/unity

Proposed by Mikkel Kamstrup Erlandsen
Status: Merged
Approved by: Michal Hruby
Approved revision: no longer in the source branch.
Merged at revision: 1868
Proposed branch: lp://qastaging/~kamstrup/unity/home-lenses
Merge into: lp://qastaging/unity
Diff against target: 3591 lines (+1781/-1033)
35 files modified
HACKING (+7/-0)
UnityCore/CMakeLists.txt (+2/-0)
UnityCore/Categories.cpp (+8/-0)
UnityCore/Categories.h (+1/-0)
UnityCore/Filters.cpp (+8/-0)
UnityCore/Filters.h (+1/-0)
UnityCore/GLibDBusProxy.cpp (+11/-0)
UnityCore/GLibDBusProxy.h (+1/-0)
UnityCore/GLibWrapper.cpp (+5/-0)
UnityCore/GLibWrapper.h (+1/-0)
UnityCore/HomeLens.cpp (+957/-0)
UnityCore/HomeLens.h (+79/-0)
UnityCore/Lens.cpp (+128/-55)
UnityCore/Lens.h (+17/-6)
UnityCore/Model-inl.h (+47/-9)
UnityCore/Model.h (+11/-0)
UnityCore/Results.cpp (+8/-0)
UnityCore/Results.h (+1/-0)
com.canonical.Unity.gschema.xml (+10/-3)
plugins/unityshell/src/DashView.cpp (+41/-9)
plugins/unityshell/src/DashView.h (+4/-2)
plugins/unityshell/src/HomeView.cpp (+0/-252)
plugins/unityshell/src/HomeView.h (+0/-93)
plugins/unityshell/src/LensBar.cpp (+13/-3)
plugins/unityshell/src/LensView.cpp (+11/-2)
plugins/unityshell/src/PlacesHomeView.cpp (+0/-378)
plugins/unityshell/src/PlacesHomeView.h (+0/-72)
plugins/unityshell/src/ResultViewGrid.cpp (+13/-2)
po/POTFILES.in (+0/-1)
po/unity.pot (+0/-120)
standalone-clients/CMakeLists.txt (+0/-4)
standalone-clients/standalone_dash.cpp (+0/-16)
tests/CMakeLists.txt (+7/-6)
tests/test_home_lens.cpp (+362/-0)
tests/test_utils.h (+27/-0)
To merge this branch: bzr merge lp://qastaging/~kamstrup/unity/home-lenses
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Andrea Azzarone (community) Needs Information
Review via email: mp+89669@code.qastaging.launchpad.net

Description of the change

Replace the Unity home screen tiles with a "merged lens view" where lenses can contribute any categories they see fit.

settings: introduced a new gsettings key in the com.canonical.Unity.Dash namespace that controls the order of the results on the home screen. We should consider in a later branch having the sorting logic in FilesystemLenses also use this key (still falling back to alphabetical sorting when nothing is set). It empowers users and OEMs to override the default view on the homescreen by putting custom stuff first.

libunity-core: Added a HomeLens class that implements Lens and Lenses interfaces. The typical use case is to add a FilesystemLenses to the HomeLens which will make it automatically merge all lenses found on the fs. In testing we implement custom Lenses instances and add those to the HomeLens in stead.

unityshell: Removed the tiled homescreen and use a bog standard LensView to render the HomeLens in stead. Fixed a bunch of places where we assumed that Lenses' categories were always only appended to. This is no longer true with the HomeLens. Also important: Fix the SetViewType() calling semantics to the lenses when showing/hiding the dash and when switching between the lenses.

Testing it out:
For this branch to work you need also: lp:~kamstrup/unity-lens-applications/home-lenses, lp:~kamstrup/unity-lens-files/home-lenses, and lp:~mhr3/unity-lens-music/home-lenses. Add to that latest bamf. Without these you will not see the correct results.

To validate the results: Make sure that bringing up the dash resets the search and shows you a default view with exactly 3 categories in this order: Recent Apps, Recent Files, and Downloads. Then do a search and validate that you have exactly 3 categories in this order Applications, Files & Folders, and Music.

Finally; launch an app that is not a favorite, then bring up the bring up the dash home screen and assert that the running app is *not* in the recent apps category (but showing in the launcher). Then close the app and bring up the dash again. The app should now show under Recent Apps.

Design review:
Home screen without search: https://bugs.launchpad.net/unity/+bug/885738/+attachment/2690636/+files/unity-home-lens-design-review-1.png
Home screen with search: https://bugs.launchpad.net/unity/+bug/885738/+attachment/2690639/+files/unity-home-lens-design-review-2.png

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Meh. Sorry for the i18n noise. No idea how that got here. Will try to remove.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Sigh. bzr insists that I don't have any diff with trunk wrt the translations. Fun and games.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Found it. Amended in r1875.

Revision history for this message
Michal Hruby (mhr3) wrote :

Just a note: all the lens branches are now merged in respective trunks.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Is PlacesHomeView.cpp/h still needed?

Revision history for this message
Andrea Azzarone (azzar1) :
review: Needs Information
Revision history for this message
Michal Hruby (mhr3) wrote :

1519 ~Lens();

I believe this should be virtual now.

1538 template<class RowAdaptor>
1539 Model<RowAdaptor>::Model()

The missing model.SetGetterFunction(...) could be a very nasty surprise in the future.

One of weird things I noticed is that when using keynav in the home view (specifically the down array) sometimes the "See xx more results" doesn't get highlighted and can't be expanded by pressing enter.

review: Needs Fixing
Revision history for this message
Andrea Azzarone (azzar1) wrote :

> One of weird things I noticed is that when using keynav in the home view
> (specifically the down array) sometimes the "See xx more results" doesn't get
> highlighted and can't be expanded by pressing enter.

Fixed here https://code.launchpad.net/~andyrock/unity/key-nav

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

> Is PlacesHomeView.cpp/h still needed

Strictly, no. I didn't delete it because technically the home-lens concept is on a trial run. If design ditches it we'll have to revert to the old view and I didn't want to dig it out of the rev history. Although, I probably should delete it, to have a better looking diffstat :-)

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

> 1519 ~Lens();
>
> I believe this should be virtual now.

Right. I wonder why the compiler didn't complain. It usually does in these cases. Fixed.

> 1538 template<class RowAdaptor>
> 1539 Model<RowAdaptor>::Model()
>
> The missing model.SetGetterFunction(...) could be a very nasty surprise in the
> future.

Ah, good catch. I created a new Init() method that gets called from the constructors so they can share the setup code. (my favorite hate-pattern. why oh why can't we chain constructors in C++?!?!?!11). Anyway; fixed.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

WTF. The diffs seems to be showing that I removed po/unity.pot which I swear I didn't! Let me look into it.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Ok, the diff should be clean in r1881. Please re-review

Revision history for this message
Michal Hruby (mhr3) wrote :

One thing that's still missing is resetting the search entry when dash is hidden (or not-resetting the search sent to lenses as https://bugs.launchpad.net/ayatana-design/+bug/914759 requires).

Either would be fine, but right now the search entry isn't reset, while the search is...

review: Needs Fixing
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Implemented search state retention as requested by design. Please re-review.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

John acked the design review on IRC

Revision history for this message
Michal Hruby (mhr3) wrote :

Sorry, but Esc now no longer clears the search entry... I don't think that's desired.

review: Needs Fixing
Revision history for this message
Andrea Azzarone (azzar1) wrote :

> Sorry, but Esc now no longer clears the search entry... I don't think that's
> desired.

1866 - else
1867 - search_bar_->search_string = "";

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

> > Sorry, but Esc now no longer clears the search entry... I don't think that's
> > desired.
>
> 1866 - else
> 1867 - search_bar_->search_string = "";

I am not sure if you mean to back Michal up, or refute his claim Andrea? :-)

In any case, I think I have the right behavior here... When clicking Esc I see:

a) if there is text in the entry the text is cleared, and the dash shows results for the empty search
b) if there is no search, the dash is hidden

As a Corollary, c) hitting Esc twice clears and hides the dash.

Revision history for this message
Michal Hruby (mhr3) wrote :

Unfortunately, that's not the behaviour I see (particularly a) doesn't work). Afaict the code Andrea pasted is what handled the "esc and search entry not empty" case, and you removed it...

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Hmmm, I can see you are correct looking at the code... I wonder how it could work on my box. I must have been running some almost, but not entirely, identical to what I pushed. Nonetheless; pushed a fix.

Revision history for this message
Michal Hruby (mhr3) wrote :

Yep, it's fine now. Approved from me, but I suppose more people want to go through this...

review: Approve
Revision history for this message
Neil J. Patel (njpatel) wrote :

237 (and other places): Instead of handling the gchar* yourself, use glib::String from UnityCore/GLibWrapper.h, it autofree's it when it's popped from the stack, so you don't need to worry about g_free in multiple places.

330: Evil, evil kamstrup.

Apart from that, excellent work :)

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

> 237 (and other places): Instead of handling the gchar* yourself, use
> glib::String from UnityCore/GLibWrapper.h, it autofree's it when it's popped
> from the stack, so you don't need to worry about g_free in multiple places.

Ok, now using glib::String. It required that I add automatic std::string conversion to glib::String in order not to complicate the code - I was wondering if there was a specific reason it wasn't in glib::String already. Seems like a strange omission?

Revision history for this message
Michal Hruby (mhr3) wrote :

Neil ACKed this as well, so approving...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.