Merge lp:~josharenson/unity8/dashboard-manager into lp:unity8

Proposed by Josh Arenson on 2017-03-10
Status: Needs review
Proposed branch: lp:~josharenson/unity8/dashboard-manager
Merge into: lp:unity8
Diff against target: 459 lines (+362/-3)
10 files modified
qml/Dash/DashSectionHeader.qml (+3/-1)
qml/Dash/Dashboard/DashboardManager.qml (+61/-0)
qml/Dash/Dashboard/DashboardManagerCategory.qml (+85/-0)
qml/Dash/Dashboard/DashboardManagerScope.qml (+91/-0)
tests/CMakeLists.txt (+16/-1)
tests/mocks/Unity/CMakeLists.txt (+1/-0)
tests/mocks/Unity/fake_scopesoverview.cpp (+1/-1)
tests/qmltests/CMakeLists.txt (+1/-0)
tests/qmltests/Dash/Dashboard/tst_DashboardManager.qml (+85/-0)
tests/utils/modules/Unity/Test/UnityTestCase.qml (+18/-0)
To merge this branch: bzr merge lp:~josharenson/unity8/dashboard-manager
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve on 2017-04-05
Matthew Paul Thomas design 2017-03-10 Needs Information on 2017-04-03
Andrea Cimitan (community) Needs Fixing on 2017-03-13
Review via email: mp+319522@code.launchpad.net

Commit message

Implement the scopes Dashboard Manger window

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
No, originally this depended on Lukas's Dashboard branch, but I've removed that dependency

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes, but not with a real scope, only the mocks. I have some concerns about how the model's artowrk will behave in production.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A for now

 * If you changed the UI, has there been a design review?
Adding mpt

To post a comment you must log in.
2844. By Josh Arenson on 2017-03-10

Add license

2845. By Josh Arenson on 2017-03-10

Cleanup

2846. By Josh Arenson on 2017-03-10

One more cleanup

2847. By Josh Arenson on 2017-03-10

Fix tests

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2847
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3333/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4384
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2623
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2623
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4412
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4245
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4245/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4245
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4245/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4245
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4245/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4245
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4245/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4245
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4245/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4245
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4245/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3333/rebuild

review: Approve (continuous-integration)
Andrea Cimitan (cimi) wrote :

comments inline - will think of other small tests we can possibly add

review: Needs Fixing
2848. By Josh Arenson on 2017-03-13

Work around dividers

2849. By Josh Arenson on 2017-03-13

Resolve most review comments

2850. By Josh Arenson on 2017-03-14

Fix whitespace

2851. By Josh Arenson on 2017-03-14

Merge trunk

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2850
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3376/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4450
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2668
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2668
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4478
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4308
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4308/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4308
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4308/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4308
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4308/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4308
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4308/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4308
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4308/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4308
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4308/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3376/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2851
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3381/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4455
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2671
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2671
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4483
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4312
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4312/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4312
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4312/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4312
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4312/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4312
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4312/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4312
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4312/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4312
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4312/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3381/rebuild

review: Needs Fixing (continuous-integration)
Andrea Cimitan (cimi) :
Andrea Cimitan (cimi) :
2852. By Josh Arenson on 2017-03-16

Review fixes

2853. By Josh Arenson on 2017-03-17

Add animation

2854. By Josh Arenson on 2017-03-17

Match ui of system settings

Josh Arenson (josharenson) wrote :

Fixed some things and added a "displacement" animation but I'm not crazy about it. Welcome any suggestions for improving.

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2852
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3429/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4521
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2720
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2720
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4549
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4376
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4376/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4376
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4376/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4376
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4376/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4376
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4376/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4376
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4376/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4376
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4376/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3429/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2854
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3430/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4522
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2721
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2721
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4550
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4377
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4377/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4377
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4377/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4377
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4377/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4377
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4377/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4377
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4377/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4377
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4377/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3430/rebuild

review: Approve (continuous-integration)
Andrea Cimitan (cimi) wrote :

> Fixed some things and added a "displacement" animation but I'm not crazy about
> it. Welcome any suggestions for improving.

I spent a lot of time this morning playing with different animations, I think it's good enough, it's hard to achieve something better because the unpinned item disappears and we can't animate that. FastDuration is correct duration as you used - great. Please put the end bracket in line or add indentation to the rest of the transition :)

Still if you can do the suggestion to make the delegate model-agnostic, exposing properties like title and icon source... thanks!

2855. By Josh Arenson on 2017-03-21

Abstract better

Josh Arenson (josharenson) wrote :

Broke the delegate into 2 separate files and removed all knowledge of parent models to help with abstraction

2856. By Josh Arenson on 2017-03-21

Use listDividers

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2855
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3486/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4601
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2781
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2781
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4629
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4456
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4456/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4456
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4456/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4456
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4456/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4456
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4456/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4456
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4456/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4456
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4456/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3486/rebuild

review: Approve (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2856
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3487/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4602
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2782
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2782
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4630
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4457
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4457/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4457
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4457/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4457
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4457/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4457
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4457/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4457
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4457/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4457
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4457/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3487/rebuild

review: Approve (continuous-integration)
Andrea Cimitan (cimi) wrote :

Pretty good so far, just two minor things:
- why do the dividers have margins?
- we can get rid of the _source and "../" if we change the mocks to return a QVariant with qrc like we do in fake_previewwidgetmodel.cpp? we can add the dash icon to that same resource or create a new one (then fix where it needs to be adjusted)

Andrea Cimitan (cimi) wrote :

Also, we don't neet QtQuick.Window in qml/Dash/Dashboard/DashboardManagerScope.qml

2857. By Josh Arenson on 2017-03-23

Remove unused import

2858. By Josh Arenson on 2017-03-23

Prelim solution

2859. By Josh Arenson on 2017-03-23

Autogen qrc file

2860. By Josh Arenson on 2017-03-23

Filter pngs

Josh Arenson (josharenson) wrote :

Added some, cmake magic (that is either neat, or unacceptable...) that serves up graphics using the qt resource system. This allowed for deleting the nastyness in the qml view. There are a few options here:

1. You like this idea and keep it as is
  1a. Refactor tests that depend on tests/graphics to use qrc

2. Ditch the cmake magic, keep a hardcoded qrc file
   2a. Do this and implement 1a.

3. Something else entirely

As for the margins, I saw that they were in dragItem and not really thinking about how thats an entirely different use case, added them here. I'll remove them in the next commit.

2861. By Josh Arenson on 2017-03-23

Remove margins

Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2861
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3512/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4646
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2808
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2808
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4674
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4501
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4501/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4501
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4501/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4501
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4501/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4501
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4501/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4501
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4501/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4501
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4501/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3512/rebuild

review: Needs Fixing (continuous-integration)
Andrea Cimitan (cimi) wrote :

the qrc doesn't work for me (trying rebranching), also be sure that the other files/tests using that art will still work (maybe something around genericoscopeview or dashcontent)

2862. By Josh Arenson on 2017-03-24

Fix changed path

2863. By Josh Arenson on 2017-03-24

Switch back to old list divider

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2862
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3537/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4684
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2842
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2842
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4712
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4535/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3537/rebuild

review: Approve (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2863
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3542/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4693
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2849
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2849
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4721
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4544
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4544/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4544
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4544/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4544
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4544/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4544
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4544/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4544
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4544/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4544
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4544/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3542/rebuild

review: Approve (continuous-integration)
Matthew Paul Thomas (mpt) wrote :

If you’d like a design review, please link before-and-after movies or screenshots, as appropriate.

review: Needs Information (design)
Andrea Cimitan (cimi) wrote :

http://i.imgur.com/NOZMTFA.png

Left is current system settings, middle this dashboard manager, right the current overview scope list - we tried being consistent with the system settings app, we might also tweak the font for the categories names to be of the same color and style of system settings now that I see

2864. By Josh Arenson on 2017-04-05

merge trunk

2865. By Josh Arenson on 2017-04-05

Change header font/color to look like system-settings

Andrea Cimitan (cimi) wrote :

> http://i.imgur.com/NOZMTFA.png
>
> Left is current system settings, middle this dashboard manager, right the
> current overview scope list - we tried being consistent with the system
> settings app, we might also tweak the font for the categories names to be of
> the same color and style of system settings now that I see

we just changed into http://imgur.com/TyWha5U.png

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2865
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3695/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4909
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/3012
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/3012
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4937
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4745/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3695/rebuild

review: Approve (continuous-integration)

Unmerged revisions

2865. By Josh Arenson on 2017-04-05

Change header font/color to look like system-settings

2864. By Josh Arenson on 2017-04-05

merge trunk

2863. By Josh Arenson on 2017-03-24

Switch back to old list divider

2862. By Josh Arenson on 2017-03-24

Fix changed path

2861. By Josh Arenson on 2017-03-23

Remove margins

2860. By Josh Arenson on 2017-03-23

Filter pngs

2859. By Josh Arenson on 2017-03-23

Autogen qrc file

2858. By Josh Arenson on 2017-03-23

Prelim solution

2857. By Josh Arenson on 2017-03-23

Remove unused import

2856. By Josh Arenson on 2017-03-21

Use listDividers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/DashSectionHeader.qml'
2--- qml/Dash/DashSectionHeader.qml 2016-11-04 10:38:48 +0000
3+++ qml/Dash/DashSectionHeader.qml 2017-04-05 16:15:43 +0000
4@@ -19,9 +19,11 @@
5 import Ubuntu.Components 1.3
6
7 Item {
8- property alias text: label.text
9 property alias color: label.color
10+ property alias fontSize: label.fontSize
11 property alias iconName: icon.name
12+ property alias labelOpacity: label.opacity
13+ property alias text: label.text
14
15 signal clicked(variant mouse)
16
17
18=== added directory 'qml/Dash/Dashboard'
19=== added file 'qml/Dash/Dashboard/DashboardManager.qml'
20--- qml/Dash/Dashboard/DashboardManager.qml 1970-01-01 00:00:00 +0000
21+++ qml/Dash/Dashboard/DashboardManager.qml 2017-04-05 16:15:43 +0000
22@@ -0,0 +1,61 @@
23+/*
24+ * Copyright (C) 2017 Canonical, Ltd.
25+ *
26+ * This program is free software; you can redistribute it and/or modify
27+ * it under the terms of the GNU General Public License as published by
28+ * the Free Software Foundation; version 3.
29+ *
30+ * This program is distributed in the hope that it will be useful,
31+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
32+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33+ * GNU General Public License for more details.
34+ *
35+ * You should have received a copy of the GNU General Public License
36+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
37+ */
38+
39+import QtQuick 2.4
40+import QtQuick.Window 2.2
41+import Ubuntu.Components 1.3
42+import Unity 0.2
43+import "../../Components"
44+
45+MainView {
46+ id: root
47+
48+ anchors.fill: parent
49+
50+ Scopes { id: scopes }
51+
52+ PageHeader {
53+ id: pageHeader
54+ title: i18n.tr("Manage Dashboard")
55+ }
56+
57+ ListView {
58+ id: categoriesContainer
59+ objectName: "categoriesContainer"
60+
61+ anchors {
62+ top: pageHeader.bottom
63+ bottom: parent.bottom
64+ left: parent.left
65+ right: parent.right
66+ }
67+
68+ clip: true
69+ model: scopes.overviewScope ? scopes.overviewScope.categories : null
70+ delegate: DashboardManagerCategory {
71+ categoryId: model.categoryId
72+ categoryName: model.name
73+ categoryResults: model.results
74+ onRequestFavorite: scopes.setFavorite(scopeId, favorite);
75+ }
76+ }
77+
78+ Binding {
79+ target: scopes.overviewScope
80+ property: "isActive"
81+ value: root.visible
82+ }
83+}
84
85=== added file 'qml/Dash/Dashboard/DashboardManagerCategory.qml'
86--- qml/Dash/Dashboard/DashboardManagerCategory.qml 1970-01-01 00:00:00 +0000
87+++ qml/Dash/Dashboard/DashboardManagerCategory.qml 2017-04-05 16:15:43 +0000
88@@ -0,0 +1,85 @@
89+/*
90+ * Copyright (C) 2017 Canonical, Ltd.
91+ *
92+ * This program is free software; you can redistribute it and/or modify
93+ * it under the terms of the GNU General Public License as published by
94+ * the Free Software Foundation; version 3.
95+ *
96+ * This program is distributed in the hope that it will be useful,
97+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
98+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99+ * GNU General Public License for more details.
100+ *
101+ * You should have received a copy of the GNU General Public License
102+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
103+ */
104+
105+import QtQuick 2.4
106+import Ubuntu.Components 1.3
107+import "../../Components"
108+import ".."
109+
110+ListItem {
111+ id: root
112+ objectName: name + "Section"
113+
114+ signal requestFavorite(string scopeId, bool favorite)
115+
116+ property alias categoryId: categoryView.categoryId
117+ property alias categoryName: categoryView.categoryName
118+ property alias categoryResults: categoryView.model
119+
120+ // Expose for testing
121+ readonly property int index: model.index
122+
123+ implicitHeight: layout.height
124+ divider.visible: false
125+
126+ Item {
127+ id: layout
128+
129+ height: categoryView.contentHeight
130+ width: parent.width
131+
132+ ListView {
133+ id: categoryView
134+ objectName: "categoryView"
135+
136+ property string categoryId
137+ property string categoryName
138+
139+ readonly property bool isPinnedToDashboard: categoryId === "favorites"
140+ readonly property bool isAlsoInstalled: categoryId === "other"
141+
142+ height: contentHeight
143+ width: parent.width
144+
145+ header: DashSectionHeader {
146+ visible: results.count > 0
147+ fontSize: "small"
148+ labelOpacity: 0.75
149+ text: {
150+ if (categoryName === "Favorites") {
151+ return i18n.tr("Dashboard");
152+ } else if (categoryName === "Non Favorites") {
153+ return i18n.tr("Also Installed");
154+ } else {
155+ return categoryName;
156+ }
157+ }
158+ }
159+
160+ displaced: Transition {
161+ UbuntuNumberAnimation {
162+ properties: "y"
163+ duration: UbuntuAnimation.FastDuration
164+ }
165+ }
166+
167+ delegate: DashboardManagerScope {
168+ scopeIcon: model.art
169+ scopeId: model.scopeId
170+ }
171+ }
172+ }
173+}
174
175=== added file 'qml/Dash/Dashboard/DashboardManagerScope.qml'
176--- qml/Dash/Dashboard/DashboardManagerScope.qml 1970-01-01 00:00:00 +0000
177+++ qml/Dash/Dashboard/DashboardManagerScope.qml 2017-04-05 16:15:43 +0000
178@@ -0,0 +1,91 @@
179+/*
180+* Copyright (C) 2017 Canonical, Ltd.
181+*
182+* This program is free software; you can redistribute it and/or modify
183+* it under the terms of the GNU General Public License as published by
184+* the Free Software Foundation; version 3.
185+*
186+* This program is distributed in the hope that it will be useful,
187+* but WITHOUT ANY WARRANTY; without even the implied warranty of
188+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
189+* GNU General Public License for more details.
190+*
191+* You should have received a copy of the GNU General Public License
192+* along with this program. If not, see <http://www.gnu.org/licenses/>.
193+*/
194+
195+import QtQuick 2.4
196+import Ubuntu.Components 1.3
197+import Ubuntu.Components.ListItems 1.3 as ListItems
198+import Unity 0.2
199+import "../../Components"
200+
201+ListItem {
202+ readonly property alias innerLayoutPadding: innerLayout.padding
203+
204+ property alias scopeIcon: scopeArtIcon.source
205+ property alias scopeId: innerLayout.scopeId
206+
207+ height: innerLayout.height
208+ width: parent.width
209+
210+ divider.visible: false
211+
212+
213+ Rectangle {
214+ height: units.dp(1);
215+ width: parent.width
216+ anchors.top: parent.top
217+ color: "#eeeeee"
218+ visible: index != 0
219+ }
220+
221+ ListItemLayout {
222+ id: innerLayout
223+ objectName: "layout" + index
224+
225+ property string scopeId
226+
227+ ProportionalShape {
228+ id: scopeArt
229+ height: units.gu(4.5)
230+ SlotsLayout.position: SlotsLayout.Leading
231+
232+ aspect: UbuntuShape.Flat
233+ source: Image {
234+ id: scopeArtIcon
235+
236+ sourceSize.height: scopeArt.height
237+ sourceSize.width: scopeArt.width
238+ }
239+ }
240+
241+ title.text: scopeId
242+
243+ // FIXME: update when pin icon is added to theme
244+ Icon {
245+ objectName: "pinIcon"
246+
247+ height: units.gu(2)
248+ width: units.gu(2)
249+ source: {
250+ if (categoryView.isPinnedToDashboard) {
251+ return "graphics/pinned.png"
252+ } else if (categoryView.isAlsoInstalled) {
253+ return "graphics/unpinned.png"
254+ } else {
255+ return ""
256+ }
257+ }
258+
259+ MouseArea {
260+ objectName: "favoriteButton"
261+
262+ anchors.fill: parent
263+ onClicked: {
264+ root.requestFavorite(scopeId, !categoryView.isPinnedToDashboard)
265+ }
266+ }
267+ }
268+ }
269+}
270
271=== added directory 'qml/Dash/Dashboard/graphics'
272=== added file 'qml/Dash/Dashboard/graphics/pinned@27.png'
273Binary files qml/Dash/Dashboard/graphics/pinned@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/Dashboard/graphics/pinned@27.png 2017-04-05 16:15:43 +0000 differ
274=== added file 'qml/Dash/Dashboard/graphics/unpinned@27.png'
275Binary files qml/Dash/Dashboard/graphics/unpinned@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/Dashboard/graphics/unpinned@27.png 2017-04-05 16:15:43 +0000 differ
276=== modified file 'tests/CMakeLists.txt'
277--- tests/CMakeLists.txt 2017-03-15 18:57:52 +0000
278+++ tests/CMakeLists.txt 2017-04-05 16:15:43 +0000
279@@ -133,7 +133,22 @@
280 FIND_PROGRAM(QDBUSXML2CPP_EXECUTABLE qdbusxml2cpp)
281 endif()
282
283-
284+FILE(GLOB_RECURSE TEST_GRAPHICS_FILE
285+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
286+ graphics/*.png
287+)
288+
289+function(generate_qrc)
290+ SET(qrc_header "<!DOCTYPE RCC><RCC version=\"1.0\"><qresource>")
291+ SET(qrc_footer "</qresource></RCC>")
292+ FOREACH(graphic ${TEST_GRAPHICS_FILE})
293+ STRING(CONCAT qrc_header ${qrc_header} "<file>${graphic}</file>")
294+ ENDFOREACH(graphic)
295+ STRING(CONCAT qrc_header ${qrc_header} ${qrc_footer})
296+ FILE(WRITE graphics.qrc ${qrc_header})
297+endfunction()
298+
299+generate_qrc()
300 install(DIRECTORY data graphics
301 DESTINATION "${SHELL_APP_DIR}/tests"
302 )
303
304=== modified file 'tests/mocks/Unity/CMakeLists.txt'
305--- tests/mocks/Unity/CMakeLists.txt 2017-01-31 13:35:50 +0000
306+++ tests/mocks/Unity/CMakeLists.txt 2017-04-05 16:15:43 +0000
307@@ -22,6 +22,7 @@
308 add_definitions(-DQT_NO_KEYWORDS)
309
310 set(UnityQML_SOURCES
311+ ../../graphics.qrc
312 fake_scope.cpp
313 fake_scopes.cpp
314 fake_scopesoverview.cpp
315
316=== modified file 'tests/mocks/Unity/fake_scopesoverview.cpp'
317--- tests/mocks/Unity/fake_scopesoverview.cpp 2016-05-26 12:52:24 +0000
318+++ tests/mocks/Unity/fake_scopesoverview.cpp 2017-04-05 16:15:43 +0000
319@@ -298,7 +298,7 @@
320 case RoleSubtitle:
321 return scope && scope->name() == "Videos this is long ab cd ef gh ij kl" ? "tube, movies, cinema, pictures, art, moving images, magic in a box" : QString();
322 case RoleArt:
323- return QString("../../tests/graphics/applicationIcons/dash.png");
324+ return QUrl("qrc:graphics/applicationIcons/dash.png");
325 case RoleMascot:
326 case RoleEmblem:
327 case RoleSummary:
328
329=== modified file 'tests/qmltests/CMakeLists.txt'
330--- tests/qmltests/CMakeLists.txt 2017-01-18 14:31:42 +0000
331+++ tests/qmltests/CMakeLists.txt 2017-04-05 16:15:43 +0000
332@@ -41,6 +41,7 @@
333 add_unity8_qmltest_data(Dash artwork)
334 add_unity8_qmltest_data(Dash CardHelpers.js)
335 add_unity8_qmltest_data(Dash tst_PageHeader)
336+add_unity8_qmltest(Dash/Dashboard DashboardManager)
337 add_unity8_qmltest(Dash/Previews Preview)
338 add_unity8_qmltest(Dash/Previews PreviewActions)
339 add_unity8_qmltest(Dash/Previews PreviewAudioPlayback)
340
341=== added directory 'tests/qmltests/Dash/Dashboard'
342=== added file 'tests/qmltests/Dash/Dashboard/tst_DashboardManager.qml'
343--- tests/qmltests/Dash/Dashboard/tst_DashboardManager.qml 1970-01-01 00:00:00 +0000
344+++ tests/qmltests/Dash/Dashboard/tst_DashboardManager.qml 2017-04-05 16:15:43 +0000
345@@ -0,0 +1,85 @@
346+/*
347+ * Copyright 2017 Canonical Ltd.
348+ *
349+ * This program is free software; you can redistribute it and/or modify
350+ * it under the terms of the GNU General Public License as published by
351+ * the Free Software Foundation; version 3.
352+ *
353+ * This program is distributed in the hope that it will be useful,
354+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
355+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
356+ * GNU General Public License for more details.
357+ *
358+ * You should have received a copy of the GNU General Public License
359+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
360+ */
361+
362+import QtQuick 2.4
363+import QtTest 1.0
364+import "../../../../qml/Dash/Dashboard"
365+import Ubuntu.Components 1.3
366+import Unity.Test 0.1 as UT
367+
368+Item {
369+ id: root
370+ width: units.gu(40)
371+ height: units.gu(80)
372+
373+ DashboardManager {
374+ id: dashboardManager
375+ }
376+
377+ UT.UnityTestCase {
378+ name: "ManageDashboard"
379+ when: windowShown
380+
381+ function scrollToCategory(categoryName) {
382+ var container = findChild(dashboardManager, "categoriesContainer")
383+ flickToYBeginning(container);
384+
385+ tryCompareFunction(function(){
386+ var category = findChild(container, categoryName + "Section", 0)
387+ if (category !== null) return true;
388+ touchFlick(container, container.width / 2, units.gu(20), container.width / 2, container.y, true, true, units.gu(2))
389+ tryCompare(container, "moving", false);
390+ return false;
391+ }, true)
392+ }
393+
394+ function test_pinning() {
395+ var container = findChild(dashboardManager, "categoriesContainer")
396+
397+ // Test removing a favorite
398+ scrollToCategory("Favorites");
399+ var favorites_category = findChild(container, "FavoritesSection")
400+ var favorites = findChild(favorites_category, "categoryView")
401+ var first_favorite = findChild(favorites, "layout0");
402+
403+ // scrollToCategory loads the delegate
404+ // and this guarantees that it is visible
405+ container.positionViewAtIndex(favorites_category.index, ListView.Visible);
406+
407+ // Check the icon path as it will be changed in the future
408+ var pin_icon = findChild(first_favorite, "pinIcon");
409+ compare(/graphics\/pinned\.png$/.test(pin_icon.source), true)
410+
411+ var initialFavoritesCount = favorites.count
412+ mouseClick(findChild(first_favorite, "favoriteButton"));
413+ tryCompare(favorites, "count", initialFavoritesCount - 1);
414+
415+ // Test adding a favorite
416+ scrollToCategory("Non Favorites")
417+ var non_favorites_category = findChild(container, "Non FavoritesSection")
418+ var non_favorites = findChild(non_favorites_category, "categoryView")
419+ var first_non_favorite = findChild(non_favorites, "layout0");
420+ container.positionViewAtIndex(non_favorites_category.index, ListView.Visible);
421+
422+ pin_icon = findChild(first_non_favorite, "pinIcon");
423+ compare(/graphics\/unpinned\.png$/.test(pin_icon.source), true)
424+
425+ var initialNonFavoritesCount = non_favorites.count
426+ mouseClick(findChild(first_non_favorite, "favoriteButton"));
427+ tryCompare(non_favorites, "count", initialNonFavoritesCount - 1);
428+ }
429+ }
430+}
431
432=== modified file 'tests/utils/modules/Unity/Test/UnityTestCase.qml'
433--- tests/utils/modules/Unity/Test/UnityTestCase.qml 2017-01-19 16:30:08 +0000
434+++ tests/utils/modules/Unity/Test/UnityTestCase.qml 2017-04-05 16:15:43 +0000
435@@ -283,6 +283,24 @@
436 }
437 }
438
439+ function flickToYBeginning(item) {
440+ if (!item)
441+ qtest_fail("no item given", 1);
442+
443+ var i = 0;
444+ var x = item.width / 2;
445+ var y = units.gu(1);
446+ var toY = item.height - units.gu(1)
447+ var maxIterations = 5 + item.contentHeight / item.height;
448+ while (i < maxIterations && !item.atYBeginning) {
449+ touchFlick(item, x, y, x , toY);
450+ tryCompare(item, "moving", false);
451+ ++i;
452+ }
453+
454+ tryCompare(item, "atYBeginning", true);
455+ }
456+
457 function flickToYEnd(item) {
458 if (!item)
459 qtest_fail("no item given", 1);

Subscribers

People subscribed via source and target branches