Merge lp:~mterry/unity8/split into lp:unity8

Proposed by Michael Terry
Status: Superseded
Proposed branch: lp:~mterry/unity8/split
Merge into: lp:unity8
Diff against target: 4772 lines (+2210/-905)
91 files modified
CMakeLists.txt (+1/-0)
data/51-unity8-greeter.conf (+2/-0)
data/CMakeLists.txt (+13/-0)
data/unity8-greeter-init.conf (+9/-0)
data/unity8-greeter-ofono.conf (+22/-0)
data/unity8-greeter-wrapper (+67/-0)
data/unity8-greeter.desktop.in (+5/-0)
debian/changelog (+6/-0)
debian/control (+16/-0)
debian/copyright (+1/-1)
debian/rules (+0/-4)
debian/unity8-greeter.install (+6/-0)
debian/unity8-private.install (+1/-0)
debian/unity8.install (+0/-1)
plugins/AccountsService/AccountsService.cpp (+34/-11)
plugins/AccountsService/AccountsService.h (+9/-0)
plugins/CMakeLists.txt (+1/-0)
plugins/LightDM/CMakeLists.txt (+6/-9)
plugins/LightDM/URLDispatcher.cpp (+55/-0)
plugins/LightDM/URLDispatcher.h (+34/-0)
plugins/LightDM/plugin.cpp (+9/-0)
plugins/SessionBroadcast/SessionBroadcast.cpp (+30/-0)
plugins/SessionBroadcast/SessionBroadcast.h (+10/-0)
plugins/SessionManager/CMakeLists.txt (+27/-0)
plugins/SessionManager/SessionManager.cpp (+107/-0)
plugins/SessionManager/SessionManager.h (+60/-0)
plugins/SessionManager/plugin.cpp (+35/-0)
plugins/SessionManager/plugin.h (+35/-0)
plugins/SessionManager/qmldir (+2/-0)
qml/Components/BasicShell.qml (+84/-0)
qml/Components/EdgeDemo.qml (+1/-53)
qml/Components/Lockscreen.qml (+0/-19)
qml/Components/PageHeader.qml (+3/-2)
qml/Dash/ScopeListView.qml (+3/-2)
qml/Greeter/Clock.qml (+1/-1)
qml/Greeter/Greeter.qml (+147/-53)
qml/Greeter/GreeterContent.qml (+51/-54)
qml/Greeter/GreeterEdgeDemo.qml (+102/-0)
qml/Greeter/Infographics.qml (+3/-2)
qml/GreeterShell.qml (+285/-0)
qml/Hud/Hud.qml (+2/-5)
qml/Notifications/NotificationMenuItemFactory.qml (+0/-1)
qml/Panel/Panel.qml (+1/-1)
qml/Shell.qml (+38/-195)
run (+6/-4)
src/CMakeLists.txt (+15/-3)
src/main.cpp (+16/-4)
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py (+3/-7)
tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py (+0/-1)
tests/autopilot/unity8/indicators/tests/test_indicators.py (+0/-2)
tests/autopilot/unity8/process_helpers.py (+0/-57)
tests/autopilot/unity8/shell/tests/__init__.py (+16/-4)
tests/autopilot/unity8/shell/tests/disabled_test_hud.py (+1/-7)
tests/autopilot/unity8/shell/tests/test_emulators.py (+0/-1)
tests/autopilot/unity8/shell/tests/test_lock_screen.py (+12/-13)
tests/autopilot/unity8/shell/tests/test_notifications.py (+0/-11)
tests/mocks/AccountsService/AccountsService.cpp (+9/-0)
tests/mocks/AccountsService/AccountsService.h (+7/-0)
tests/mocks/CMakeLists.txt (+2/-1)
tests/mocks/LightDM/demo/CMakeLists.txt (+0/-21)
tests/mocks/LightDM/demo/GreeterPrivate.cpp (+0/-70)
tests/mocks/LightDM/demo/UsersModelPrivate.cpp (+0/-41)
tests/mocks/LightDM/qmldir (+0/-2)
tests/mocks/SessionManager/CMakeLists.txt (+19/-0)
tests/mocks/SessionManager/SessionManager.cpp (+43/-0)
tests/mocks/SessionManager/SessionManager.h (+49/-0)
tests/mocks/SessionManager/plugin.cpp (+34/-0)
tests/mocks/SessionManager/plugin.h (+34/-0)
tests/mocks/SessionManager/qmldir (+2/-0)
tests/mocks/liblightdm/CMakeLists.txt (+0/-53)
tests/mocks/liblightdm/full/CMakeLists.txt (+3/-2)
tests/mocks/liblightdm/single-passphrase/CMakeLists.txt (+3/-2)
tests/mocks/liblightdm/single-pin/CMakeLists.txt (+3/-2)
tests/mocks/liblightdm/single/CMakeLists.txt (+3/-2)
tests/plugins/CMakeLists.txt (+2/-1)
tests/plugins/LightDM/CMakeLists.txt (+5/-4)
tests/plugins/SessionManager/CMakeLists.txt (+48/-0)
tests/plugins/SessionManager/LightDMSessionServer.cpp (+38/-0)
tests/plugins/SessionManager/LightDMSessionServer.h (+40/-0)
tests/plugins/SessionManager/LoginManagerServer.cpp (+34/-0)
tests/plugins/SessionManager/LoginManagerServer.h (+37/-0)
tests/plugins/SessionManager/LoginSessionServer.cpp (+25/-0)
tests/plugins/SessionManager/LoginSessionServer.h (+39/-0)
tests/plugins/SessionManager/client.cpp (+88/-0)
tests/plugins/SessionManager/interfaces.xml (+22/-0)
tests/plugins/SessionManager/server.cpp (+57/-0)
tests/qmltests/CMakeLists.txt (+36/-48)
tests/qmltests/Greeter/tst_Phone.qml (+11/-67)
tests/qmltests/Greeter/tst_Tablet.qml (+36/-8)
tests/qmltests/tst_GreeterShell.qml (+79/-0)
tests/qmltests/tst_Shell.qml (+9/-53)
To merge this branch: bzr merge lp:~mterry/unity8/split
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Needs Fixing
Review via email: mp+210664@code.launchpad.net

This proposal has been superseded by a proposal from 2014-03-27.

Commit message

Split the welcome screen into its own executable and allow it to be a proper LightDM greeter.

Description of the change

Split the welcome screen into its own executable and allow it to be a proper LightDM greeter.

Phew! Long time coming. First commit to this branch back in July 2013! It's just taken whipping the rest of the system into shape to avoid regressions to make this landable.

List of major changes and notes:
- Adds new executable (unity8-greeter) that gets its own package. This uses the same main.cpp as unity8, but with different Qml and a few #ifdef tweaks.
- Adds a new plugin SessionManager so that bits of code can still know if the session is active. Since rather integral code (PageHeader.qml) uses the plugin, I added the plugin directory to the default qmluitests list of includes. This cleaned up that CMakeLists.txt file considerably.
- Expands existing plugin SessionBroadcast to actually make requests of unity-greeter-session-broadcast (i.e. use the greeter-side of its API). This involves adding a Depends on that program.
- I had to split the current edge demo support in two (part of it is in greeter, part of it is in user session).
- Similarly, I split Shell.qml into three files: Shell.qml, GreeterShell.qml, and Components/BasicShell.qml (for shared code).
- We no longer use demo data for the greeter in production (still do in tests of course).
- I added a new -G option to ./run to get the greeter.
- And the expected new tests and test changes.

== Known Regressions ==
- The messaging menu will not show contact info in the greeter. You will see numbers, but not avatar/name. Design never really finished fleshing out the indicator experience in the greeter. Wanted to see it land first, I've heard. Ted knows more about state there.
- When turning off the display, if you turn it back on within a few seconds, you just see a spinner animation. This is expected. It's waiting for the greeter to come up again. I believe we can get it to come up faster in future, and/or come up with a clever way to let you cancel a lock request (but that might require lightdm changes and be a post-14.04 change).

== Checklist ==
 * Are there any related MPs required for this MP to build/function as expected? Please list.
- (Note none of these are needed to build or play around with split -- they all just enhance the experience / fix bugs)
- lp:~mterry/session-manager-touch/split
- lp:~unity-team/unity-system-compositor/new-gl-screen
- lp:~mterry/unity-system-compositor/switch-after-buffers
- lp:~mterry/gsettings-ubuntu-touch-schemas/volume
- Mir 0.1.18

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 - Yes.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 - There are packaging changes, but I'm in that team.

 * If you changed the UI, has there been a design review?
 - The only UI changes in this set of branches are boot animation oriented. This branch fades in greeter elements and lp:~mterry/session-manager-touch/split enables a boot/interstitial animation. Design review is coming.

To post a comment you must log in.
lp:~mterry/unity8/split updated
197. By Michael Terry

Drop unused code

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:197
http://jenkins.qa.ubuntu.com/job/unity8-ci/2475/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3858
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3443/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1345
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/996
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1000
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1000/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/996
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3383
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3885
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3885/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3445
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3445/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5801/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4722

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2475/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
198. By Michael Terry

Move hideIndicatorMenu to be shared between greeter and shell, as both have indicators that want to call it

199. By Michael Terry

Start maliit-server in greeter

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:199
http://jenkins.qa.ubuntu.com/job/unity8-ci/2486/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3883
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3468/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1356
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1007
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1011
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1011/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1007
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3399
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3910
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3910/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3470
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3470/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5817/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4748

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2486/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
200. By Michael Terry

clear greeter mir socket on greeter start

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:200
http://jenkins.qa.ubuntu.com/job/unity8-ci/2489/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3895
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3480/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1359
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1010
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1014
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1014/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1010
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3404
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3924
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3924/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3482
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3482/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5821/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4754

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2489/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Doesn't merge cleanly with trunk

review: Needs Fixing
lp:~mterry/unity8/split updated
201. By Michael Terry

Merge from trunk

202. By Michael Terry

Merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:202
http://jenkins.qa.ubuntu.com/job/unity8-ci/2524/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3996
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3581/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1394
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1045
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1049
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1049/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1045
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3488
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4032
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4032/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3583
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3583/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5913/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4876

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2524/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
203. By Michael Terry

Move OSKController to end of shell files, so that input is grabbed appropriately

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:203
http://jenkins.qa.ubuntu.com/job/unity8-ci/2525/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3998
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3583/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1395
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1046
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1050
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1050/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1046
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3490
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4037
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4037/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3585
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3585/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5915/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4881

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2525/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Shouldn't you use m_user instead of qgetenv("USER") ?

Revision history for this message
Albert Astals Cid (aacid) wrote :

I suggest to use QProcess::startDetached in Upstart.cpp so that we don't need to keep the QProcess around in memory forever. Also i guess it would make sense to check that we can start it properly and fail gracefully if not?

lp:~mterry/unity8/split updated
204. By Michael Terry

Move upstart launching to wrapper script

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:204
http://jenkins.qa.ubuntu.com/job/unity8-ci/2568/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4093
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3677/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1438
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1089
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1093
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1093/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1089
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3573
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4145
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4145/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3679
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3679/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5999/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5010

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2568/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
205. By Michael Terry

Adjust to new UGSB api

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Albert, I moved the /sbin/init call to unity8-greeter-wrapper. This way it will be easier once we add a wizard (which will likely be launched from the wrapper and want /sbin/init too). So that's another way of fixing the use of QProcess I guess. :)

Regarding qgetenv("USER") vs m_user. m_user is the currently selected user. qgetenv("USER") is obviously the user for the session. We use the latter in "ForCurrentUser" methods which are called for the lightdm user (rather than the selected user). Like noting that the greeter edge demo has been run (vs the edge demo for a user).

lp:~mterry/unity8/split updated
206. By Michael Terry

Merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:206
http://jenkins.qa.ubuntu.com/job/unity8-ci/2584/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4122
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3706/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1454
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1105
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1109
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1109/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1105
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3595
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4183
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4183/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3708
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3708/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6022/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5050

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2584/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
207. By Michael Terry

Set language for greeter environment if user has set one

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:207
http://jenkins.qa.ubuntu.com/job/unity8-ci/2606/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4182
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3766/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1476
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1127
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1131
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1131/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1127
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3637
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4250
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4250/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3768
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3768/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6067/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5126

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2606/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
208. By Michael Terry

Merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:208
http://jenkins.qa.ubuntu.com/job/unity8-ci/2615/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4208
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3792/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1485
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1136
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1140
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1140/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1136
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3656
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4281
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4281/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3794
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3794/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6092/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5160

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2615/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Should unity8-greeter package declare it's dependency in libglib2.0-bin since the greeter-wrapper script ends up in that package and is using the gdbus command?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

In AccountsService constructor you have
  m_user(qgetenv("USER")),
and then
  setUser(qgetenv("USER"));

I guess you can remove the first one and save a getenv call?

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

In AccountsService constructor you have
    setUser(qgetenv("USER"));
    updateDemoEdgesForCurrentUser();
couldn't you use
    updateDemoEdges();
and save a getenv call?

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

You don't emit the changed signal from setDemoEdgesForCurrentUser neither from setDemoEdges

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Can you explain why we need demoEdgesForCurrentUser() and demoEdges() to be separate?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

Remove
+#include <QProcess>
+#include <unistd.h>
from URLDispatcher.cpp

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Replace
+#include <QtQml>
by
+#include <QtQml/qqml.h>

No need to include 30 files without need :)

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Do you really need m_parent in URLDispatcherInterface ? I mean you're forcing the URLDispatcherInterface constructor to get a URLDispatcher *parent parameter that you pass down to QObject so we could just save the m_parent pointer and in ::DispatchURL just do static_cast<URLDispatcher *>(parent()), no?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

I'd remove the m_broadcaster(NULL) myself since you're initializing it like 3 lines below, but if you really want to initialize it at least use nullptr

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

With this we don't get the greeter anymore when doing ./run i guess that's ok?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

./run -G on my desktop gives me a phone shaped UI but shows me users unlike trunk does, is this on purpose?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

Remove tests/autopilot/unity8/shell/tests/test_greeter.py.THIS

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Why all those changes in tests/qmltests/CMakeLists.txt ?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

No test replacement for test_searchIndicatorHidesOnGreeterShown ?

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

After installing all the resulting packages of this branch and restarting the phone the greeter does not show up on reboot.

review: Needs Fixing
lp:~mterry/unity8/split updated
209. By Michael Terry

Add back accidentally remove input filter area

210. By Michael Terry

Fade in different components as design wants

211. By Michael Terry

Fix some review nits

Revision history for this message
Michael Terry (mterry) wrote :

- Made unity8-greeter Depend on libglib2.0-bin
- Dropped extra qgetenv call in AccountsService constructor
- Removed extra headers from URLDispatcher.cpp
- Switched to <QtQml/qqml.h>
- Dropped m_parent from URLDispatcherInterface
- Dropped m_broadcaster(NULL)
- Removed tests/autopilot/unity8/shell/tests/test_greeter.py.THIS

- Yeah, it's expected that ./run no longer gives greeter. And if you want to use mocks with -G, you need to also pass -f, like ./run -fG

- So the deal with demoEdgesForCurrentUser and demoEdges. The AccountsService plugin as a whole points at a single user for its various values (statsWelcomeScreen, backgroundFile, etc). When in the session, we want that to be the current user ($USER). In the greeter, that will be whomever is selected in the greeter (think multi-user case). So that's why m_user defaults to $USER but is changeable. But consider the case of the edge demo. There is a greeter component to that and a user session component. The greeter decides to show its edge demo based on the lightdm user's field. But if the user skips the demo from the greeter, the greeter needs to set the user's edge demo field to false too, so the user doesn't see it once they log in. So I added a special member variable demoEdgesForCurrentUser that always tracks the current user that the greeter could use for its own demo decision and it could continue using demoEdges to set the user's demo field to false if it wanted to. That's why they are completely separate fields.

- tests/qmltests/CMakeLists.txt has all those changes because of the change in qml/Components/PageHeader.qml. It needed to start using the SessionManager plugin (to reset search when screen is locked). So any test using it needed to start using the mock plugin search path. And looking through the tests, almost every test either already had the binary plugin dir manually specified or would need it because of this change. So I added it to the default includes for tests. And that let me clean up nearly all the test calls to not need manually specified paths.

- test_searchIndicatorHidesOnGreeterShown has no replacement because it doesn't make sense anymore. In greeter, the search indicator is never shown. And in the session, when the session is locked, it doesn't care about hiding the search indicator since it doesn't share a panel with the greeter anymore.

- I'm not sure why nothing showed up for you on reboot. Except maybe you didn't rebuild the various packages depending on Mir 0.1.18 (platform-api, unity-mir)? It might be easiest to use the PPA we're using for testing: https://launchpad.net/~ci-train-ppa-service/+archive/landing-004

lp:~mterry/unity8/split updated
212. By Michael Terry

Move lockscreen files to Components so that notifications can use them

213. By Michael Terry

Hide lockscreen that might appear behind greeter until greeter finishes fading in

214. By Michael Terry

Drop dbus-x11 dep (we use gdbus now) and ubuntu-touch-session dep (it will depend on us, not the other way)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:211
http://jenkins.qa.ubuntu.com/job/unity8-ci/2625/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4237
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3821/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1495
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1146
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1150
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1150/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1146
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3675
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4311
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4311/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3823
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3823/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6112/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5190

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2625/rebuild

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

FAILED: Continuous integration, rev:214
http://jenkins.qa.ubuntu.com/job/unity8-ci/2629/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4241
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3825/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1499
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1150
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1154
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1154/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1150
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3677
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4315
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4315/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3827
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3827/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6114/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5192

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2629/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
215. By Michael Terry

Edge demo fixes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:215
http://jenkins.qa.ubuntu.com/job/unity8-ci/2630/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4249
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3833/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1500
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1151
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1155
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1155/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1151
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3684
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4323
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4323/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3835
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3835/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6121/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5199

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2630/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
216. By Michael Terry

Only use ubuntu-touch-session if available

217. By Michael Terry

Workaround accountsservice bug with system user data

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:216
http://jenkins.qa.ubuntu.com/job/unity8-ci/2631/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4250
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3834/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1501
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1152
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1156
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1156/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1152
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3685
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4325
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4325/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3836
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3836/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6122/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5202

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2631/rebuild

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

FAILED: Continuous integration, rev:217
http://jenkins.qa.ubuntu.com/job/unity8-ci/2633/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4252
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3836/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1503
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1158
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1158/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3687
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4328
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4328/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3838
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3838/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6124/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5204

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2633/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
218. By Michael Terry

Keep infographic animations same speed

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:218
http://jenkins.qa.ubuntu.com/job/unity8-ci/2637/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4266
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3851/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1507
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1158
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1162
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1162/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1158
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3695
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4350
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4350/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3853
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3853/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6134/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5223

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2637/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
219. By Michael Terry

Depend on dbus-x11 for dbus-launch

220. By Michael Terry

Lazily start indicators, and only once unity8 is ready to receive them

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:220
http://jenkins.qa.ubuntu.com/job/unity8-ci/2644/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4286
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3871/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1514
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1165
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1169
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1169/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1165
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3712
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4371
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4371/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3873
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3873/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6152/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5250

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2644/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
221. By Michael Terry

Handle needing to wait for ofonod on first boot

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:221
http://jenkins.qa.ubuntu.com/job/unity8-ci/2656/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4317
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3916/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1526
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1177
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1181
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1181/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1177
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3740
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4416
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4416/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3918
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3918/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6197/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5325

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2656/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
222. By Michael Terry

Merge in greeter-ux-fixes branch

223. By Michael Terry

Merge greeter-ux-fixes again

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:222
http://jenkins.qa.ubuntu.com/job/unity8-ci/2658/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4321
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3920/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1528
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1179
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1183
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1183/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1179
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3744
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4420
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4420/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3922
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3922/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6201/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5332

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2658/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/split updated
224. By Michael Terry

Merge in greeter-ux-fixes

225. By Michael Terry

Merge from greeter-ux-fixes

226. By Michael Terry

Merge from greeter-ux-fixes

227. By Michael Terry

Move the unity8-greeter-started upstart event into src/main.cpp where maliit will be ready to go instead of just crashing

228. By Michael Terry

Add unity8-greeter-starting emission so we can start the wizard that way if we want

229. By Michael Terry

Merge from greeter-ux-fixes

230. By Michael Terry

Merge from trunk

231. By Michael Terry

Set language after starting upstart job to let customization do it's thing

232. By Michael Terry

Merge from greeter-ux-fixes

233. By Michael Terry

Pretend that the greeter session is an ubuntu-touch session, so that indicator-network will start

234. By Michael Terry

Test

235. By Michael Terry

Fix indicators not coming up in split session

236. By Michael Terry

Remove testing code that slipped in

237. By Michael Terry

Use new resettable support in lightdm

238. By Michael Terry

Merge from trunk

239. By Michael Terry

Merge from trunk

240. By Michael Terry

Remove fade in animations for now

241. By Michael Terry

Merge from trunk

242. By Michael Terry

Merge from trunk

243. By Michael Terry

Fix debian/changelog

244. By Michael Terry

Mark as resettable before connecting to LightDM

245. By Michael Terry

Specify minimum version of liblightdm needed

246. By Michael Terry

Completely remove fade-in animations for now; this removes the last visual change in the split greeter

247. By Michael Terry

Fix autopilot tests

248. By Michael Terry

Stop the swipe hint animation when greeter is swiped away

249. By Michael Terry

Fix syncing of stored launcher items

250. By Michael Terry

Disable ofono using pulseaudio

251. By Michael Terry

Merge from trunk

252. By Michael Terry

Just launch ofono-setup; it's what session does now and ofonod doesn't use its upstart job anymore apparently

253. By Michael Terry

Add back darkener-rectangle for infographic use

254. By Michael Terry

Consolidate unity8-greeter session upstart scripts

255. By Michael Terry

Merge from trunk

256. By Michael Terry

Review fixes

257. By Michael Terry

Merge from trunk

258. By Michael Terry

Drop unneeded QScreen include

259. By Michael Terry

Specify USC_SOCKET in lightdm's init session, so anyone that wants to can find USC (like the welcome wizard

260. By Michael Terry

Whoops, requestHomeShown support must have gotten lost in a merge

261. By Michael Terry

Workaround bug in logind not telling us when a session becomes inactive, and also hide launcher when that happens

262. By Michael Terry

Merge from trunk

263. By Michael Terry

Remove unneeded Revealer, especially since the Revealer class is dead

264. By Michael Terry

Animate away the tablet greeter when clicking Tap to Unlock

265. By Michael Terry

Set locale as well as language when starting greeter

266. By Michael Terry

Move alpha-setting down so we don't show some extra frames with transparency

267. By Michael Terry

Fix background for sim lockscreen

268. By Michael Terry

Make launcher available in tablet mode again

269. By Michael Terry

Hide indicators as well as launcher when session becomes inactive

270. By Michael Terry

Merge from trunk

271. By Michael Terry

Fix notification margins

272. By Michael Terry

Merge from trunk

273. By Michael Terry

Handle short appIds in launcher data

274. By Michael Terry

Add method to mock

275. By Michael Terry

undo accidental commits

276. By Michael Terry

More reliably mark greeter as re-enabled

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-01-30 22:32:37 +0000
3+++ CMakeLists.txt 2014-03-27 20:58:22 +0000
4@@ -96,6 +96,7 @@
5 declare_autopilot_test(shell unity8.shell ${CMAKE_SOURCE_DIR}/tests/autopilot/)
6
7 set(SHELL_APP unity8)
8+set(GREETER_APP unity8-greeter)
9 set(SCOPE_TOOL unity-scope-tool)
10
11 include_directories(
12
13=== added file 'data/51-unity8-greeter.conf'
14--- data/51-unity8-greeter.conf 1970-01-01 00:00:00 +0000
15+++ data/51-unity8-greeter.conf 2014-03-27 20:58:22 +0000
16@@ -0,0 +1,2 @@
17+[SeatDefaults]
18+greeter-session=unity8-greeter
19
20=== modified file 'data/CMakeLists.txt'
21--- data/CMakeLists.txt 2013-12-20 15:37:27 +0000
22+++ data/CMakeLists.txt 2014-03-27 20:58:22 +0000
23@@ -1,8 +1,21 @@
24 # generate desktop file
25 configure_file(${SHELL_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop @ONLY)
26+configure_file(${GREETER_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop @ONLY)
27 configure_file(${SCOPE_TOOL}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_TOOL}.desktop @ONLY)
28
29 # install desktop files
30 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop ${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_TOOL}.desktop
31 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
32 )
33+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop
34+ DESTINATION ${CMAKE_INSTALL_DATADIR}/lightdm/greeters
35+ )
36+install(FILES 51-${GREETER_APP}.conf
37+ DESTINATION ${CMAKE_INSTALL_DATADIR}/lightdm/lightdm.conf.d
38+ )
39+install(FILES ${GREETER_APP}-wrapper
40+ DESTINATION ${CMAKE_INSTALL_BINDIR}
41+ )
42+install(FILES unity8-greeter-init.conf unity8-greeter-ofono.conf
43+ DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions
44+ )
45
46=== added file 'data/unity8-greeter-init.conf'
47--- data/unity8-greeter-init.conf 1970-01-01 00:00:00 +0000
48+++ data/unity8-greeter-init.conf 2014-03-27 20:58:22 +0000
49@@ -0,0 +1,9 @@
50+description "Unity 8 Greeter initialization"
51+author "Michael Terry <mterry@ubuntu.com>"
52+
53+start on unity8-greeter-started
54+task
55+
56+script
57+ start --no-wait maliit-server || true
58+end script
59
60=== added file 'data/unity8-greeter-ofono.conf'
61--- data/unity8-greeter-ofono.conf 1970-01-01 00:00:00 +0000
62+++ data/unity8-greeter-ofono.conf 2014-03-27 20:58:22 +0000
63@@ -0,0 +1,22 @@
64+description "Unity 8 Greeter ofono start"
65+author "Michael Terry <mterry@ubuntu.com>"
66+
67+start on unity8-greeter-started
68+stop on started :sys:ofono
69+task
70+
71+script
72+ # Is ofonod ready?
73+ if pidof onofod >/dev/null; then
74+ stop
75+ else
76+ # Wait 30 seconds. If ofono starts earlier, upstart will kill us.
77+ # If 30 seconds go by, try starting ofono-setup anyway, but it will
78+ # probably fail.
79+ sleep 30
80+ fi
81+end script
82+
83+post-stop script
84+ start --no-wait ofono-setup
85+end script
86
87=== added file 'data/unity8-greeter-wrapper'
88--- data/unity8-greeter-wrapper 1970-01-01 00:00:00 +0000
89+++ data/unity8-greeter-wrapper 2014-03-27 20:58:22 +0000
90@@ -0,0 +1,67 @@
91+#!/bin/sh
92+# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
93+#
94+# Copyright (C) 2011,2013 Canonical Ltd
95+# Author: Michael Terry <michael.terry@canonical.com>
96+#
97+# This program is free software: you can redistribute it and/or modify it under
98+# the terms of the GNU General Public License as published by the Free Software
99+# Foundation, version 3 of the License.
100+#
101+# See http://www.gnu.org/copyleft/gpl.html the full text of the license.
102+
103+# This wrapper merely ensures that init and friends live only as long as this
104+# script does. Otherwise, it's very easy for some processes to not notice that
105+# the session died. We could try to do this in-process, but we want to do this
106+# cleanup even if the greeter aborts.
107+
108+trap cleanup TERM EXIT
109+
110+cleanup()
111+{
112+ trap - TERM EXIT
113+ # Kill upstart and indicators
114+ pkill -u lightdm -x init
115+ if [ -n "$CMD_PID" ]; then
116+ kill "$CMD_PID"
117+ fi
118+ exit 0
119+}
120+
121+# Define language here for phone if available. When phone user switches their
122+# language, they expect that to affect the greeter too. But the user doesn't
123+# have permission to switch system language, only their own. So we notice if
124+# the phablet user exists and use their language if so. TODO: talk to design
125+# about whether we should switch language on fly as users are selected (this
126+# is very hard to do technically).
127+if [ "$(id -u phablet 2>/dev/null)" = "32011" ]; then
128+ USER_LANG=$(gdbus call --system --dest org.freedesktop.Accounts --object-path /org/freedesktop/Accounts/User32011 --method org.freedesktop.DBus.Properties.Get org.freedesktop.Accounts.User Language | cut -d\' -f2)
129+ if [ -n "$USER_LANG" ]; then
130+ export LANGUAGE="$USER_LANG"
131+ fi
132+fi
133+
134+SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
135+rm -f $SUB_SOCKET # clear socket in case we were hard shut down
136+
137+# If touch session script (which sets up grid units and mir variables) is available, use it
138+TOUCH_WRAPPER=
139+if [ -x /usr/bin/ubuntu-touch-session ]; then
140+ TOUCH_WRAPPER=/usr/bin/ubuntu-touch-session
141+fi
142+
143+# Normal unity8 sessions are entirely driven by Upstart. But greeters
144+# are special. They need access to the file descriptors that lightdm
145+# creates for them and don't want to start all the services that a normal
146+# session would. So it's inconvenient to live within an upstart session.
147+# But... we still want to use Upstart for some services. So launch here.
148+MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/init --user --startup-event=unity8-greeter-started &
149+INIT_PID=$!
150+while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
151+export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut -d' ' -f2)
152+
153+export MIR_SERVER_FILE=$SUB_SOCKET
154+exec $TOUCH_WRAPPER $@ &
155+CMD_PID=$!
156+wait $CMD_PID
157+CMD_PID=
158
159=== added file 'data/unity8-greeter.desktop.in'
160--- data/unity8-greeter.desktop.in 1970-01-01 00:00:00 +0000
161+++ data/unity8-greeter.desktop.in 2014-03-27 20:58:22 +0000
162@@ -0,0 +1,5 @@
163+[Desktop Entry]
164+Type=Application
165+Name=Unity 8 Greeter
166+Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-greeter-wrapper @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-greeter
167+X-LightDM-Session-Type=mir
168
169=== modified file 'debian/changelog'
170--- debian/changelog 2014-03-24 16:10:24 +0000
171+++ debian/changelog 2014-03-27 20:58:22 +0000
172@@ -1,3 +1,9 @@
173+unity8 (7.85+14.04.20140306-0ubuntu1) UNRELEASED; urgency=medium
174+
175+ * Bump version for Breaks due to unity8-greeter
176+
177+ -- Michael Terry <mterry@ubuntu.com> Wed, 12 Mar 2014 14:39:45 -0400
178+
179 unity8 (7.84+14.04.20140324.4-0ubuntu1) trusty; urgency=low
180
181 [ Michal Hruby ]
182
183=== modified file 'debian/control'
184--- debian/control 2014-03-24 11:49:06 +0000
185+++ debian/control 2014-03-27 20:58:22 +0000
186@@ -15,6 +15,7 @@
187 libhud-client2-dev,
188 libnih-dbus-dev,
189 libnih-dev,
190+ liblightdm-qt5-3-dev,
191 libpulse-dev,
192 libqmenumodel-dev (>= 0.2.7),
193 libunity-api-dev (>= 7.80.4),
194@@ -83,6 +84,7 @@
195 qtdeclarative5-ubuntu-ui-toolkit-plugin,
196 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
197 qtdeclarative5-xmllistmodel-plugin,
198+ unity-greeter-session-broadcast,
199 unity-launcher-impl-3,
200 unity-notifications-impl-2,
201 unity8-fake-env | qtubuntu-shell,
202@@ -102,6 +104,19 @@
203 Description: Unity 8 shell
204 The Unity 8 shell is the primary user interface for Ubuntu devices.
205
206+Package: unity8-greeter
207+Architecture: any
208+Depends: dbus-x11,
209+ libglib2.0-bin,
210+ lightdm,
211+ unity8 (>= ${source:Version}),
212+ ${misc:Depends},
213+ ${shlibs:Depends},
214+Replaces: unity8 (<< 7.85),
215+Breaks: unity8 (<< 7.85),
216+Description: Ubuntu QML greeter
217+ The Ubuntu QML greeter is the primary greeter for Ubuntu devices.
218+
219 Package: unity8-autopilot
220 Architecture: all
221 Depends: gir1.2-glib-2.0,
222@@ -120,6 +135,7 @@
223 ubuntu-ui-toolkit-autopilot,
224 unity8 (>= ${source:Version}),
225 unity8-fake-env (>= ${source:Version}),
226+ unity8-greeter (>= ${source:Version}),
227 url-dispatcher-tools,
228 ${misc:Depends},
229 ${python:Depends},
230
231=== modified file 'debian/copyright'
232--- debian/copyright 2013-06-26 08:16:38 +0000
233+++ debian/copyright 2014-03-27 20:58:22 +0000
234@@ -22,7 +22,7 @@
235 On Debian systems, the full text of the GNU General Public License
236 version 3 can be found in the file /usr/share/common-licenses/GPL-3.
237
238-Files: tests/mocks/LightDM/UsersModel.h tests/mocks/LightDM/Greeter.h
239+Files: tests/mocks/liblightdm/UsersModel.h tests/mocks/liblightdm/Greeter.h
240 Copyright: 2013 Canonical Ltd.
241 2010-2011 David Edmundson
242 2010-2011 Robert Ancell
243
244=== modified file 'debian/rules'
245--- debian/rules 2014-03-24 11:32:45 +0000
246+++ debian/rules 2014-03-27 20:58:22 +0000
247@@ -35,7 +35,3 @@
248 # use private lib directories
249 override_dh_makeshlibs:
250 dh_makeshlibs -Nunity8-private -Nunity8-fake-env
251-
252-# libMockLightDM-qml.so links against liblightdm-qt5-2.so which doesn't exist
253-override_dh_shlibdeps:
254- dh_shlibdeps -XlibMockLightDM-qml.so
255
256=== added file 'debian/unity8-greeter.install'
257--- debian/unity8-greeter.install 1970-01-01 00:00:00 +0000
258+++ debian/unity8-greeter.install 2014-03-27 20:58:22 +0000
259@@ -0,0 +1,6 @@
260+usr/bin/unity8-greeter
261+usr/bin/unity8-greeter-wrapper
262+usr/share/lightdm
263+usr/share/unity8/GreeterShell.qml
264+usr/share/unity8/Greeter
265+usr/share/upstart/sessions/unity8-greeter-*.conf
266
267=== modified file 'debian/unity8-private.install'
268--- debian/unity8-private.install 2013-12-12 16:45:35 +0000
269+++ debian/unity8-private.install 2014-03-27 20:58:22 +0000
270@@ -4,6 +4,7 @@
271 usr/lib/*/unity8/qml/DashViews
272 usr/lib/*/unity8/qml/Powerd
273 usr/lib/*/unity8/qml/SessionBroadcast
274+usr/lib/*/unity8/qml/SessionManager
275 usr/lib/*/unity8/qml/Ubuntu
276 usr/lib/*/unity8/qml/Unity
277 usr/lib/*/unity8/qml/Utils
278
279=== modified file 'debian/unity8.install'
280--- debian/unity8.install 2014-03-05 12:52:57 +0000
281+++ debian/unity8.install 2014-03-27 20:58:22 +0000
282@@ -4,7 +4,6 @@
283 usr/share/unity8/Bottombar
284 usr/share/unity8/Components
285 usr/share/unity8/Dash
286-usr/share/unity8/Greeter
287 usr/share/unity8/Hud
288 usr/share/unity8/Launcher
289 usr/share/unity8/Notifications
290
291=== modified file 'plugins/AccountsService/AccountsService.cpp'
292--- plugins/AccountsService/AccountsService.cpp 2013-10-11 13:32:36 +0000
293+++ plugins/AccountsService/AccountsService.cpp 2014-03-27 20:58:22 +0000
294@@ -24,7 +24,6 @@
295 AccountsService::AccountsService(QObject* parent)
296 : QObject(parent),
297 m_service(new AccountsServiceDBusAdaptor(this)),
298- m_user(qgetenv("USER")),
299 m_demoEdges(false),
300 m_statsWelcomeScreen(false)
301 {
302@@ -32,6 +31,9 @@
303 this, SLOT(propertiesChanged(const QString &, const QString &, const QStringList &)));
304 connect(m_service, SIGNAL(maybeChanged(const QString &)),
305 this, SLOT(maybeChanged(const QString &)));
306+
307+ setUser(qgetenv("USER"));
308+ updateDemoEdgesForCurrentUser();
309 }
310
311 QString AccountsService::user() const
312@@ -57,9 +59,22 @@
313 void AccountsService::setDemoEdges(bool demoEdges)
314 {
315 m_demoEdges = demoEdges;
316+ Q_EMIT demoEdgesChanged();
317 m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
318 }
319
320+bool AccountsService::demoEdgesForCurrentUser() const
321+{
322+ return m_demoEdgesForCurrentUser;
323+}
324+
325+void AccountsService::setDemoEdgesForCurrentUser(bool demoEdgesForCurrentUser)
326+{
327+ m_demoEdgesForCurrentUser = demoEdgesForCurrentUser;
328+ Q_EMIT demoEdgesForCurrentUserChanged();
329+ m_service->setUserProperty(qgetenv("USER"), "com.canonical.unity.AccountsService", "demo-edges", demoEdgesForCurrentUser);
330+}
331+
332 QString AccountsService::backgroundFile() const
333 {
334 return m_backgroundFile;
335@@ -79,6 +94,15 @@
336 }
337 }
338
339+void AccountsService::updateDemoEdgesForCurrentUser()
340+{
341+ auto demoEdgesForCurrentUser = m_service->getUserProperty(qgetenv("USER"), "com.canonical.unity.AccountsService", "demo-edges").toBool();
342+ if (m_demoEdgesForCurrentUser != demoEdgesForCurrentUser) {
343+ m_demoEdgesForCurrentUser = demoEdgesForCurrentUser;
344+ Q_EMIT demoEdgesForCurrentUserChanged();
345+ }
346+}
347+
348 void AccountsService::updateBackgroundFile()
349 {
350 auto backgroundFile = m_service->getUserProperty(m_user, "org.freedesktop.Accounts.User", "BackgroundFile").toString();
351@@ -99,13 +123,14 @@
352
353 void AccountsService::propertiesChanged(const QString &user, const QString &interface, const QStringList &changed)
354 {
355- if (m_user != user) {
356- return;
357- }
358-
359 if (interface == "com.canonical.unity.AccountsService") {
360 if (changed.contains("demo-edges")) {
361- updateDemoEdges();
362+ if (qgetenv("USER") == user) {
363+ updateDemoEdgesForCurrentUser();
364+ }
365+ if (m_user == user) {
366+ updateDemoEdges();
367+ }
368 }
369 } else if (interface == "com.ubuntu.touch.AccountsService.SecurityPrivacy") {
370 if (changed.contains("StatsWelcomeScreen")) {
371@@ -116,10 +141,8 @@
372
373 void AccountsService::maybeChanged(const QString &user)
374 {
375- if (m_user != user) {
376- return;
377+ if (m_user == user) {
378+ // Standard properties might have changed
379+ updateBackgroundFile();
380 }
381-
382- // Standard properties might have changed
383- updateBackgroundFile();
384 }
385
386=== modified file 'plugins/AccountsService/AccountsService.h'
387--- plugins/AccountsService/AccountsService.h 2013-09-24 18:50:56 +0000
388+++ plugins/AccountsService/AccountsService.h 2014-03-27 20:58:22 +0000
389@@ -35,6 +35,10 @@
390 READ demoEdges
391 WRITE setDemoEdges
392 NOTIFY demoEdgesChanged)
393+ Q_PROPERTY (bool demoEdgesForCurrentUser
394+ READ demoEdgesForCurrentUser
395+ WRITE setDemoEdgesForCurrentUser
396+ NOTIFY demoEdgesForCurrentUserChanged)
397 Q_PROPERTY (QString backgroundFile
398 READ backgroundFile
399 NOTIFY backgroundFileChanged)
400@@ -49,12 +53,15 @@
401 void setUser(const QString &user);
402 bool demoEdges() const;
403 void setDemoEdges(bool demoEdges);
404+ bool demoEdgesForCurrentUser() const;
405+ void setDemoEdgesForCurrentUser(bool demoEdgesForCurrentUser);
406 QString backgroundFile() const;
407 bool statsWelcomeScreen() const;
408
409 Q_SIGNALS:
410 void userChanged();
411 void demoEdgesChanged();
412+ void demoEdgesForCurrentUserChanged();
413 void backgroundFileChanged();
414 void statsWelcomeScreenChanged();
415
416@@ -64,12 +71,14 @@
417
418 private:
419 void updateDemoEdges();
420+ void updateDemoEdgesForCurrentUser();
421 void updateBackgroundFile();
422 void updateStatsWelcomeScreen();
423
424 AccountsServiceDBusAdaptor *m_service;
425 QString m_user;
426 bool m_demoEdges;
427+ bool m_demoEdgesForCurrentUser;
428 QString m_backgroundFile;
429 bool m_statsWelcomeScreen;
430 };
431
432=== modified file 'plugins/CMakeLists.txt'
433--- plugins/CMakeLists.txt 2013-12-12 16:45:35 +0000
434+++ plugins/CMakeLists.txt 2014-03-27 20:58:22 +0000
435@@ -4,6 +4,7 @@
436 add_subdirectory(DashViews)
437 add_subdirectory(Powerd)
438 add_subdirectory(SessionBroadcast)
439+add_subdirectory(SessionManager)
440 add_subdirectory(Ubuntu)
441 add_subdirectory(Unity)
442 add_subdirectory(Utils)
443
444=== modified file 'plugins/LightDM/CMakeLists.txt'
445--- plugins/LightDM/CMakeLists.txt 2013-12-17 14:56:25 +0000
446+++ plugins/LightDM/CMakeLists.txt 2014-03-27 20:58:22 +0000
447@@ -3,24 +3,23 @@
448
449 # Dependencies
450 include(FindPkgConfig)
451+pkg_check_modules(LIBLIGHTDM REQUIRED liblightdm-qt5-3)
452 pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
453-# TODO: Once we split out a separate greeter process, uncomment these lines
454-#pkg_check_modules(LIBLIGHTDM REQUIRED liblightdm-qt5-2)
455
456 include_directories(
457 ${CMAKE_CURRENT_SOURCE_DIR}
458 ${CMAKE_CURRENT_BINARY_DIR}
459 ${CMAKE_SOURCE_DIR}/plugins/Utils
460- ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
461- #${LIBLIGHTDM_INCLUDE_DIRS}
462+ ${LIBLIGHTDM_INCLUDE_DIRS}
463 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
464 )
465
466 set(QMLPLUGIN_SRC
467- ../Utils/qsortfilterproxymodelqml.cpp # FIXME evaluate a more generic approach for using other plugins
468+ ${CMAKE_SOURCE_DIR}/plugins/Utils/qsortfilterproxymodelqml.cpp # FIXME evaluate a more generic approach for using other plugins
469 DBusGreeterList.cpp
470 Greeter.cpp
471 plugin.cpp
472+ URLDispatcher.cpp
473 UsersModel.cpp
474 )
475
476@@ -29,13 +28,11 @@
477 )
478
479 target_link_libraries(LightDM-qml
480- MockLightDM-demo
481-# TODO: Once we split out a separate greeter process, uncomment these lines
482-# ${LIBLIGHTDM_LDFLAGS}
483+ ${LIBLIGHTDM_LDFLAGS}
484 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
485 )
486
487-qt5_use_modules(LightDM-qml DBus Gui Qml)
488+qt5_use_modules(LightDM-qml DBus Qml)
489
490 # export the qmldir qmltypes and plugin files
491 export_qmlfiles(LightDM LightDM)
492
493=== added file 'plugins/LightDM/URLDispatcher.cpp'
494--- plugins/LightDM/URLDispatcher.cpp 1970-01-01 00:00:00 +0000
495+++ plugins/LightDM/URLDispatcher.cpp 2014-03-27 20:58:22 +0000
496@@ -0,0 +1,55 @@
497+/*
498+ * Copyright (C) 2013 Canonical, Ltd.
499+ *
500+ * This program is free software; you can redistribute it and/or modify
501+ * it under the terms of the GNU General Public License as published by
502+ * the Free Software Foundation; version 3.
503+ *
504+ * This program is distributed in the hope that it will be useful,
505+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
506+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
507+ * GNU General Public License for more details.
508+ *
509+ * You should have received a copy of the GNU General Public License
510+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
511+ */
512+
513+#include "URLDispatcher.h"
514+
515+#include <QDBusConnection>
516+
517+class URLDispatcherInterface : public QObject
518+{
519+ Q_OBJECT
520+ Q_CLASSINFO("D-Bus Interface", "com.canonical.URLDispatcher")
521+
522+public:
523+ explicit URLDispatcherInterface(URLDispatcher *parent);
524+
525+ Q_SCRIPTABLE void DispatchURL(const QString &url);
526+};
527+
528+URLDispatcherInterface::URLDispatcherInterface(URLDispatcher *parent)
529+ : QObject(parent)
530+{
531+}
532+
533+void URLDispatcherInterface::DispatchURL(const QString &url)
534+{
535+ Q_EMIT static_cast<URLDispatcher *>(parent())->dispatchURL(url);
536+}
537+
538+URLDispatcher::URLDispatcher(QObject *parent)
539+ : QObject(parent)
540+{
541+ // This class also manages our url-dispatcher interception. We intercept
542+ // url-dispatcher because rather than spawning the handler for the URL in
543+ // our own session, we want to do notify the user session to do it for us
544+ // (and start an unlock in the process).
545+ QDBusConnection connection = QDBusConnection::sessionBus();
546+ URLDispatcherInterface *dispatcher = new URLDispatcherInterface(this);
547+ connection.registerObject("/com/canonical/URLDispatcher", dispatcher, QDBusConnection::ExportScriptableContents);
548+ connection.registerService("com.canonical.URLDispatcher");
549+}
550+
551+#include "URLDispatcher.moc"
552
553=== added file 'plugins/LightDM/URLDispatcher.h'
554--- plugins/LightDM/URLDispatcher.h 1970-01-01 00:00:00 +0000
555+++ plugins/LightDM/URLDispatcher.h 2014-03-27 20:58:22 +0000
556@@ -0,0 +1,34 @@
557+/*
558+ * Copyright (C) 2013 Canonical, Ltd.
559+ *
560+ * This program is free software; you can redistribute it and/or modify
561+ * it under the terms of the GNU General Public License as published by
562+ * the Free Software Foundation; version 3.
563+ *
564+ * This program is distributed in the hope that it will be useful,
565+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
566+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
567+ * GNU General Public License for more details.
568+ *
569+ * You should have received a copy of the GNU General Public License
570+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
571+ */
572+
573+#ifndef UNITY_URLDISPATCHER_H
574+#define UNITY_URLDISPATCHER_H
575+
576+#include <QObject>
577+#include <QString>
578+
579+class URLDispatcher : public QObject
580+{
581+ Q_OBJECT
582+
583+public:
584+ explicit URLDispatcher(QObject *parent=0);
585+
586+Q_SIGNALS:
587+ void dispatchURL(const QString &url);
588+};
589+
590+#endif
591
592=== modified file 'plugins/LightDM/plugin.cpp'
593--- plugins/LightDM/plugin.cpp 2013-12-03 16:55:03 +0000
594+++ plugins/LightDM/plugin.cpp 2014-03-27 20:58:22 +0000
595@@ -20,6 +20,7 @@
596 #include "plugin.h"
597 #include "DBusGreeterList.h"
598 #include "Greeter.h"
599+#include "URLDispatcher.h"
600 #include "UsersModel.h"
601 #include <libusermetricsoutput/ColorTheme.h>
602 #include <libusermetricsoutput/UserMetrics.h>
603@@ -46,6 +47,13 @@
604 return greeter;
605 }
606
607+static QObject *dispatcher_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
608+{
609+ Q_UNUSED(engine)
610+ Q_UNUSED(scriptEngine)
611+ return new URLDispatcher();
612+}
613+
614 static QObject *users_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
615 {
616 Q_UNUSED(engine)
617@@ -67,6 +75,7 @@
618
619 Q_ASSERT(uri == QLatin1String("LightDM"));
620 qmlRegisterSingletonType<Greeter>(uri, 0, 1, "Greeter", greeter_provider);
621+ qmlRegisterSingletonType<URLDispatcher>(uri, 0, 1, "URLDispatcher", dispatcher_provider);
622 qmlRegisterSingletonType<UsersModel>(uri, 0, 1, "Users", users_provider);
623 qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", "Type is not instantiable");
624 qmlRegisterSingletonType<UserMetricsOutput::UserMetrics>(uri, 0, 1, "Infographic", infographic_provider);
625
626=== modified file 'plugins/SessionBroadcast/SessionBroadcast.cpp'
627--- plugins/SessionBroadcast/SessionBroadcast.cpp 2013-09-12 17:58:21 +0000
628+++ plugins/SessionBroadcast/SessionBroadcast.cpp 2014-03-27 20:58:22 +0000
629@@ -18,11 +18,26 @@
630
631 #include "SessionBroadcast.h"
632 #include <QDBusConnection>
633+#include <QDBusConnectionInterface>
634+#include <QDBusInterface>
635
636 SessionBroadcast::SessionBroadcast(QObject* parent)
637 : QObject(parent)
638 {
639 auto connection = QDBusConnection::SM_BUSNAME();
640+ auto interface = connection.interface();
641+ interface->startService("com.canonical.Unity.Greeter.Broadcast");
642+ m_broadcaster = new QDBusInterface("com.canonical.Unity.Greeter.Broadcast",
643+ "/com/canonical/Unity/Greeter/Broadcast",
644+ "com.canonical.Unity.Greeter.Broadcast",
645+ connection, this);
646+
647+ connection.connect("com.canonical.Unity.Greeter.Broadcast",
648+ "/com/canonical/Unity/Greeter/Broadcast",
649+ "com.canonical.Unity.Greeter.Broadcast",
650+ "StartUrl",
651+ this,
652+ SLOT(onStartUrl(const QString &, const QString &)));
653
654 connection.connect("com.canonical.Unity.Greeter.Broadcast",
655 "/com/canonical/Unity/Greeter/Broadcast",
656@@ -32,6 +47,21 @@
657 SLOT(onShowHome(const QString &)));
658 }
659
660+void SessionBroadcast::requestUrlStart(const QString &username, const QString &url)
661+{
662+ m_broadcaster->asyncCall("RequestUrlStart", username, url);
663+}
664+
665+void SessionBroadcast::onStartUrl(const QString &username, const QString &url)
666+{
667+ // Since this signal is just used for testing, we don't *really* care if
668+ // username matches, but just in case we do eventually use the signal, we
669+ // should only listen to our own requests.
670+ if (username == qgetenv("USER")) {
671+ Q_EMIT startUrl(url);
672+ }
673+}
674+
675 void SessionBroadcast::onShowHome(const QString &username)
676 {
677 // Only listen to requests meant for us
678
679=== modified file 'plugins/SessionBroadcast/SessionBroadcast.h'
680--- plugins/SessionBroadcast/SessionBroadcast.h 2013-09-12 17:58:21 +0000
681+++ plugins/SessionBroadcast/SessionBroadcast.h 2014-03-27 20:58:22 +0000
682@@ -31,11 +31,21 @@
683 public:
684 explicit SessionBroadcast(QObject *parent = 0);
685
686+ Q_INVOKABLE void requestUrlStart(const QString &username, const QString &url);
687+
688 Q_SIGNALS:
689+ // This signal isn't actually used by the shell
690+ // (unity-greeter-session-broadcast handles launching an app for us), but
691+ // it's useful for testing the plugin.
692+ void startUrl(const QString &url);
693 void showHome();
694
695 private Q_SLOTS:
696+ void onStartUrl(const QString &username, const QString &url);
697 void onShowHome(const QString &username);
698+
699+private:
700+ QDBusInterface *m_broadcaster;
701 };
702
703 #endif
704
705=== added directory 'plugins/SessionManager'
706=== added file 'plugins/SessionManager/CMakeLists.txt'
707--- plugins/SessionManager/CMakeLists.txt 1970-01-01 00:00:00 +0000
708+++ plugins/SessionManager/CMakeLists.txt 2014-03-27 20:58:22 +0000
709@@ -0,0 +1,27 @@
710+# export_qmlplugin macro
711+include(Plugins)
712+
713+set(QMLPLUGIN_SRC
714+ plugin.cpp
715+ SessionManager.cpp
716+ )
717+
718+include_directories(
719+ ${Qt5DBus_INCLUDE_DIRS}
720+ )
721+
722+add_definitions(-DSM_BUSNAME=systemBus)
723+
724+add_library(SessionManager-qml MODULE
725+ ${QMLPLUGIN_SRC}
726+ )
727+
728+target_link_libraries(SessionManager-qml
729+ ${Qt5DBus_LIBRARIES}
730+ )
731+
732+qt5_use_modules(SessionManager-qml Qml)
733+
734+# export the qmldir qmltypes and plugin files
735+export_qmlfiles(SessionManager SessionManager)
736+export_qmlplugin(SessionManager 0.1 SessionManager TARGETS SessionManager-qml)
737
738=== added file 'plugins/SessionManager/SessionManager.cpp'
739--- plugins/SessionManager/SessionManager.cpp 1970-01-01 00:00:00 +0000
740+++ plugins/SessionManager/SessionManager.cpp 2014-03-27 20:58:22 +0000
741@@ -0,0 +1,107 @@
742+/*
743+ * Copyright (C) 2013 Canonical, Ltd.
744+ *
745+ * This program is free software; you can redistribute it and/or modify
746+ * it under the terms of the GNU General Public License as published by
747+ * the Free Software Foundation; version 3.
748+ *
749+ * This program is distributed in the hope that it will be useful,
750+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
751+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
752+ * GNU General Public License for more details.
753+ *
754+ * You should have received a copy of the GNU General Public License
755+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
756+ *
757+ * Author: Michael Terry <michael.terry@canonical.com>
758+ */
759+
760+#include "SessionManager.h"
761+#include <QtCore/QEvent>
762+#include <QtDBus/QDBusPendingReply>
763+
764+SessionManager::SessionManager(QObject* parent)
765+ : QObject(parent),
766+ l1_manager(NULL),
767+ l1_session(NULL),
768+ ldm_session(NULL),
769+ is_active(true) // assume we're active w/o logind
770+{
771+ l1_manager = new QDBusInterface("org.freedesktop.login1",
772+ "/org/freedesktop/login1",
773+ "org.freedesktop.login1.Manager",
774+ QDBusConnection::SM_BUSNAME(), this);
775+ if (l1_manager->isValid() && QString(qgetenv("XDG_SESSION_ID")) != "") {
776+ QDBusPendingCall pcall = l1_manager->asyncCall("GetSession", QString(qgetenv("XDG_SESSION_ID")));
777+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
778+ QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
779+ this, SLOT(getSessionSlot(QDBusPendingCallWatcher*)));
780+ }
781+
782+ if (QString(qgetenv("XDG_SESSION_PATH")) != "") {
783+ ldm_session = new QDBusInterface("org.freedesktop.DisplayManager",
784+ QString(qgetenv("XDG_SESSION_PATH")),
785+ "org.freedesktop.DisplayManager.Session",
786+ QDBusConnection::SM_BUSNAME(), this);
787+ }
788+}
789+
790+bool SessionManager::active() const
791+{
792+ // We cache this value for performance reasons, as QDBusInterface does not
793+ // cache for us.
794+ return is_active;
795+}
796+
797+void SessionManager::lock()
798+{
799+ // We use ldm_session to handle locking rather than l1_session, because
800+ // l1_session doesn't have permissions to lock from the user session, but
801+ // ldm_session does. This is what the rest of Ubuntu uses to lock.
802+ if (ldm_session != NULL && ldm_session->isValid())
803+ ldm_session->asyncCall("Lock");
804+}
805+
806+void SessionManager::getSessionSlot(QDBusPendingCallWatcher *watcher)
807+{
808+ QDBusPendingReply<QDBusObjectPath> reply = *watcher;
809+ if (!reply.isError()) {
810+ QDBusObjectPath path = reply.argumentAt<0>();
811+ l1_session = new QDBusInterface("org.freedesktop.login1",
812+ path.path(),
813+ "org.freedesktop.login1.Session",
814+ l1_manager->connection(), this);
815+
816+ l1_manager->connection().connect("org.freedesktop.login1",
817+ path.path(),
818+ "org.freedesktop.DBus.Properties",
819+ "PropertiesChanged",
820+ this,
821+ SLOT(propertiesChanged(QString, QVariantMap, QStringList)));
822+
823+ propertiesChanged("", QVariantMap(), QStringList() << "Active");
824+ }
825+ watcher->deleteLater();
826+}
827+
828+void SessionManager::propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid)
829+{
830+ Q_UNUSED(interface)
831+
832+ QVariant value = changed.value("Active");
833+
834+ // If Active isn't in changed, check if we were at least notified about it
835+ // changing on the server. Also check if IdleHint was modified, because
836+ // sometimes logind does not emit a changed signal for Active becoming
837+ // false, but will emit for IdleHint when that does happen.
838+ if (!value.isValid() && (invalid.contains("Active") || invalid.contains("IdleHint") || changed.contains("IdleHint")) && l1_session->isValid()) {
839+ value = l1_session->property("Active");
840+ if (!value.isValid())
841+ value = QVariant(false);
842+ }
843+
844+ if (value.isValid() && value.toBool() != is_active) {
845+ is_active = value.toBool();
846+ Q_EMIT activeChanged();
847+ }
848+}
849
850=== added file 'plugins/SessionManager/SessionManager.h'
851--- plugins/SessionManager/SessionManager.h 1970-01-01 00:00:00 +0000
852+++ plugins/SessionManager/SessionManager.h 2014-03-27 20:58:22 +0000
853@@ -0,0 +1,60 @@
854+/*
855+ * Copyright (C) 2012,2013 Canonical, Ltd.
856+ *
857+ * This program is free software; you can redistribute it and/or modify
858+ * it under the terms of the GNU General Public License as published by
859+ * the Free Software Foundation; version 3.
860+ *
861+ * This program is distributed in the hope that it will be useful,
862+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
863+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
864+ * GNU General Public License for more details.
865+ *
866+ * You should have received a copy of the GNU General Public License
867+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
868+ *
869+ * Authors: Gerry Boland <gerry.boland@canonical.com>
870+ * Michael Terry <michael.terry@canonical.com>
871+ */
872+
873+#ifndef UNITY_SESSIONMANAGER_H
874+#define UNITY_SESSIONMANAGER_H
875+
876+#include <QtCore/QObject>
877+#include <QtCore/QString>
878+#include <QtCore/QStringList>
879+#include <QtCore/QVariantMap>
880+#include <QtDBus/QDBusInterface>
881+#include <QtDBus/QDBusPendingCallWatcher>
882+
883+class SessionManager: public QObject
884+{
885+ Q_OBJECT
886+ Q_PROPERTY(bool active
887+ READ active
888+ NOTIFY activeChanged
889+ FINAL)
890+
891+public:
892+ explicit SessionManager(QObject *parent = 0);
893+
894+ bool active() const;
895+
896+public Q_SLOTS:
897+ void lock();
898+
899+Q_SIGNALS:
900+ void activeChanged();
901+
902+private Q_SLOTS:
903+ void getSessionSlot(QDBusPendingCallWatcher *watcher);
904+ void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid);
905+
906+private:
907+ QDBusInterface *l1_manager;
908+ QDBusInterface *l1_session;
909+ QDBusInterface *ldm_session;
910+ bool is_active;
911+};
912+
913+#endif
914
915=== added file 'plugins/SessionManager/plugin.cpp'
916--- plugins/SessionManager/plugin.cpp 1970-01-01 00:00:00 +0000
917+++ plugins/SessionManager/plugin.cpp 2014-03-27 20:58:22 +0000
918@@ -0,0 +1,35 @@
919+/*
920+ * Copyright (C) 2012,2013 Canonical, Ltd.
921+ *
922+ * This program is free software; you can redistribute it and/or modify
923+ * it under the terms of the GNU General Public License as published by
924+ * the Free Software Foundation; version 3.
925+ *
926+ * This program is distributed in the hope that it will be useful,
927+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
928+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
929+ * GNU General Public License for more details.
930+ *
931+ * You should have received a copy of the GNU General Public License
932+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
933+ *
934+ * Authors: Gerry Boland <gerry.boland@canonical.com>
935+ * Michael Terry <michael.terry@canonical.com>
936+ */
937+
938+#include "plugin.h"
939+#include "SessionManager.h"
940+#include <QtQml/qqml.h>
941+
942+static QObject *sessionmanager_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
943+{
944+ Q_UNUSED(engine)
945+ Q_UNUSED(scriptEngine)
946+ return new SessionManager();
947+}
948+
949+void SessionManagerPlugin::registerTypes(const char *uri)
950+{
951+ Q_ASSERT(uri == QLatin1String("SessionManager"));
952+ qmlRegisterSingletonType<SessionManager>(uri, 0, 1, "SessionManager", sessionmanager_provider);
953+}
954
955=== added file 'plugins/SessionManager/plugin.h'
956--- plugins/SessionManager/plugin.h 1970-01-01 00:00:00 +0000
957+++ plugins/SessionManager/plugin.h 2014-03-27 20:58:22 +0000
958@@ -0,0 +1,35 @@
959+/*
960+ * Copyright (C) 2012,2013 Canonical, Ltd.
961+ *
962+ * This program is free software; you can redistribute it and/or modify
963+ * it under the terms of the GNU General Public License as published by
964+ * the Free Software Foundation; version 3.
965+ *
966+ * This program is distributed in the hope that it will be useful,
967+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
968+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
969+ * GNU General Public License for more details.
970+ *
971+ * You should have received a copy of the GNU General Public License
972+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
973+ *
974+ * Authors: Gerry Boland <gerry.boland@canonical.com>
975+ * Michael Terry <michael.terry@canonical.com>
976+ */
977+
978+#ifndef SESSIONMANAGER_PLUGIN_H
979+#define SESSIONMANAGER_PLUGIN_H
980+
981+#include <QtQml/QQmlEngine>
982+#include <QtQml/QQmlExtensionPlugin>
983+
984+class SessionManagerPlugin : public QQmlExtensionPlugin
985+{
986+ Q_OBJECT
987+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
988+
989+public:
990+ void registerTypes(const char *uri);
991+};
992+
993+#endif
994
995=== added file 'plugins/SessionManager/qmldir'
996--- plugins/SessionManager/qmldir 1970-01-01 00:00:00 +0000
997+++ plugins/SessionManager/qmldir 2014-03-27 20:58:22 +0000
998@@ -0,0 +1,2 @@
999+module SessionManager
1000+plugin SessionManager-qml
1001
1002=== added file 'qml/Components/BasicShell.qml'
1003--- qml/Components/BasicShell.qml 1970-01-01 00:00:00 +0000
1004+++ qml/Components/BasicShell.qml 2014-03-27 20:58:22 +0000
1005@@ -0,0 +1,84 @@
1006+/*
1007+ * Copyright (C) 2013 Canonical, Ltd.
1008+ *
1009+ * This program is free software; you can redistribute it and/or modify
1010+ * it under the terms of the GNU General Public License as published by
1011+ * the Free Software Foundation; version 3.
1012+ *
1013+ * This program is distributed in the hope that it will be useful,
1014+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1015+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1016+ * GNU General Public License for more details.
1017+ *
1018+ * You should have received a copy of the GNU General Public License
1019+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1020+ */
1021+
1022+import QtQuick 2.0
1023+import Ubuntu.Components 0.1
1024+import Unity.Application 0.1
1025+import "../Components"
1026+
1027+FocusScope {
1028+ id: shell
1029+
1030+ // this is only here to select the width / height of the window if not running fullscreen
1031+ property bool tablet: false
1032+ width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
1033+ height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
1034+
1035+ property real edgeSize: units.gu(2)
1036+
1037+ property url defaultBackground: Qt.resolvedUrl(shell.width >= units.gu(60) ? "../graphics/tablet_background.jpg" : "../graphics/phone_background.jpg")
1038+ property url background
1039+ property url backgroundSource
1040+ property url backgroundFallbackSource
1041+ property url backgroundFinal: (backgroundSource != undefined && backgroundSource != "") ? backgroundSource : (backgroundFallbackSource != undefined && backgroundFallbackSource != "") ? backgroundFallbackSource : shell.defaultBackground
1042+ onBackgroundFinalChanged: shell.background = backgroundFinal
1043+
1044+ // This is a dummy image that is needed to determine if the picture url
1045+ // in backgroundSettings points to a valid picture file.
1046+ // We can't do this with the real background image because setting a
1047+ // new source in onStatusChanged triggers a binding loop detection
1048+ // inside Image, which causes it not to render even though a valid source
1049+ // would be set. We don't mind about this image staying black and just
1050+ // use it for verification to populate the source for the real
1051+ // background image.
1052+ Image {
1053+ source: shell.background
1054+ height: 0
1055+ width: 0
1056+ sourceSize.height: 0
1057+ sourceSize.width: 0
1058+ onStatusChanged: {
1059+ if (status == Image.Error) {
1060+ if (source != shell.defaultBackground) {
1061+ shell.background = defaultBackground
1062+ } else {
1063+ // In case even our default background fails to load...
1064+ shell.background = "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#000'/></svg>"
1065+ }
1066+ }
1067+ }
1068+ }
1069+
1070+ VolumeControl {
1071+ id: volumeControl
1072+ }
1073+
1074+ Keys.onVolumeUpPressed: volumeControl.volumeUp()
1075+ Keys.onVolumeDownPressed: volumeControl.volumeDown()
1076+
1077+ function hideIndicatorMenu(delay) {
1078+ panel.hideIndicatorMenu(delay);
1079+ }
1080+
1081+ focus: true
1082+ onFocusChanged: if (!focus) forceActiveFocus();
1083+
1084+ Binding {
1085+ target: i18n
1086+ property: "domain"
1087+ value: "unity8"
1088+ }
1089+}
1090
1091=== modified file 'qml/Components/EdgeDemo.qml'
1092--- qml/Components/EdgeDemo.qml 2014-01-29 22:19:15 +0000
1093+++ qml/Components/EdgeDemo.qml 2014-03-27 20:58:22 +0000
1094@@ -15,13 +15,11 @@
1095 */
1096
1097 import AccountsService 0.1
1098-import LightDM 0.1 as LightDM
1099 import QtQuick 2.0
1100
1101 Item {
1102 id: demo
1103
1104- property Item greeter
1105 property Item dash
1106 property Item launcher
1107 property Item indicators
1108@@ -36,7 +34,6 @@
1109 property bool paused: false
1110
1111 onPausedChanged: {
1112- if (d.rightEdgeDemo) d.rightEdgeDemo.paused = paused
1113 if (d.topEdgeDemo) d.topEdgeDemo.paused = paused
1114 if (d.bottomEdgeDemo) d.bottomEdgeDemo.paused = paused
1115 if (d.leftEdgeDemo) d.leftEdgeDemo.paused = paused
1116@@ -45,16 +42,6 @@
1117
1118 function hideEdgeDemoInShell() {
1119 AccountsService.demoEdges = false;
1120- stopDemo();
1121- }
1122-
1123- function hideEdgeDemoInGreeter() {
1124- // TODO: AccountsService.demoEdges = false as lightdm user
1125- }
1126-
1127- function hideEdgeDemos() {
1128- hideEdgeDemoInGreeter();
1129- hideEdgeDemoInShell();
1130 }
1131
1132 function stopDemo() {
1133@@ -62,7 +49,6 @@
1134 dashEnabled = true
1135 panelEnabled = true
1136 panelContentEnabled = true
1137- if (d.rightEdgeDemo) d.rightEdgeDemo.destroy()
1138 if (d.topEdgeDemo) d.topEdgeDemo.destroy()
1139 if (d.bottomEdgeDemo) d.bottomEdgeDemo.destroy()
1140 if (d.leftEdgeDemo) d.leftEdgeDemo.destroy()
1141@@ -79,24 +65,17 @@
1142 panelEnabled = false;
1143 panelContentEnabled = false;
1144
1145- // Begin with either greeter or dash, depending on which is visible
1146- if (greeter && greeter.shown) {
1147- startRightEdgeDemo()
1148- } else {
1149- startTopEdgeDemo()
1150- }
1151+ startTopEdgeDemo()
1152 }
1153
1154 QtObject {
1155 id: d
1156 property Component overlay
1157- property QtObject rightEdgeDemo
1158 property QtObject topEdgeDemo
1159 property QtObject bottomEdgeDemo
1160 property QtObject leftEdgeDemo
1161 property QtObject finalEdgeDemo
1162 property bool showEdgeDemo: AccountsService.demoEdges
1163- property bool showEdgeDemoInGreeter: AccountsService.demoEdges // TODO: AccountsService.demoEdges as lightdm user
1164
1165 onShowEdgeDemoChanged: {
1166 stopDemo()
1167@@ -106,37 +85,6 @@
1168 }
1169 }
1170
1171- function startRightEdgeDemo() {
1172- if (demo.greeter) {
1173- d.rightEdgeDemo = d.overlay.createObject(demo.greeter, {
1174- "edge": "right",
1175- "title": i18n.tr("Right edge"),
1176- "text": i18n.tr("Try swiping from the right edge to unlock the phone"),
1177- "anchors.fill": demo.greeter,
1178- });
1179- }
1180- if (d.rightEdgeDemo) {
1181- d.rightEdgeDemo.onSkip.connect(demo.hideEdgeDemos)
1182- } else {
1183- stopDemo();
1184- }
1185- }
1186-
1187- Connections {
1188- target: demo.greeter
1189-
1190- function hide() {
1191- if (d.rightEdgeDemo && d.rightEdgeDemo.available) {
1192- d.rightEdgeDemo.hide()
1193- hideEdgeDemoInGreeter()
1194- startTopEdgeDemo()
1195- }
1196- }
1197-
1198- onUnlocked: hide()
1199- onShownChanged: if (!greeter.shown) hide()
1200- }
1201-
1202 function startTopEdgeDemo() {
1203 demo.panelEnabled = true;
1204 if (demo.dash && demo.underlay) {
1205
1206=== renamed file 'qml/Greeter/Lockscreen.qml' => 'qml/Components/Lockscreen.qml'
1207--- qml/Greeter/Lockscreen.qml 2013-12-18 20:09:55 +0000
1208+++ qml/Components/Lockscreen.qml 2014-03-27 20:58:22 +0000
1209@@ -16,7 +16,6 @@
1210
1211 import QtQuick 2.0
1212 import Ubuntu.Components 0.1
1213-import "../Components"
1214
1215 Showable {
1216 id: root
1217@@ -56,24 +55,6 @@
1218 pinPadLoader.item.clear(showAnimation);
1219 }
1220
1221- Rectangle {
1222- // In case background fails to load or is undefined
1223- id: backgroundBackup
1224- anchors.fill: parent
1225- color: "black"
1226- }
1227-
1228- Image {
1229- id: backgroundImage
1230- objectName: "lockscreenBackground"
1231- anchors {
1232- fill: parent
1233- topMargin: backgroundTopMargin
1234- }
1235- source: root.required ? root.background : ""
1236- fillMode: Image.PreserveAspectCrop
1237- }
1238-
1239 MouseArea {
1240 anchors.fill: root
1241 }
1242
1243=== modified file 'qml/Components/PageHeader.qml'
1244--- qml/Components/PageHeader.qml 2014-02-25 15:43:42 +0000
1245+++ qml/Components/PageHeader.qml 2014-03-27 20:58:22 +0000
1246@@ -18,6 +18,7 @@
1247 import Ubuntu.Components 0.1
1248 import Ubuntu.Components.Popups 0.1
1249 import Ubuntu.Components.ListItems 0.1 as ListItem
1250+import SessionManager 0.1
1251 import Unity 0.2
1252
1253 Item {
1254@@ -51,8 +52,8 @@
1255 }
1256
1257 Connections {
1258- target: greeter
1259- onShownChanged: if (shown) resetSearch()
1260+ target: SessionManager
1261+ onActiveChanged: if (!SessionManager.active) resetSearch()
1262 }
1263
1264 Flickable {
1265
1266=== renamed file 'qml/Greeter/PassphraseLockscreen.qml' => 'qml/Components/PassphraseLockscreen.qml'
1267=== renamed file 'qml/Greeter/PinLockscreen.qml' => 'qml/Components/PinLockscreen.qml'
1268=== modified file 'qml/Dash/ScopeListView.qml'
1269--- qml/Dash/ScopeListView.qml 2013-12-12 16:45:35 +0000
1270+++ qml/Dash/ScopeListView.qml 2014-03-27 20:58:22 +0000
1271@@ -16,13 +16,14 @@
1272
1273 import QtQuick 2.0
1274 import DashViews 0.1
1275+import SessionManager 0.1
1276
1277 ListViewWithPageHeader {
1278 maximumFlickVelocity: height * 10
1279 flickDeceleration: height * 2
1280
1281 Connections {
1282- target: greeter
1283- onShownChanged: if (greeter.shown) showHeader()
1284+ target: SessionManager
1285+ onActiveChanged: if (!SessionManager.active) showHeader()
1286 }
1287 }
1288
1289=== modified file 'qml/Greeter/Clock.qml'
1290--- qml/Greeter/Clock.qml 2013-10-11 12:14:33 +0000
1291+++ qml/Greeter/Clock.qml 2014-03-27 20:58:22 +0000
1292@@ -42,7 +42,7 @@
1293
1294 busName: "com.canonical.indicator.datetime"
1295 actionsObjectPath: "/com/canonical/indicator/datetime"
1296- menuObjectPath: clock.active ? "/com/canonical/indicator/datetime/phone" : ""
1297+ menuObjectPath: clock.active ? "/com/canonical/indicator/datetime/phone_greeter" : ""
1298
1299 Indicators.RootActionState {
1300 menu: timeModel.model
1301
1302=== modified file 'qml/Greeter/Greeter.qml'
1303--- qml/Greeter/Greeter.qml 2014-03-05 08:06:19 +0000
1304+++ qml/Greeter/Greeter.qml 2014-03-27 20:58:22 +0000
1305@@ -23,15 +23,15 @@
1306 Showable {
1307 id: greeter
1308 enabled: shown
1309- created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready
1310+ created: greeterContentLoader.status == Loader.Ready
1311
1312- property url defaultBackground
1313+ property url background
1314
1315 // 1 when fully shown and 0 when fully hidden
1316 property real showProgress: MathUtils.clamp((width + x) / width, 0, 1)
1317
1318 showAnimation: StandardAnimation { property: "x"; to: 0 }
1319- hideAnimation: StandardAnimation { property: "x"; to: -width }
1320+ hideAnimation: __leftHideAnimation
1321
1322 property alias dragHandleWidth: dragHandle.width
1323 property alias model: greeterContentLoader.model
1324@@ -40,19 +40,105 @@
1325 readonly property bool narrowMode: !multiUser && height > width
1326 readonly property bool multiUser: LightDM.Users.count > 1
1327
1328- readonly property bool leftTeaserPressed: greeterContentLoader.status == Loader.Ready &&
1329- greeterContentLoader.item.leftTeaserPressed
1330- readonly property bool rightTeaserPressed: greeterContentLoader.status == Loader.Ready &&
1331- greeterContentLoader.item.rightTeaserPressed
1332-
1333 readonly property int currentIndex: greeterContentLoader.currentIndex
1334
1335+ property var __leftHideAnimation: StandardAnimation { property: "x"; to: -width }
1336+ property var __rightHideAnimation: StandardAnimation { property: "x"; to: width }
1337+
1338 signal selected(int uid)
1339 signal unlocked(int uid)
1340-
1341- onRightTeaserPressedChanged: {
1342- if (rightTeaserPressed && (!locked || narrowMode) && x == 0) {
1343- teasingTimer.start();
1344+ signal tease()
1345+
1346+ function hideRight() {
1347+ hideAnimation = __rightHideAnimation
1348+ hide()
1349+ }
1350+
1351+ Connections {
1352+ target: __rightHideAnimation
1353+ // Reset hide animation to default once we're finished with it
1354+ onRunningChanged: if (!__rightHideAnimation.running) greeter.hideAnimation = __leftHideAnimation
1355+ }
1356+
1357+ // Bi-directional revealer
1358+ DraggingArea {
1359+ id: dragHandle
1360+ anchors.fill: parent
1361+ enabled: greeter.narrowMode || !greeter.locked
1362+ orientation: Qt.Horizontal
1363+ propagateComposedEvents: true
1364+
1365+ Component.onCompleted: {
1366+ // set evaluators to baseline of dragValue == 0
1367+ leftEvaluator.reset()
1368+ rightEvaluator.reset()
1369+ }
1370+
1371+ function maybeTease() {
1372+ if (!greeter.locked || greeter.narrowMode)
1373+ greeter.tease();
1374+ }
1375+
1376+ onClicked: maybeTease()
1377+ onDragStart: maybeTease()
1378+ onPressAndHold: {} // eat event, but no need to tease, as drag will cover it
1379+
1380+ onDragEnd: {
1381+ if (rightEvaluator.shouldAutoComplete())
1382+ greeter.hideRight()
1383+ else if (leftEvaluator.shouldAutoComplete())
1384+ greeter.hide();
1385+ else
1386+ greeter.show(); // undo drag
1387+ }
1388+
1389+ onDragValueChanged: {
1390+ // dragValue is kept as a "step" value since we do this x adjusting on the fly
1391+ greeter.x += dragValue
1392+ }
1393+
1394+ EdgeDragEvaluator {
1395+ id: rightEvaluator
1396+ trackedPosition: dragHandle.dragValue + greeter.x
1397+ maxDragDistance: parent.width
1398+ direction: Direction.Rightwards
1399+ }
1400+
1401+ EdgeDragEvaluator {
1402+ id: leftEvaluator
1403+ trackedPosition: dragHandle.dragValue + greeter.x
1404+ maxDragDistance: parent.width
1405+ direction: Direction.Leftwards
1406+ }
1407+ }
1408+
1409+ Rectangle {
1410+ // To hide lockscreen until background finished fading in
1411+ id: backgroundBackup
1412+ anchors {
1413+ fill: parent
1414+ topMargin: -greeter.y
1415+ }
1416+ color: "black"
1417+ }
1418+
1419+ CrossFadeImage {
1420+ id: backgroundImage
1421+ objectName: "greeterBackground"
1422+ anchors {
1423+ fill: parent
1424+ topMargin: -greeter.y
1425+ }
1426+ source: greeter.background
1427+ fillMode: Image.PreserveAspectCrop
1428+
1429+ StandardAnimation {
1430+ running: true
1431+ target: backgroundImage
1432+ property: "opacity"
1433+ from: 0.0
1434+ to: 1.0
1435+ duration: 800
1436 }
1437 }
1438
1439@@ -63,7 +149,6 @@
1440 property var model: LightDM.Users
1441 property int currentIndex: 0
1442 property var infographicModel: LightDM.Infographic
1443- readonly property int backgroundTopMargin: -greeter.y
1444
1445 source: required ? "GreeterContent.qml" : ""
1446
1447@@ -82,45 +167,54 @@
1448 }
1449 }
1450
1451- Timer {
1452- id: teasingTimer
1453- interval: 200
1454- }
1455-
1456- states: [
1457- State {
1458- name: "teasing"
1459- when: teasingTimer.running
1460- PropertyChanges {
1461- target: greeter
1462- x: -dragHandle.hintDisplacement
1463- }
1464- }
1465- ]
1466- transitions: [
1467- Transition {
1468- from: "*"
1469- to: "*"
1470- NumberAnimation {
1471- target: greeter
1472- property: "x"
1473- duration: 300
1474- easing.type: Easing.OutCubic
1475- }
1476- }
1477- ]
1478-
1479- DragHandle {
1480- id: dragHandle
1481-
1482- anchors.top: parent.top
1483- anchors.bottom: parent.bottom
1484- anchors.right: parent.right
1485-
1486- hintDisplacement: units.gu(2)
1487-
1488- enabled: greeter.narrowMode || !greeter.locked
1489-
1490- direction: Direction.Leftwards
1491+ onTease: showLabelAnimation.start()
1492+
1493+ Label {
1494+ id: swipeHint
1495+ visible: greeter.shown
1496+ property real baseOpacity: 0.5
1497+ opacity: 0.0
1498+ anchors.horizontalCenter: parent.horizontalCenter
1499+ anchors.bottom: parent.bottom
1500+ anchors.bottomMargin: units.gu(5)
1501+ text: i18n.tr("Swipe to unlock")
1502+ color: "white"
1503+ font.weight: Font.Light
1504+
1505+ SequentialAnimation on opacity {
1506+ id: showLabelAnimation
1507+ running: false
1508+ loops: 2
1509+
1510+ StandardAnimation {
1511+ from: 0.0
1512+ to: swipeHint.baseOpacity
1513+ duration: UbuntuAnimation.SleepyDuration
1514+ }
1515+ PauseAnimation { duration: UbuntuAnimation.BriskDuration }
1516+ StandardAnimation {
1517+ from: swipeHint.baseOpacity
1518+ to: 0.0
1519+ duration: UbuntuAnimation.SleepyDuration
1520+ }
1521+ }
1522+ }
1523+
1524+ // right side shadow
1525+ Image {
1526+ anchors.left: parent.right
1527+ anchors.top: parent.top
1528+ anchors.bottom: parent.bottom
1529+ fillMode: Image.Tile
1530+ source: "../graphics/dropshadow_right.png"
1531+ }
1532+
1533+ // left side shadow
1534+ Image {
1535+ anchors.right: parent.left
1536+ anchors.top: parent.top
1537+ anchors.bottom: parent.bottom
1538+ fillMode: Image.Tile
1539+ source: "../graphics/dropshadow_left.png"
1540 }
1541 }
1542
1543=== modified file 'qml/Greeter/GreeterContent.qml'
1544--- qml/Greeter/GreeterContent.qml 2014-02-20 20:14:40 +0000
1545+++ qml/Greeter/GreeterContent.qml 2014-03-27 20:58:22 +0000
1546@@ -20,65 +20,13 @@
1547 import LightDM 0.1 as LightDM
1548 import "../Components"
1549
1550-MouseArea {
1551+Item {
1552 id: root
1553 anchors.fill: parent
1554
1555- property bool ready: background.source == "" || background.status == Image.Ready || background.status == Image.Error
1556- property bool leftTeaserPressed: teasingMouseArea.pressed &&
1557- teasingMouseArea.mouseX < teasingMouseArea.width / 2
1558- property bool rightTeaserPressed: teasingMouseArea.pressed &&
1559- teasingMouseArea.mouseX > teasingMouseArea.width / 2
1560-
1561 signal selected(int uid)
1562 signal unlocked(int uid)
1563
1564- Rectangle {
1565- // In case background fails to load
1566- id: backgroundBackup
1567- anchors.fill: parent
1568- color: "black"
1569- }
1570-
1571- property url backgroundValue: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : greeter.defaultBackground
1572- onBackgroundValueChanged: background.source = backgroundValue
1573-
1574- CrossFadeImage {
1575- id: background
1576- objectName: "greeterBackground"
1577- anchors {
1578- fill: parent
1579- topMargin: backgroundTopMargin
1580- }
1581- fillMode: Image.PreserveAspectCrop
1582- }
1583-
1584- // See Shell.qml's backgroundSettings treatment for why we need a separate
1585- // Image, but it boils down to avoiding binding loop detection.
1586- Image {
1587- source: background.source
1588- height: 0
1589- width: 0
1590- sourceSize.height: 0
1591- sourceSize.width: 0
1592- onStatusChanged: {
1593- if (status == Image.Error && source != greeter.defaultBackground) {
1594- background.source = greeter.defaultBackground
1595- }
1596- }
1597- }
1598-
1599- Rectangle {
1600- anchors.fill: parent
1601- color: "black"
1602- opacity: 0.4
1603- }
1604-
1605- MouseArea {
1606- id: teasingMouseArea
1607- anchors.fill: parent
1608- }
1609-
1610 Loader {
1611 id: loginLoader
1612 objectName: "loginLoader"
1613@@ -129,6 +77,7 @@
1614 objectName: "infographics"
1615 height: narrowMode ? parent.height : 0.75 * parent.height
1616 model: greeterContentLoader.infographicModel
1617+ opacity: 0.0
1618
1619 property string selectedUser
1620 property string infographicUser: AccountsService.statsWelcomeScreen ? selectedUser : ""
1621@@ -150,16 +99,64 @@
1622 left: narrowMode ? root.left : loginLoader.right
1623 right: root.right
1624 }
1625+
1626+ ParallelAnimation {
1627+ id: infoFadeAnimation
1628+ StandardAnimation {
1629+ target: infographics
1630+ property: "opacity"
1631+ from: 0.0
1632+ to: 1.0
1633+ duration: 800
1634+ }
1635+ StandardAnimation {
1636+ target: infographics
1637+ property: "scale"
1638+ from: 0.9
1639+ to: 1.0
1640+ duration: 800
1641+ }
1642+ }
1643+
1644+ Timer {
1645+ running: true
1646+ interval: 200
1647+ onTriggered: infoFadeAnimation.start()
1648+ }
1649 }
1650
1651 Clock {
1652 id: clock
1653- visible: narrowMode
1654+ opacity: 0.0
1655
1656 anchors {
1657 top: parent.top
1658 topMargin: units.gu(2)
1659 horizontalCenter: parent.horizontalCenter
1660 }
1661+
1662+ ParallelAnimation {
1663+ id: clockFadeAnimation
1664+ StandardAnimation {
1665+ target: clock
1666+ property: "opacity"
1667+ from: 0.0
1668+ to: 1.0
1669+ duration: 600
1670+ }
1671+ StandardAnimation {
1672+ target: clock
1673+ property: "scale"
1674+ from: 0.9
1675+ to: 1.0
1676+ duration: 600
1677+ }
1678+ }
1679+
1680+ Timer {
1681+ running: narrowMode
1682+ interval: 600
1683+ onTriggered: clockFadeAnimation.start()
1684+ }
1685 }
1686 }
1687
1688=== added file 'qml/Greeter/GreeterEdgeDemo.qml'
1689--- qml/Greeter/GreeterEdgeDemo.qml 1970-01-01 00:00:00 +0000
1690+++ qml/Greeter/GreeterEdgeDemo.qml 2014-03-27 20:58:22 +0000
1691@@ -0,0 +1,102 @@
1692+/*
1693+ * Copyright (C) 2013 Canonical, Ltd.
1694+ *
1695+ * This program is free software; you can redistribute it and/or modify
1696+ * it under the terms of the GNU General Public License as published by
1697+ * the Free Software Foundation; version 3.
1698+ *
1699+ * This program is distributed in the hope that it will be useful,
1700+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1701+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1702+ * GNU General Public License for more details.
1703+ *
1704+ * You should have received a copy of the GNU General Public License
1705+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1706+ */
1707+
1708+import AccountsService 0.1
1709+import LightDM 0.1 as LightDM
1710+import QtQuick 2.0
1711+
1712+Item {
1713+ id: demo
1714+
1715+ property Item greeter
1716+
1717+ property bool active: false
1718+ property bool paused: false
1719+
1720+ onPausedChanged: {
1721+ if (d.rightEdgeDemo) d.rightEdgeDemo.paused = paused
1722+ }
1723+
1724+ function hideEdgeDemoInShell() {
1725+ AccountsService.demoEdges = false;
1726+ }
1727+
1728+ function hideEdgeDemoInGreeter() {
1729+ AccountsService.demoEdgesForCurrentUser = false;
1730+ }
1731+
1732+ function hideEdgeDemos() {
1733+ hideEdgeDemoInGreeter();
1734+ hideEdgeDemoInShell();
1735+ }
1736+
1737+ function startDemo() {
1738+ if (!d.overlay) {
1739+ d.overlay = Qt.createComponent("../Components/EdgeDemoOverlay.qml")
1740+ }
1741+ startRightEdgeDemo()
1742+ }
1743+
1744+ function stopDemo() {
1745+ active = false
1746+ if (d.rightEdgeDemo) d.rightEdgeDemo.destroy()
1747+ }
1748+
1749+ QtObject {
1750+ id: d
1751+ property Component overlay
1752+ property QtObject rightEdgeDemo
1753+ property bool showEdgeDemoInGreeter: AccountsService.demoEdgesForCurrentUser && AccountsService.demoEdges
1754+
1755+ onShowEdgeDemoInGreeterChanged: {
1756+ stopDemo()
1757+ if (d.showEdgeDemoInGreeter) {
1758+ startDemo()
1759+ }
1760+ }
1761+ }
1762+
1763+ function startRightEdgeDemo() {
1764+ active = true;
1765+ if (demo.greeter) {
1766+ d.rightEdgeDemo = d.overlay.createObject(demo.greeter, {
1767+ "edge": "right",
1768+ "title": i18n.tr("Right edge"),
1769+ "text": i18n.tr("Try swiping from the right edge to unlock the phone"),
1770+ "anchors.fill": demo.greeter,
1771+ });
1772+ }
1773+ if (d.rightEdgeDemo) {
1774+ d.rightEdgeDemo.onSkip.connect(demo.hideEdgeDemos)
1775+ } else {
1776+ stopDemo();
1777+ }
1778+ }
1779+
1780+ Connections {
1781+ target: demo.greeter
1782+
1783+ function hide() {
1784+ if (d.rightEdgeDemo && d.rightEdgeDemo.available) {
1785+ d.rightEdgeDemo.hide()
1786+ hideEdgeDemoInGreeter()
1787+ }
1788+ }
1789+
1790+ onUnlocked: hide()
1791+ onShownChanged: if (!greeter.shown) hide()
1792+ }
1793+}
1794
1795=== modified file 'qml/Greeter/Infographics.qml'
1796--- qml/Greeter/Infographics.qml 2013-10-11 16:17:18 +0000
1797+++ qml/Greeter/Infographics.qml 2014-03-27 20:58:22 +0000
1798@@ -59,8 +59,6 @@
1799
1800 visible: model.label !== ""
1801
1802- Component.onCompleted: startShowAnimation()
1803-
1804 Item {
1805 id: dataCircle
1806 objectName: "dataCircle"
1807@@ -457,5 +455,8 @@
1808 !circleGrowAnimTimer.running)
1809 infographic.model.nextDataSource()
1810 }
1811+
1812+ onClicked: mouse.accepted = false
1813+ onPressed: mouse.accepted = false
1814 }
1815 }
1816
1817=== added file 'qml/GreeterShell.qml'
1818--- qml/GreeterShell.qml 1970-01-01 00:00:00 +0000
1819+++ qml/GreeterShell.qml 2014-03-27 20:58:22 +0000
1820@@ -0,0 +1,285 @@
1821+/*
1822+ * Copyright (C) 2013 Canonical, Ltd.
1823+ *
1824+ * This program is free software; you can redistribute it and/or modify
1825+ * it under the terms of the GNU General Public License as published by
1826+ * the Free Software Foundation; version 3.
1827+ *
1828+ * This program is distributed in the hope that it will be useful,
1829+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1830+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1831+ * GNU General Public License for more details.
1832+ *
1833+ * You should have received a copy of the GNU General Public License
1834+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1835+ */
1836+
1837+import AccountsService 0.1
1838+import GSettings 1.0
1839+import LightDM 0.1 as LightDM
1840+import Powerd 0.1
1841+import QtQuick 2.0
1842+import SessionBroadcast 0.1
1843+import Ubuntu.Components 0.1
1844+import Unity.Application 0.1
1845+import Unity.Launcher 0.1
1846+import "Components"
1847+import "Greeter"
1848+import "Launcher"
1849+import "Panel"
1850+import "Notifications"
1851+import Unity.Notifications 1.0 as NotificationBackend
1852+
1853+BasicShell {
1854+ id: shell
1855+
1856+ function activateApplication(appId) {
1857+ SessionBroadcast.requestUrlStart(LightDM.Greeter.authenticationUser, appId)
1858+ greeter.hide()
1859+ }
1860+
1861+ GSettings {
1862+ id: backgroundSettings
1863+ schema.id: "org.gnome.desktop.background"
1864+ }
1865+ backgroundFallbackSource: backgroundSettings.pictureUri // for ease of customization by system builders
1866+ backgroundSource: AccountsService.backgroundFile
1867+
1868+ Lockscreen {
1869+ id: lockscreen
1870+ objectName: "lockscreen"
1871+
1872+ hides: [launcher, panel.indicators]
1873+ shown: false
1874+ enabled: true
1875+ showAnimation: StandardAnimation { property: "opacity"; to: 1 }
1876+ hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
1877+ y: panel.panelHeight
1878+ x: required ? 0 : - width
1879+ width: parent.width
1880+ height: parent.height - panel.panelHeight
1881+ pinLength: 4
1882+
1883+ onEntered: LightDM.Greeter.respond(passphrase);
1884+ onCancel: greeter.show()
1885+
1886+ Component.onCompleted: {
1887+ if (LightDM.Users.count == 1) {
1888+ LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
1889+ }
1890+ }
1891+ }
1892+
1893+ Connections {
1894+ target: LightDM.Greeter
1895+
1896+ onShowPrompt: {
1897+ if (LightDM.Users.count == 1) {
1898+ // TODO: There's no better way for now to determine if its a PIN or a passphrase.
1899+ if (text == "PIN") {
1900+ lockscreen.alphaNumeric = false
1901+ } else {
1902+ lockscreen.alphaNumeric = true
1903+ }
1904+ lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
1905+ lockscreen.show();
1906+ }
1907+ }
1908+
1909+ onAuthenticationComplete: {
1910+ if (LightDM.Greeter.promptless) {
1911+ return;
1912+ }
1913+ if (LightDM.Greeter.authenticated) {
1914+ lockscreen.hide();
1915+ } else {
1916+ lockscreen.clear(true);
1917+ }
1918+ }
1919+ }
1920+
1921+ Item {
1922+ // Just a tiny wrapper to adjust greeter's x without messing with its own dragging
1923+ width: parent.width
1924+ height: parent.height
1925+ x: launcher.progress
1926+ Behavior on x {SmoothedAnimation{velocity: 600}}
1927+
1928+ Rectangle {
1929+ anchors.fill: parent
1930+ color: "black"
1931+ opacity: (1 - Math.abs(greeter.x) / shell.width) * 0.8
1932+ }
1933+
1934+ Greeter {
1935+ id: greeter
1936+ objectName: "greeter"
1937+
1938+ available: true
1939+ hides: [launcher, panel.indicators]
1940+ shown: true
1941+ background: shell.background
1942+
1943+ y: panel.panelHeight
1944+ width: parent.width
1945+ height: parent.height - panel.panelHeight
1946+
1947+ dragHandleWidth: shell.edgeSize
1948+
1949+ function login() {
1950+ enabled = false;
1951+ LightDM.Greeter.startSessionSync();
1952+ }
1953+
1954+ onShownChanged: {
1955+ if (shown) {
1956+ lockscreen.reset();
1957+ // If there is only one user, we start authenticating with that one here.
1958+ // If there are more users, the Greeter will handle that
1959+ if (LightDM.Users.count == 1) {
1960+ LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
1961+ }
1962+ greeter.forceActiveFocus();
1963+ }
1964+ }
1965+
1966+ onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress == 0) login()
1967+
1968+ onUnlocked: login()
1969+ onSelected: {
1970+ // Update launcher items for new user
1971+ var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
1972+ AccountsService.user = user;
1973+ LauncherModel.setUser(user);
1974+ }
1975+ onTease: launcher.tease()
1976+ }
1977+ }
1978+
1979+ InputFilterArea {
1980+ anchors.fill: parent
1981+ blockInput: true
1982+ }
1983+
1984+ Revealer {
1985+ id: greeterRevealer
1986+ objectName: "greeterRevealer"
1987+
1988+ property real animatedProgress: MathUtils.clamp(-dragPosition / closedValue, 0, 1)
1989+ target: greeter
1990+ width: greeter.width
1991+ height: greeter.height
1992+ handleSize: shell.edgeSize
1993+ orientation: Qt.Horizontal
1994+ enabled: !greeter.locked
1995+ }
1996+
1997+ Item {
1998+ id: overlay
1999+
2000+ anchors.fill: parent
2001+
2002+ Panel {
2003+ id: panel
2004+ anchors.fill: parent //because this draws indicator menus
2005+ indicatorsMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
2006+ indicators {
2007+ hides: [launcher]
2008+ available: !edgeDemo.active
2009+ }
2010+ fullscreenMode: initialPanelDelay.running
2011+ searchVisible: false
2012+ }
2013+
2014+ Timer {
2015+ id: initialPanelDelay
2016+ running: true
2017+ interval: 300
2018+ }
2019+
2020+ Launcher {
2021+ id: launcher
2022+
2023+ anchors.top: parent.top
2024+ anchors.bottom: parent.bottom
2025+ width: parent.width
2026+ dragAreaWidth: shell.edgeSize
2027+ available: greeter.narrowMode && !edgeDemo.active
2028+ onLauncherApplicationSelected: {
2029+ shell.activateApplication("application:///" + appId + ".desktop")
2030+ }
2031+ onShownChanged: {
2032+ if (shown) {
2033+ panel.indicators.hide()
2034+ }
2035+ }
2036+ onDash: {
2037+ hide()
2038+ greeter.hideRight()
2039+ }
2040+ onShowDashHome: greeter.show()
2041+ }
2042+
2043+ Notifications {
2044+ id: notifications
2045+
2046+ model: NotificationBackend.Model
2047+ anchors {
2048+ top: parent.top
2049+ right: parent.right
2050+ bottom: parent.bottom
2051+ leftMargin: units.gu(1)
2052+ rightMargin: units.gu(1)
2053+ topMargin: panel.panelHeight + units.gu(1)
2054+ }
2055+ states: [
2056+ State {
2057+ name: "narrow"
2058+ when: overlay.width <= units.gu(60)
2059+ AnchorChanges { target: notifications; anchors.left: parent.left }
2060+ },
2061+ State {
2062+ name: "wide"
2063+ when: overlay.width > units.gu(60)
2064+ AnchorChanges { target: notifications; anchors.left: undefined }
2065+ PropertyChanges { target: notifications; width: units.gu(38) }
2066+ }
2067+ ]
2068+
2069+ InputFilterArea {
2070+ anchors { left: parent.left; right: parent.right }
2071+ height: parent.contentHeight
2072+ blockInput: height > 0
2073+ }
2074+ }
2075+ }
2076+
2077+ OSKController {
2078+ anchors.topMargin: panel.panelHeight
2079+ anchors.fill: parent // as needs to know the geometry of the shell
2080+ }
2081+
2082+ Connections {
2083+ id: powerConnection
2084+ target: Powerd
2085+
2086+ onDisplayPowerStateChange: {
2087+ if (status == Powerd.Off) {
2088+ greeter.show();
2089+ edgeDemo.paused = true;
2090+ } else if (status == Powerd.On) {
2091+ edgeDemo.paused = false;
2092+ }
2093+ }
2094+ }
2095+
2096+ Connections {
2097+ target: LightDM.URLDispatcher
2098+ onDispatchURL: shell.activateApplication(url)
2099+ }
2100+
2101+ GreeterEdgeDemo {
2102+ id: edgeDemo
2103+ greeter: greeter
2104+ }
2105+}
2106
2107=== modified file 'qml/Hud/Hud.qml'
2108--- qml/Hud/Hud.qml 2013-06-05 22:03:08 +0000
2109+++ qml/Hud/Hud.qml 2014-03-27 20:58:22 +0000
2110@@ -227,10 +227,7 @@
2111 width: parent.width
2112
2113 onYChanged: {
2114- if (greeter.shown) {
2115- showAnimation.duration = 0
2116- hideAnimation.duration = 0
2117- } else if (!showAnimation.running && !hideAnimation.running) {
2118+ if (!showAnimation.running && !hideAnimation.running) {
2119 if (parent.height > 0) {
2120 showAnimation.duration = Math.min(showableAnimationDuration * (1 - (parent.height - y) / parent.height), showableAnimationDuration)
2121 hideAnimation.duration = showableAnimationDuration - showAnimation.duration
2122@@ -491,6 +488,6 @@
2123 anchors.top: hudContentClipper.top
2124 anchors.bottom: hudContentClipper.bottom
2125 fillMode: Image.Tile
2126- source: "graphics/dropshadow_right.png"
2127+ source: "../graphics/dropshadow_right.png"
2128 }
2129 }
2130
2131=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
2132--- qml/Notifications/NotificationMenuItemFactory.qml 2013-12-23 12:26:18 +0000
2133+++ qml/Notifications/NotificationMenuItemFactory.qml 2014-03-27 20:58:22 +0000
2134@@ -20,7 +20,6 @@
2135 import QtQuick 2.0
2136 import Ubuntu.Components 0.1
2137 import "../Components"
2138-import "../Greeter"
2139
2140 Loader {
2141 id: menuFactory
2142
2143=== modified file 'qml/Panel/Panel.qml'
2144--- qml/Panel/Panel.qml 2014-01-14 15:35:57 +0000
2145+++ qml/Panel/Panel.qml 2014-03-27 20:58:22 +0000
2146@@ -62,7 +62,7 @@
2147 height: __panelMinusSeparatorLineHeight
2148 y: 0
2149
2150- Behavior on y { StandardAnimation {} }
2151+ Behavior on y { StandardAnimation {duration: 500} }
2152 }
2153
2154 PanelSeparatorLine {
2155
2156=== modified file 'qml/Shell.qml'
2157--- qml/Shell.qml 2014-03-19 22:21:57 +0000
2158+++ qml/Shell.qml 2014-03-27 20:58:22 +0000
2159@@ -21,11 +21,10 @@
2160 import Ubuntu.Components 0.1
2161 import Ubuntu.Gestures 0.1
2162 import Unity.Launcher 0.1
2163-import LightDM 0.1 as LightDM
2164 import Powerd 0.1
2165 import SessionBroadcast 0.1
2166+import SessionManager 0.1
2167 import "Dash"
2168-import "Greeter"
2169 import "Launcher"
2170 import "Panel"
2171 import "Hud"
2172@@ -35,17 +34,9 @@
2173 import "Notifications"
2174 import Unity.Notifications 1.0 as NotificationBackend
2175
2176-FocusScope {
2177+BasicShell {
2178 id: shell
2179
2180- // this is only here to select the width / height of the window if not running fullscreen
2181- property bool tablet: false
2182- width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
2183- height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
2184-
2185- property real edgeSize: units.gu(2)
2186- property url defaultBackground: Qt.resolvedUrl(shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg")
2187- property url background
2188 readonly property real panelHeight: panel.panelHeight
2189
2190 property bool dashShown: dash.shown
2191@@ -85,9 +76,7 @@
2192 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
2193
2194 readonly property bool fullscreenMode: {
2195- if (greeter.shown || lockscreen.shown) {
2196- return false;
2197- } else if (mainStage.usingScreenshots) { // Window Manager animating so want to re-evaluate fullscreen mode
2198+ if (mainStage.usingScreenshots) { // Window Manager animating so want to re-evaluate fullscreen mode
2199 return mainStage.switchingFromFullscreenToFullscreen;
2200 } else if (applicationManager.mainStageFocusedApplication) {
2201 return applicationManager.mainStageFocusedApplication.fullscreen;
2202@@ -120,17 +109,7 @@
2203 id: backgroundSettings
2204 schema.id: "org.gnome.desktop.background"
2205 }
2206- property url gSettingsPicture: backgroundSettings.pictureUri != undefined && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : shell.defaultBackground
2207- onGSettingsPictureChanged: {
2208- shell.background = gSettingsPicture
2209- }
2210-
2211- VolumeControl {
2212- id: volumeControl
2213- }
2214-
2215- Keys.onVolumeUpPressed: volumeControl.volumeUp()
2216- Keys.onVolumeDownPressed: volumeControl.volumeDown()
2217+ backgroundSource: backgroundSettings.pictureUri
2218
2219 Item {
2220 id: underlay
2221@@ -171,7 +150,6 @@
2222 id: dash
2223 objectName: "dash"
2224
2225- available: !greeter.shown && !lockscreen.shown
2226 hides: [stages, launcher, panel.indicators]
2227 shown: disappearingAnimationProgress !== 1.0
2228 enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
2229@@ -189,16 +167,10 @@
2230
2231 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
2232 opacity: 1.0 - disappearingAnimationProgress
2233- property real disappearingAnimationProgress: {
2234- if (greeter.shown) {
2235- return greeter.showProgress;
2236- } else {
2237- return stagesOuterContainer.showProgress;
2238- }
2239- }
2240+ property real disappearingAnimationProgress: stagesOuterContainer.showProgress
2241
2242- // FIXME: only necessary because stagesOuterContainer.showProgress and
2243- // greeterRevealer.animatedProgress are not animated
2244+ // FIXME: only necessary because stagesOuterContainer.showProgress
2245+ // is not animated
2246 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
2247 }
2248 }
2249@@ -222,7 +194,6 @@
2250
2251 property bool fullyShown: shown && x == 0 && parent.x == 0
2252 property bool fullyHidden: !shown && x == width
2253- available: !greeter.shown
2254 hides: [panel.indicators]
2255 shown: false
2256 opacity: 1.0
2257@@ -324,7 +295,7 @@
2258 && sideStage[sideStageRevealer.boundProperty] == sideStageRevealer.openedValue
2259 shouldUseScreenshots: !fullyShown || mainStage.usingScreenshots || sideStageRevealer.pressed
2260
2261- available: !greeter.shown && !lockscreen.shown && enabled
2262+ available: enabled
2263 hides: [launcher, panel.indicators]
2264 shown: false
2265 showAnimation: StandardAnimation { property: "x"; duration: 350; to: sideStageRevealer.openedValue; easing.type: Easing.OutQuint }
2266@@ -365,7 +336,7 @@
2267
2268 width: shell.edgeSize
2269 direction: Direction.Leftwards
2270- enabled: greeter.showProgress == 0 && edgeDemo.dashEnabled
2271+ enabled: edgeDemo.dashEnabled
2272 property bool haveApps: mainStage.applications.count > 0 || sideStage.applications.count > 0
2273
2274 maxTotalDragDistance: haveApps ? parent.width : parent.width * 0.7
2275@@ -375,155 +346,43 @@
2276 }
2277 }
2278
2279- Lockscreen {
2280- id: lockscreen
2281- objectName: "lockscreen"
2282-
2283- readonly property int backgroundTopMargin: -panel.panelHeight
2284-
2285- hides: [launcher, panel.indicators, hud]
2286- shown: false
2287- enabled: true
2288- showAnimation: StandardAnimation { property: "opacity"; to: 1 }
2289- hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
2290- y: panel.panelHeight
2291- x: required ? 0 : - width
2292- width: parent.width
2293- height: parent.height - panel.panelHeight
2294- background: shell.background
2295- pinLength: 4
2296-
2297- onEntered: LightDM.Greeter.respond(passphrase);
2298- onCancel: greeter.show()
2299-
2300- Component.onCompleted: {
2301- if (LightDM.Users.count == 1) {
2302- LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
2303- }
2304- }
2305+ InputFilterArea {
2306+ anchors.fill: parent
2307+ blockInput: !applicationFocused || launcher.shown
2308+ || panel.indicators.shown || hud.shown
2309 }
2310
2311 Connections {
2312- target: LightDM.Greeter
2313-
2314- onShowPrompt: {
2315- if (LightDM.Users.count == 1) {
2316- // TODO: There's no better way for now to determine if its a PIN or a passphrase.
2317- if (text == "PIN") {
2318- lockscreen.alphaNumeric = false
2319- } else {
2320- lockscreen.alphaNumeric = true
2321- }
2322- lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
2323- lockscreen.show();
2324- }
2325- }
2326-
2327- onAuthenticationComplete: {
2328- if (LightDM.Greeter.promptless) {
2329- return;
2330- }
2331- if (LightDM.Greeter.authenticated) {
2332- lockscreen.hide();
2333- } else {
2334- lockscreen.clear(true);
2335- }
2336- }
2337- }
2338-
2339- Greeter {
2340- id: greeter
2341- objectName: "greeter"
2342-
2343- available: true
2344- hides: [launcher, panel.indicators, hud]
2345- shown: true
2346-
2347- defaultBackground: shell.background
2348-
2349- y: panel.panelHeight
2350- width: parent.width
2351- height: parent.height - panel.panelHeight
2352-
2353- dragHandleWidth: shell.edgeSize
2354+ id: sessionConnection
2355+ target: SessionManager
2356
2357 property var previousMainApp: null
2358 property var previousSideApp: null
2359
2360 function removeApplicationFocus() {
2361- greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
2362- greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
2363+ sessionConnection.previousMainApp = applicationManager.mainStageFocusedApplication;
2364+ sessionConnection.previousSideApp = applicationManager.sideStageFocusedApplication;
2365 applicationManager.unfocusCurrentApplication();
2366 }
2367
2368 function restoreApplicationFocus() {
2369- if (greeter.previousMainApp) {
2370- applicationManager.focusApplication(greeter.previousMainApp);
2371- greeter.previousMainApp = null;
2372+ if (sessionConnection.previousMainApp) {
2373+ applicationManager.focusApplication(sessionConnection.previousMainApp);
2374+ sessionConnection.previousMainApp = null;
2375 }
2376- if (greeter.previousSideApp) {
2377- applicationManager.focusApplication(greeter.previousSideApp);
2378- greeter.previousSideApp = null;
2379+ if (sessionConnection.previousSideApp) {
2380+ applicationManager.focusApplication(sessionConnection.previousSideApp);
2381+ sessionConnection.previousSideApp = null;
2382 }
2383 }
2384
2385- onShownChanged: {
2386- if (shown) {
2387- lockscreen.reset();
2388- // If there is only one user, we start authenticating with that one here.
2389- // If there are more users, the Greeter will handle that
2390- if (LightDM.Users.count == 1) {
2391- LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
2392- }
2393- greeter.forceActiveFocus();
2394+ onActiveChanged: {
2395+ if (SessionManager.active) {
2396+ restoreApplicationFocus();
2397+ } else {
2398 removeApplicationFocus();
2399- } else {
2400- restoreApplicationFocus();
2401- }
2402- }
2403-
2404- onUnlocked: greeter.hide()
2405- onSelected: {
2406- // Update launcher items for new user
2407- var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
2408- AccountsService.user = user;
2409- LauncherModel.setUser(user);
2410- }
2411-
2412- onLeftTeaserPressedChanged: {
2413- if (leftTeaserPressed) {
2414- launcher.tease();
2415- }
2416- }
2417-
2418- Connections {
2419- target: applicationManager
2420- ignoreUnknownSignals: true
2421- // If any app is focused when greeter is open, it's due to a user action
2422- // like a snap decision (say, an incoming call).
2423- // TODO: these should be protected to only unlock for certain applications / certain usecases
2424- // potentially only in connection with a notification.
2425- onMainStageFocusedApplicationChanged: {
2426- if (greeter.shown && applicationManager.mainStageFocusedApplication) {
2427- greeter.previousMainApp = null // make way for new focused app
2428- greeter.previousSideApp = null
2429- greeter.hide()
2430- }
2431- }
2432- onSideStageFocusedApplicationChanged: {
2433- if (greeter.shown && applicationManager.sideStageFocusedApplication) {
2434- greeter.previousMainApp = null // make way for new focused app
2435- greeter.previousSideApp = null
2436- greeter.hide()
2437- }
2438- }
2439- }
2440- }
2441-
2442- InputFilterArea {
2443- anchors.fill: parent
2444- blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
2445- || panel.indicators.shown || hud.shown
2446+ }
2447+ }
2448 }
2449
2450 Connections {
2451@@ -534,7 +393,7 @@
2452 // We ignore any display-off signals when the proximity sensor
2453 // is active. This usually indicates something like a phone call.
2454 if (status == Powerd.Off && (flags & Powerd.UseProximity) == 0) {
2455- greeter.showNow();
2456+ SessionManager.lock();
2457 }
2458
2459 // No reason to chew demo CPU when user isn't watching
2460@@ -546,17 +405,12 @@
2461 }
2462 }
2463
2464- function showHome() {
2465- var animate = !greeter.shown && !stages.shown
2466- greeter.hide()
2467+ function showHome(fromLauncher) {
2468+ var animate = fromLauncher && !stages.shown
2469 dash.setCurrentScope("clickscope", animate, false)
2470 stages.hide()
2471 }
2472
2473- function hideIndicatorMenu(delay) {
2474- panel.hideIndicatorMenu(delay);
2475- }
2476-
2477 Item {
2478 id: overlay
2479
2480@@ -572,7 +426,7 @@
2481 contentEnabled: edgeDemo.panelContentEnabled
2482 }
2483 fullscreenMode: shell.fullscreenMode
2484- searchVisible: !greeter.shown && !lockscreen.shown && dash.shown && dash.searchable
2485+ searchVisible: dash.shown && dash.searchable
2486
2487 InputFilterArea {
2488 anchors {
2489@@ -591,7 +445,7 @@
2490 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
2491 height: parent.height
2492
2493- available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown && edgeDemo.dashEnabled
2494+ available: !panel.indicators.shown && edgeDemo.dashEnabled
2495 shown: false
2496 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
2497 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
2498@@ -646,14 +500,14 @@
2499 anchors.bottom: parent.bottom
2500 width: parent.width
2501 dragAreaWidth: shell.edgeSize
2502- available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
2503-
2504+ available: edgeDemo.launcherEnabled
2505 onShowDashHome: {
2506 if (edgeDemo.running)
2507 return;
2508
2509- showHome()
2510+ showHome(true)
2511 }
2512+
2513 onDash: {
2514 if (stages.shown) {
2515 stages.hide();
2516@@ -665,7 +519,6 @@
2517 if (edgeDemo.running)
2518 return;
2519
2520- greeter.hide()
2521 shell.activateApplication(appId)
2522 }
2523 onShownChanged: {
2524@@ -711,9 +564,6 @@
2525 }
2526 }
2527
2528- focus: true
2529- onFocusChanged: if (!focus) forceActiveFocus();
2530-
2531 InputFilterArea {
2532 anchors {
2533 top: parent.top
2534@@ -734,12 +584,6 @@
2535 blockInput: true
2536 }
2537
2538- Binding {
2539- target: i18n
2540- property: "domain"
2541- value: "unity8"
2542- }
2543-
2544 OSKController {
2545 anchors.topMargin: panel.panelHeight
2546 anchors.fill: parent // as needs to know the geometry of the shell
2547@@ -771,7 +615,6 @@
2548
2549 EdgeDemo {
2550 id: edgeDemo
2551- greeter: greeter
2552 launcher: launcher
2553 dash: dash
2554 indicators: panel.indicators
2555@@ -780,6 +623,6 @@
2556
2557 Connections {
2558 target: SessionBroadcast
2559- onShowHome: showHome()
2560+ onShowHome: showHome(false)
2561 }
2562 }
2563
2564=== added file 'qml/graphics/dropshadow_left@20.png'
2565Binary files qml/graphics/dropshadow_left@20.png 1970-01-01 00:00:00 +0000 and qml/graphics/dropshadow_left@20.png 2014-03-27 20:58:22 +0000 differ
2566=== renamed file 'qml/Hud/graphics/dropshadow_right@20.png' => 'qml/graphics/dropshadow_right@20.png'
2567=== modified file 'run'
2568--- run 2013-12-17 14:56:25 +0000
2569+++ run 2014-03-27 20:58:22 +0000
2570@@ -18,13 +18,14 @@
2571 echo " -p, --pinlock Use a pin protected user." >&2
2572 echo " -k, --keylock Use a passphrase protected user." >&2
2573 echo " -g, --gdb Run through gdb." >&2
2574+ echo " -G, --greeter Run the greeter instead of the shell." >&2
2575 echo " -h, --help Show this help." >&2
2576 echo " -m, --nomousetouch Run without -mousetouch argument." >&2
2577 echo >&2
2578 exit 1
2579 }
2580
2581-ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,help,nomousetouch" -o "fpkghm" -- "$@"`
2582+ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,greeter,help,nomousetouch" -o "fpkgGhm" -- "$@"`
2583 [ $? -ne 0 ] && usage
2584 eval set -- "$ARGS"
2585
2586@@ -35,6 +36,7 @@
2587 -p|--pinlock) PINLOCK=true;;
2588 -k|--keylock) KEYLOCK=true;;
2589 -g|--gdb) GDB=true;;
2590+ -G|--greeter) QML_PHONE_SHELL_PATH=./builddir/src/unity8-greeter;;
2591 -h|--help) usage;;
2592 -m|--nomousetouch) MOUSE_TOUCH=false;;
2593 --) shift;break;;
2594@@ -44,17 +46,17 @@
2595
2596 if $FAKE; then
2597 export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
2598- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single
2599+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/liblightdm/single
2600 fi
2601
2602 if $PINLOCK; then
2603 export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
2604- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-pin
2605+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/liblightdm/single-pin
2606 fi
2607
2608 if $KEYLOCK; then
2609 export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
2610- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-passphrase
2611+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/liblightdm/single-passphrase
2612 fi
2613
2614 # Force icon theme if running on the desktop, otherwise gnome theme (if running
2615
2616=== modified file 'src/CMakeLists.txt'
2617--- src/CMakeLists.txt 2014-01-09 08:59:44 +0000
2618+++ src/CMakeLists.txt 2014-03-27 20:58:22 +0000
2619@@ -15,24 +15,36 @@
2620 ${CMAKE_SOURCE_DIR}/tests/*.svg
2621 )
2622
2623-add_executable(${SHELL_APP}
2624+set(COMMON_SRCS
2625 ApplicationArguments.h
2626 main.cpp
2627 MouseTouchAdaptor.cpp
2628 ${QML_FILES} # This is to make qml and image files appear in the IDE's project tree
2629-)
2630+ )
2631+add_executable(${SHELL_APP} ${COMMON_SRCS})
2632+add_executable(${GREETER_APP} ${COMMON_SRCS})
2633+
2634+set_target_properties(${SHELL_APP} PROPERTIES
2635+ COMPILE_DEFINITIONS "UNITY8_GREETER=0"
2636+ )
2637+set_target_properties(${GREETER_APP} PROPERTIES
2638+ COMPILE_DEFINITIONS "UNITY8_GREETER=1"
2639+ )
2640
2641 qt5_use_modules(${SHELL_APP} Gui Qml Quick Test)
2642+qt5_use_modules(${GREETER_APP} Gui Qml Quick Test)
2643 pkg_check_modules(XCB REQUIRED xcb)
2644
2645 if (NOT "${XCB_INCLUDE_DIRS}" STREQUAL "")
2646 set_target_properties(${SHELL_APP} PROPERTIES INCLUDE_DIRECTORIES ${XCB_INCLUDE_DIRS})
2647+ set_target_properties(${GREETER_APP} PROPERTIES INCLUDE_DIRECTORIES ${XCB_INCLUDE_DIRS})
2648
2649 target_link_libraries(${SHELL_APP} ${XCB_LDFLAGS})
2650+ target_link_libraries(${GREETER_APP} ${XCB_LDFLAGS})
2651 endif()
2652
2653 # install binaries
2654-install(TARGETS ${SHELL_APP}
2655+install(TARGETS ${SHELL_APP} ${GREETER_APP}
2656 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
2657 )
2658
2659
2660=== modified file 'src/main.cpp'
2661--- src/main.cpp 2014-03-05 12:52:57 +0000
2662+++ src/main.cpp 2014-03-27 20:58:22 +0000
2663@@ -20,6 +20,7 @@
2664 // Qt
2665 #include <QtQuick/QQuickView>
2666 #include <QtGui/QGuiApplication>
2667+#include <QtGui/QScreen>
2668 #include <QtQml/QQmlEngine>
2669 #include <QtQml/QQmlContext>
2670 #include <qpa/qplatformnativeinterface.h>
2671@@ -41,7 +42,7 @@
2672 {
2673 const bool isUbuntuMirServer = qgetenv("QT_QPA_PLATFORM") == "ubuntumirserver";
2674
2675- QGuiApplication::setApplicationName("Unity 8");
2676+ QGuiApplication::setApplicationName(UNITY8_GREETER ? "Unity 8 Greeter" : "Unity 8");
2677 QGuiApplication *application;
2678 if (isUbuntuMirServer) {
2679 QLibrary unityMir("unity-mir", 1);
2680@@ -61,7 +62,7 @@
2681
2682 QString indicatorProfile = qgetenv("UNITY_INDICATOR_PROFILE");
2683 if (indicatorProfile.isEmpty()) {
2684- indicatorProfile = "phone";
2685+ indicatorProfile = UNITY8_GREETER ? "phone_greeter" : "phone";
2686 }
2687
2688 resolveIconTheme();
2689@@ -115,7 +116,7 @@
2690 nativeInterface->setProperty("ubuntuSessionType", 1);
2691 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
2692
2693- QUrl source(::qmlDirectory()+"Shell.qml");
2694+ QUrl source(::qmlDirectory() + (UNITY8_GREETER ? "GreeterShell.qml" : "Shell.qml"));
2695 prependImportPaths(view->engine(), ::overrideImportPaths());
2696 appendImportPaths(view->engine(), ::fallbackImportPaths());
2697
2698@@ -123,12 +124,23 @@
2699 QStringList importPaths = view->engine()->importPathList();
2700 importPaths.replaceInStrings(QRegExp("qt5/imports$"), "qt5/imports/Unity-Mir");
2701 view->engine()->setImportPathList(importPaths);
2702+
2703+#if UNITY8_GREETER
2704+ // Add alpha to surface, so that the greeter can bleed through
2705+ QSurfaceFormat format;
2706+ format.setAlphaBufferSize(8);
2707+ view->setFormat(format);
2708+#endif
2709 }
2710
2711 view->setSource(source);
2712- view->setColor("transparent");
2713+ view->setColor(Qt::transparent);
2714
2715 if (qgetenv("QT_QPA_PLATFORM") == "ubuntu" || isUbuntuMirServer || args.contains(QLatin1String("-fullscreen"))) {
2716+ // First, size window equal to screen (fake a real WM fullscreen mode).
2717+ // Then, in case we are actually running inside a windowing system,
2718+ // nicely set actual WM fullscreen hint for its benefit.
2719+ view->resize(view->screen()->size());
2720 view->showFullScreen();
2721 } else {
2722 view->show();
2723
2724=== modified file 'tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py'
2725--- tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-02-05 19:14:49 +0000
2726+++ tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-03-27 20:58:22 +0000
2727@@ -21,7 +21,6 @@
2728
2729 from __future__ import absolute_import
2730
2731-from unity8.process_helpers import unlock_unity
2732 from unity8.shell import disable_qml_mocking
2733 from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2734
2735@@ -75,8 +74,7 @@
2736 @disable_qml_mocking
2737 def test_can_launch_application(self):
2738 """Must be able to launch an application."""
2739- unity_proxy = self.launch_unity()
2740- unlock_unity(unity_proxy)
2741+ self.launch_unity()
2742
2743 app = self._launch_app("messaging-app")
2744
2745@@ -89,8 +87,7 @@
2746 @disable_qml_mocking
2747 def test_can_launch_multiple_applications(self):
2748 """A second application launched must be focused."""
2749- unity_proxy = self.launch_unity()
2750- unlock_unity(unity_proxy)
2751+ self.launch_unity()
2752
2753 self._launch_app("messaging-app")
2754 self.assertThat(
2755@@ -110,8 +107,7 @@
2756 brought back to the focused state.
2757
2758 """
2759- unity_proxy = self.launch_unity()
2760- unlock_unity(unity_proxy)
2761+ self.launch_unity()
2762
2763 self._launch_app("messaging-app")
2764 self.assertThat(
2765
2766=== modified file 'tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py'
2767--- tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py 2014-02-24 19:56:26 +0000
2768+++ tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py 2014-03-27 20:58:22 +0000
2769@@ -55,7 +55,6 @@
2770 self._qml_mock_enabled = False
2771 self._data_dirs_mock_enabled = False
2772 unity_proxy = self.launch_unity()
2773- process_helpers.unlock_unity(unity_proxy)
2774
2775 def create_test_application(self):
2776 fake_application = fixture_setup.FakeApplication(self.test_qml)
2777
2778=== modified file 'tests/autopilot/unity8/indicators/tests/test_indicators.py'
2779--- tests/autopilot/unity8/indicators/tests/test_indicators.py 2013-12-05 20:58:30 +0000
2780+++ tests/autopilot/unity8/indicators/tests/test_indicators.py 2014-03-27 20:58:22 +0000
2781@@ -22,7 +22,6 @@
2782 from autopilot import platform
2783 from testtools import skipIf
2784
2785-from unity8.process_helpers import unlock_unity
2786 from unity8.shell.tests import UnityTestCase
2787
2788
2789@@ -45,6 +44,5 @@
2790
2791 def test_indicator_exists(self):
2792 unity_proxy = self.launch_unity()
2793- unlock_unity(unity_proxy)
2794 indicator = self.main_window.get_indicator(self.indicator_name)
2795 self.assertIsNotNone(indicator)
2796
2797=== modified file 'tests/autopilot/unity8/process_helpers.py'
2798--- tests/autopilot/unity8/process_helpers.py 2014-02-23 01:46:02 +0000
2799+++ tests/autopilot/unity8/process_helpers.py 2014-03-27 20:58:22 +0000
2800@@ -32,63 +32,6 @@
2801 class CannotAccessUnity(Exception):
2802 pass
2803
2804-
2805-def unlock_unity(unity_proxy_obj=None):
2806- """Helper function that attempts to unlock the unity greeter.
2807-
2808- If unity_proxy_object is None create a proxy object by querying for the
2809- running unity process.
2810- Otherwise re-use the passed proxy object.
2811-
2812- :raises RuntimeError: if the greeter attempts and fails to be unlocked.
2813-
2814- :raises RuntimeWarning: when the greeter cannot be found because it is
2815- already unlocked.
2816- :raises CannotAccessUnity: if unity is not introspectable or cannot be
2817- found on dbus.
2818- :raises CannotAccessUnity: if unity's upstart status is not "start" or the
2819- upstart job cannot be found at all.
2820-
2821- """
2822- if unity_proxy_obj is None:
2823- try:
2824- pid = _get_unity_pid()
2825- unity = _get_unity_proxy_object(pid)
2826- main_window = unity.select_single(main_window_emulator.QQuickView)
2827- except ProcessSearchError as e:
2828- raise CannotAccessUnity(
2829- "Cannot introspect unity, make sure that it has been started "
2830- "with testability. Perhaps use the function "
2831- "'restart_unity_with_testability' this module provides."
2832- "(%s)"
2833- % str(e)
2834- )
2835- else:
2836- main_window = unity_proxy_obj.select_single(
2837- main_window_emulator.QQuickView)
2838-
2839- greeter = main_window.get_greeter()
2840- if greeter.created == False:
2841- raise RuntimeWarning("Greeter appears to be already unlocked.")
2842-
2843- # Because of potential input jerkiness under heavy load,
2844- # retry unlocking the greeter two times.
2845- # https://bugs.launchpad.net/ubuntu/+bug/1260113
2846-
2847- retries = 3
2848- while retries > 0:
2849- try:
2850- greeter.swipe()
2851- except AssertionError:
2852- retries -= 1
2853- if retries == 0:
2854- raise
2855- logger.info("Failed to unlock greeter, trying again...")
2856- else:
2857- logger.info("Greeter unlocked, continuing.")
2858- break
2859-
2860-
2861 def restart_unity_with_testability(*args):
2862 """Restarts (or starts) unity with testability enabled.
2863
2864
2865=== modified file 'tests/autopilot/unity8/shell/tests/__init__.py'
2866--- tests/autopilot/unity8/shell/tests/__init__.py 2014-03-05 09:45:28 +0000
2867+++ tests/autopilot/unity8/shell/tests/__init__.py 2014-03-27 20:58:22 +0000
2868@@ -249,9 +249,9 @@
2869 "%s=%s" % (key, value)
2870 ], stderr=subprocess.STDOUT)
2871
2872- def launch_unity(self, **kwargs):
2873+ def _launch(self, executable, ready_func, **kwargs):
2874 """Launch the unity shell, return a proxy object for it."""
2875- binary_path = get_binary_path()
2876+ binary_path = get_binary_path(executable)
2877 lib_path = get_lib_path()
2878
2879 logger.info(
2880@@ -293,11 +293,19 @@
2881
2882 # Ensure that the dash is visible before we return:
2883 logger.debug("Unity started, waiting for it to be ready.")
2884- self.assertUnityReady()
2885+ ready_func()
2886 logger.debug("Unity loaded and ready.")
2887
2888 return app_proxy
2889
2890+ def launch_unity(self, **kwargs):
2891+ """Launch the unity shell, return a proxy object for it."""
2892+ return self._launch("unity8", self.assertUnityReady, **kwargs)
2893+
2894+ def launch_greeter(self, **kwargs):
2895+ """Launch the unity shell, return a proxy object for it."""
2896+ return self._launch("unity8-greeter", self.assertGreeterReady, **kwargs)
2897+
2898 def _launch_unity_with_upstart(self, binary_path, args):
2899 logger.info("Starting unity")
2900 self._patch_environment("QT_LOAD_TESTABILITY", 1)
2901@@ -344,7 +352,7 @@
2902 def _get_lightdm_mock_path(self, mock_type):
2903 lib_path = get_mocks_library_path()
2904 lightdm_mock_path = os.path.abspath(
2905- os.path.join(lib_path, "LightDM", mock_type)
2906+ os.path.join(lib_path, "liblightdm", mock_type)
2907 )
2908
2909 if not os.path.exists(lightdm_mock_path):
2910@@ -386,6 +394,10 @@
2911 )
2912 self.assertThat(home_scope.isCurrent, Eventually(Equals(True)))
2913
2914+ def assertGreeterReady(self):
2915+ greeter = self.main_window.get_greeter()
2916+ self.assertThat(greeter.created, Eventually(Equals(True)))
2917+
2918 def get_dash(self):
2919 dash = self._proxy.wait_select_single(Dash)
2920 return dash
2921
2922=== modified file 'tests/autopilot/unity8/shell/tests/disabled_test_hud.py'
2923--- tests/autopilot/unity8/shell/tests/disabled_test_hud.py 2014-03-17 11:44:05 +0000
2924+++ tests/autopilot/unity8/shell/tests/disabled_test_hud.py 2014-03-27 20:58:22 +0000
2925@@ -19,8 +19,7 @@
2926
2927 from __future__ import absolute_import
2928
2929-from unity8.process_helpers import unlock_unity
2930-from unity8.shell import with_lightdm_mock, DragMixin
2931+from unity8.shell import DragMixin
2932 from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2933
2934 from testtools.matchers import Equals
2935@@ -40,7 +39,6 @@
2936
2937 """
2938 unity_proxy = self.launch_unity()
2939- unlock_unity(unity_proxy)
2940 hud_show_button = self.main_window.get_hud_show_button()
2941 edge_drag_area = self.main_window.get_hud_edge_drag_area()
2942 hud = self.main_window.get_hud()
2943@@ -81,7 +79,6 @@
2944
2945 """
2946 unity_proxy = self.launch_unity()
2947- unlock_unity(unity_proxy)
2948 hud_show_button = self.main_window.get_hud_show_button()
2949 hud = self.main_window.get_hud()
2950
2951@@ -117,7 +114,6 @@
2952 def test_hide_hud_click(self):
2953 """Tapping the close button of the Hud must dismiss it."""
2954 unity_proxy = self.launch_unity()
2955- unlock_unity(unity_proxy)
2956 hud = self.main_window.get_hud()
2957
2958 self._launch_test_app_from_app_screen()
2959@@ -134,7 +130,6 @@
2960
2961 """
2962 unity_proxy = self.launch_unity()
2963- unlock_unity(unity_proxy)
2964 hud = self.main_window.get_hud()
2965
2966 self._launch_test_app_from_app_screen()
2967@@ -151,7 +146,6 @@
2968 def test_launcher_hides_hud(self):
2969 """Opening the Launcher while the Hud is active must close the Hud."""
2970 unity_proxy = self.launch_unity()
2971- unlock_unity(unity_proxy)
2972 hud = self.main_window.get_hud()
2973 launcher = self.main_window.get_launcher()
2974
2975
2976=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
2977--- tests/autopilot/unity8/shell/tests/test_emulators.py 2014-03-17 10:42:57 +0000
2978+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-03-27 20:58:22 +0000
2979@@ -46,7 +46,6 @@
2980 def setUp(self):
2981 super(DashBaseTestCase, self).setUp()
2982 unity_proxy = self.launch_unity()
2983- process_helpers.unlock_unity(unity_proxy)
2984 self.dash = self.main_window.get_dash()
2985
2986
2987
2988=== modified file 'tests/autopilot/unity8/shell/tests/test_lock_screen.py'
2989--- tests/autopilot/unity8/shell/tests/test_lock_screen.py 2014-02-22 00:12:49 +0000
2990+++ tests/autopilot/unity8/shell/tests/test_lock_screen.py 2014-03-27 20:58:22 +0000
2991@@ -20,7 +20,6 @@
2992
2993 from __future__ import absolute_import
2994
2995-from unity8.process_helpers import unlock_unity
2996 from unity8.shell import with_lightdm_mock
2997 from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2998
2999@@ -47,41 +46,41 @@
3000 @with_lightdm_mock("single-pin")
3001 def test_can_unlock_pin_screen(self):
3002 """Must be able to unlock the PIN entry lock screen."""
3003- unity_proxy = self.launch_unity()
3004+ self.launch_greeter()
3005 greeter = self.main_window.get_greeter()
3006
3007 if greeter.narrowMode:
3008- unlock_unity(unity_proxy)
3009+ greeter.swipe()
3010 lockscreen = self._wait_for_lockscreen()
3011 self._enter_pincode("1234")
3012 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
3013 else:
3014 self._enter_prompt_passphrase("1234")
3015- self.assertThat(greeter.shown, Eventually(Equals(False)))
3016+ self.assertThat(greeter.enabled, Eventually(Equals(False)))
3017
3018 @with_lightdm_mock("single-passphrase")
3019 def test_can_unlock_passphrase_screen(self):
3020 """Must be able to unlock the passphrase entry screen."""
3021- unity_proxy = self.launch_unity()
3022+ self.launch_greeter()
3023 greeter = self.main_window.get_greeter()
3024
3025 if greeter.narrowMode:
3026- unlock_unity(unity_proxy)
3027+ greeter.swipe()
3028 lockscreen = self._wait_for_lockscreen()
3029 self._enter_pin_passphrase("password")
3030 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
3031 else:
3032 self._enter_prompt_passphrase("password")
3033- self.assertThat(greeter.shown, Eventually(Equals(False)))
3034+ self.assertThat(greeter.enabled, Eventually(Equals(False)))
3035
3036 @with_lightdm_mock("single-pin")
3037 def test_pin_screen_wrong_code(self):
3038 """Entering the wrong pin code must not dismiss the lock screen."""
3039- unity_proxy = self.launch_unity()
3040+ self.launch_greeter()
3041 greeter = self.main_window.get_greeter()
3042
3043 if greeter.narrowMode:
3044- unlock_unity(unity_proxy)
3045+ greeter.swipe()
3046 lockscreen = self._wait_for_lockscreen()
3047 self._enter_pincode("4321")
3048 pinentryField = self.main_window.get_pinentryField()
3049@@ -91,16 +90,16 @@
3050 self._enter_prompt_passphrase("4231")
3051 prompt = self.main_window.get_greeter().get_prompt()
3052 self.assertThat(prompt.text, Eventually(Equals("")))
3053- self.assertThat(greeter.shown, Eventually(Equals(True)))
3054+ self.assertThat(greeter.enabled, Eventually(Equals(True)))
3055
3056 @with_lightdm_mock("single-passphrase")
3057 def test_passphrase_screen_wrong_password(self):
3058 """Entering the wrong password must not dismiss the lock screen."""
3059- unity_proxy = self.launch_unity()
3060+ self.launch_greeter()
3061 greeter = self.main_window.get_greeter()
3062
3063 if greeter.narrowMode:
3064- unlock_unity(unity_proxy)
3065+ greeter.swipe()
3066 lockscreen = self._wait_for_lockscreen()
3067 self._enter_pin_passphrase("foobar")
3068 pinentryField = self.main_window.get_pinentryField()
3069@@ -110,7 +109,7 @@
3070 self._enter_prompt_passphrase("foobar")
3071 prompt = self.main_window.get_greeter().get_prompt()
3072 self.assertThat(prompt.text, Eventually(Equals("")))
3073- self.assertThat(greeter.shown, Eventually(Equals(True)))
3074+ self.assertThat(greeter.enabled, Eventually(Equals(True)))
3075
3076 def _wait_for_lockscreen(self):
3077 """Wait for the lock screen to load, and return it."""
3078
3079=== modified file 'tests/autopilot/unity8/shell/tests/test_notifications.py'
3080--- tests/autopilot/unity8/shell/tests/test_notifications.py 2014-03-12 11:24:54 +0000
3081+++ tests/autopilot/unity8/shell/tests/test_notifications.py 2014-03-27 20:58:22 +0000
3082@@ -21,7 +21,6 @@
3083
3084 from __future__ import absolute_import
3085
3086-from unity8.process_helpers import unlock_unity
3087 from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
3088
3089 from testtools.matchers import Equals, NotEquals
3090@@ -123,7 +122,6 @@
3091 def test_interactive(self):
3092 """Interactive notification must react upon click on itself."""
3093 unity_proxy = self.launch_unity()
3094- unlock_unity(unity_proxy)
3095
3096 notify_list = self._get_notifications_list()
3097
3098@@ -162,7 +160,6 @@
3099 """Rejecting a call should make notification expand and
3100 offer more options."""
3101 unity_proxy = self.launch_unity()
3102- unlock_unity(unity_proxy)
3103
3104 summary = "Incoming call"
3105 body = "Frank Zappa\n+44 (0)7736 027340"
3106@@ -339,7 +336,6 @@
3107 def test_icon_summary_body(self):
3108 """Notification must display the expected summary and body text."""
3109 unity_proxy = self.launch_unity()
3110- unlock_unity(unity_proxy)
3111
3112 notify_list = self._get_notifications_list()
3113
3114@@ -379,7 +375,6 @@
3115 """Notification must display the expected summary and secondary
3116 icon."""
3117 unity_proxy = self.launch_unity()
3118- unlock_unity(unity_proxy)
3119
3120 notify_list = self._get_notifications_list()
3121
3122@@ -417,7 +412,6 @@
3123 """Notifications must be displayed in order according to their
3124 urgency."""
3125 unity_proxy = self.launch_unity()
3126- unlock_unity(unity_proxy)
3127
3128 notify_list = self._get_notifications_list()
3129
3130@@ -504,7 +498,6 @@
3131 def test_summary_and_body(self):
3132 """Notification must display the expected summary- and body-text."""
3133 unity_proxy = self.launch_unity()
3134- unlock_unity(unity_proxy)
3135
3136 notify_list = self._get_notifications_list()
3137
3138@@ -529,7 +522,6 @@
3139 def test_summary_only(self):
3140 """Notification must display only the expected summary-text."""
3141 unity_proxy = self.launch_unity()
3142- unlock_unity(unity_proxy)
3143
3144 notify_list = self._get_notifications_list()
3145
3146@@ -547,7 +539,6 @@
3147 """Notification must allow updating its contents while being
3148 displayed."""
3149 unity_proxy = self.launch_unity()
3150- unlock_unity(unity_proxy)
3151
3152 notify_list = self._get_notifications_list()
3153
3154@@ -585,7 +576,6 @@
3155 """Notification must allow updating its contents and layout while
3156 being displayed."""
3157 unity_proxy = self.launch_unity()
3158- unlock_unity(unity_proxy)
3159
3160 notify_list = self._get_notifications_list()
3161
3162@@ -631,7 +621,6 @@
3163 def test_append_hint(self):
3164 """Notification has to accumulate body-text using append-hint."""
3165 unity_proxy = self.launch_unity()
3166- unlock_unity(unity_proxy)
3167
3168 notify_list = self._get_notifications_list()
3169
3170
3171=== modified file 'tests/mocks/AccountsService/AccountsService.cpp'
3172--- tests/mocks/AccountsService/AccountsService.cpp 2014-02-20 20:14:40 +0000
3173+++ tests/mocks/AccountsService/AccountsService.cpp 2014-03-27 20:58:22 +0000
3174@@ -45,6 +45,15 @@
3175 Q_UNUSED(demoEdges)
3176 }
3177
3178+bool AccountsService::demoEdgesForCurrentUser() const
3179+{
3180+ return false;
3181+}
3182+
3183+void AccountsService::setDemoEdgesForCurrentUser(bool)
3184+{
3185+}
3186+
3187 QString AccountsService::backgroundFile() const
3188 {
3189 return m_backgroundFile;
3190
3191=== modified file 'tests/mocks/AccountsService/AccountsService.h'
3192--- tests/mocks/AccountsService/AccountsService.h 2013-09-24 18:50:56 +0000
3193+++ tests/mocks/AccountsService/AccountsService.h 2014-03-27 20:58:22 +0000
3194@@ -35,6 +35,10 @@
3195 READ demoEdges
3196 WRITE setDemoEdges
3197 NOTIFY demoEdgesChanged)
3198+ Q_PROPERTY (bool demoEdgesForCurrentUser
3199+ READ demoEdgesForCurrentUser
3200+ WRITE setDemoEdgesForCurrentUser
3201+ NOTIFY demoEdgesForCurrentUserChanged)
3202 Q_PROPERTY (QString backgroundFile
3203 READ backgroundFile
3204 WRITE setBackgroundFile // only available in mock
3205@@ -51,6 +55,8 @@
3206 void setUser(const QString &user);
3207 bool demoEdges() const;
3208 void setDemoEdges(bool demoEdges);
3209+ bool demoEdgesForCurrentUser() const;
3210+ void setDemoEdgesForCurrentUser(bool demoEdgesForCurrentUser);
3211 QString backgroundFile() const;
3212 void setBackgroundFile(const QString &backgroundFile);
3213 bool statsWelcomeScreen() const;
3214@@ -59,6 +65,7 @@
3215 Q_SIGNALS:
3216 void userChanged();
3217 void demoEdgesChanged();
3218+ void demoEdgesForCurrentUserChanged();
3219 void backgroundFileChanged();
3220 void statsWelcomeScreenChanged();
3221
3222
3223=== modified file 'tests/mocks/CMakeLists.txt'
3224--- tests/mocks/CMakeLists.txt 2013-11-14 11:48:33 +0000
3225+++ tests/mocks/CMakeLists.txt 2014-03-27 20:58:22 +0000
3226@@ -1,10 +1,11 @@
3227 add_subdirectory(AccountsService)
3228 add_subdirectory(GSettings.1.0)
3229 add_subdirectory(HudClient)
3230+add_subdirectory(liblightdm)
3231 add_subdirectory(libusermetrics)
3232-add_subdirectory(LightDM)
3233 add_subdirectory(Powerd)
3234 add_subdirectory(QMenuModel)
3235+add_subdirectory(SessionManager)
3236 add_subdirectory(Ubuntu)
3237 add_subdirectory(Unity)
3238 add_subdirectory(QtMultimedia)
3239
3240=== removed directory 'tests/mocks/LightDM/demo'
3241=== removed file 'tests/mocks/LightDM/demo/CMakeLists.txt'
3242--- tests/mocks/LightDM/demo/CMakeLists.txt 2013-12-13 01:02:53 +0000
3243+++ tests/mocks/LightDM/demo/CMakeLists.txt 1970-01-01 00:00:00 +0000
3244@@ -1,21 +0,0 @@
3245-pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
3246-
3247-set(LibLightDM_SOURCES
3248- ../Greeter.cpp
3249- ../UsersModel.cpp
3250- GreeterPrivate.cpp
3251- UsersModelPrivate.cpp
3252- ${CMAKE_SOURCE_DIR}/plugins/Utils/qvariantlistmodel.cpp
3253- )
3254-
3255-add_library(MockLightDM-demo STATIC ${LibLightDM_SOURCES})
3256-
3257-include_directories(
3258- ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
3259-)
3260-
3261-target_link_libraries(MockLightDM-demo
3262- ${LIBUSERMETRICSOUTPUT_LDFLAGS}
3263- )
3264-
3265-qt5_use_modules(MockLightDM-demo Gui)
3266
3267=== removed file 'tests/mocks/LightDM/demo/GreeterPrivate.cpp'
3268--- tests/mocks/LightDM/demo/GreeterPrivate.cpp 2014-01-29 19:04:20 +0000
3269+++ tests/mocks/LightDM/demo/GreeterPrivate.cpp 1970-01-01 00:00:00 +0000
3270@@ -1,70 +0,0 @@
3271-/*
3272- * Copyright (C) 2013 Canonical, Ltd.
3273- *
3274- * This program is free software; you can redistribute it and/or modify
3275- * it under the terms of the GNU General Public License as published by
3276- * the Free Software Foundation; version 3.
3277- *
3278- * This program is distributed in the hope that it will be useful,
3279- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3280- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3281- * GNU General Public License for more details.
3282- *
3283- * You should have received a copy of the GNU General Public License
3284- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3285- *
3286- * Author: Michael Terry <michael.terry@canonical.com>
3287- */
3288-
3289-#include "../Greeter.h"
3290-#include "../GreeterPrivate.h"
3291-#include <QtCore/QDir>
3292-#include <QtCore/QSettings>
3293-
3294-namespace QLightDM
3295-{
3296-
3297-GreeterPrivate::GreeterPrivate(Greeter* parent)
3298- : authenticated(false),
3299- authenticationUser(),
3300- q_ptr(parent)
3301-{
3302-}
3303-
3304-void GreeterPrivate::handleAuthenticate()
3305-{
3306- Q_Q(Greeter);
3307-
3308- QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
3309- settings.beginGroup(authenticationUser);
3310- QVariant password = settings.value("password", "none");
3311-
3312- if (password == "pin") {
3313- Q_EMIT q->showPrompt("PIN", Greeter::PromptTypeSecret);
3314- } else if (password == "keyboard") {
3315- Q_EMIT q->showPrompt("Password", Greeter::PromptTypeSecret);
3316- } else {
3317- authenticated = true;
3318- Q_EMIT q->authenticationComplete();
3319- }
3320-}
3321-
3322-void GreeterPrivate::handleRespond(const QString &response)
3323-{
3324- Q_Q(Greeter);
3325-
3326- QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
3327- settings.beginGroup(authenticationUser);
3328- QVariant password = settings.value("password", "none");
3329-
3330- QString passwordValue;
3331- if (password == "pin") {
3332- passwordValue = settings.value("passwordValue", "1234").toString();
3333- } else {
3334- passwordValue = settings.value("passwordValue", "password").toString();
3335- }
3336- authenticated = (response == passwordValue);
3337- Q_EMIT q->authenticationComplete();
3338-}
3339-
3340-}
3341
3342=== removed file 'tests/mocks/LightDM/demo/UsersModelPrivate.cpp'
3343--- tests/mocks/LightDM/demo/UsersModelPrivate.cpp 2014-02-04 14:38:00 +0000
3344+++ tests/mocks/LightDM/demo/UsersModelPrivate.cpp 1970-01-01 00:00:00 +0000
3345@@ -1,41 +0,0 @@
3346-/*
3347- * Copyright (C) 2013 Canonical, Ltd.
3348- *
3349- * This program is free software; you can redistribute it and/or modify
3350- * it under the terms of the GNU General Public License as published by
3351- * the Free Software Foundation; version 3.
3352- *
3353- * This program is distributed in the hope that it will be useful,
3354- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3355- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3356- * GNU General Public License for more details.
3357- *
3358- * You should have received a copy of the GNU General Public License
3359- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3360- *
3361- * Author: Michael Terry <michael.terry@canonical.com>
3362- */
3363-
3364-#include "../UsersModelPrivate.h"
3365-
3366-#include <QDir>
3367-#include <QSettings>
3368-#include <QStringList>
3369-
3370-namespace QLightDM
3371-{
3372-
3373-UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
3374- : q_ptr(parent)
3375-{
3376- QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
3377- QStringList users = settings.value("users", QStringList() << "phablet").toStringList();
3378-
3379- Q_FOREACH(const QString &user, users)
3380- {
3381- QString name = settings.value(user + "/name", user[0].toUpper() + user.mid(1)).toString();
3382- entries.append({user, name, 0, 0, false, false, 0, 0});
3383- }
3384-}
3385-
3386-}
3387
3388=== removed file 'tests/mocks/LightDM/qmldir'
3389--- tests/mocks/LightDM/qmldir 2013-06-05 22:03:08 +0000
3390+++ tests/mocks/LightDM/qmldir 1970-01-01 00:00:00 +0000
3391@@ -1,2 +0,0 @@
3392-module LightDM
3393-plugin MockLightDM-qml
3394
3395=== added directory 'tests/mocks/SessionManager'
3396=== added file 'tests/mocks/SessionManager/CMakeLists.txt'
3397--- tests/mocks/SessionManager/CMakeLists.txt 1970-01-01 00:00:00 +0000
3398+++ tests/mocks/SessionManager/CMakeLists.txt 2014-03-27 20:58:22 +0000
3399@@ -0,0 +1,19 @@
3400+add_library(MockSessionManager-qml MODULE
3401+ plugin.cpp
3402+ SessionManager.cpp
3403+ )
3404+
3405+qt5_use_modules(MockSessionManager-qml Qml)
3406+
3407+# copy qmldir file into build directory for shadow builds
3408+file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
3409+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
3410+ )
3411+
3412+install(TARGETS MockSessionManager-qml
3413+ DESTINATION ${SHELL_INSTALL_QML}/mocks/SessionManager
3414+ )
3415+
3416+install(FILES qmldir
3417+ DESTINATION ${SHELL_INSTALL_QML}/mocks/SessionManager
3418+ )
3419
3420=== added file 'tests/mocks/SessionManager/SessionManager.cpp'
3421--- tests/mocks/SessionManager/SessionManager.cpp 1970-01-01 00:00:00 +0000
3422+++ tests/mocks/SessionManager/SessionManager.cpp 2014-03-27 20:58:22 +0000
3423@@ -0,0 +1,43 @@
3424+/*
3425+ * Copyright (C) 2013 Canonical, Ltd.
3426+ *
3427+ * This program is free software; you can redistribute it and/or modify
3428+ * it under the terms of the GNU General Public License as published by
3429+ * the Free Software Foundation; version 3.
3430+ *
3431+ * This program is distributed in the hope that it will be useful,
3432+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3433+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3434+ * GNU General Public License for more details.
3435+ *
3436+ * You should have received a copy of the GNU General Public License
3437+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3438+ *
3439+ * Author: Michael Terry <michael.terry@canonical.com>
3440+ */
3441+
3442+#include "SessionManager.h"
3443+
3444+SessionManager::SessionManager(QObject* parent)
3445+ : QObject(parent),
3446+ m_active(true)
3447+{
3448+}
3449+
3450+bool SessionManager::active() const
3451+{
3452+ return m_active;
3453+}
3454+
3455+void SessionManager::setActive(bool active)
3456+{
3457+ if (m_active != active) {
3458+ m_active = active;
3459+ activeChanged();
3460+ }
3461+}
3462+
3463+void SessionManager::lock()
3464+{
3465+ setActive(false);
3466+}
3467
3468=== added file 'tests/mocks/SessionManager/SessionManager.h'
3469--- tests/mocks/SessionManager/SessionManager.h 1970-01-01 00:00:00 +0000
3470+++ tests/mocks/SessionManager/SessionManager.h 2014-03-27 20:58:22 +0000
3471@@ -0,0 +1,49 @@
3472+/*
3473+ * Copyright (C) 2013 Canonical, Ltd.
3474+ *
3475+ * This program is free software; you can redistribute it and/or modify
3476+ * it under the terms of the GNU General Public License as published by
3477+ * the Free Software Foundation; version 3.
3478+ *
3479+ * This program is distributed in the hope that it will be useful,
3480+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3481+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3482+ * GNU General Public License for more details.
3483+ *
3484+ * You should have received a copy of the GNU General Public License
3485+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3486+ *
3487+ * Authors: Michael Terry <michael.terry@canonical.com>
3488+ */
3489+
3490+#ifndef UNITY_MOCK_SESSIONMANAGER_H
3491+#define UNITY_MOCK_SESSIONMANAGER_H
3492+
3493+#include <QObject>
3494+
3495+class SessionManager: public QObject
3496+{
3497+ Q_OBJECT
3498+ Q_PROPERTY(bool active
3499+ READ active
3500+ WRITE setActive // Only in mock
3501+ NOTIFY activeChanged
3502+ FINAL)
3503+
3504+public:
3505+ explicit SessionManager(QObject *parent = 0);
3506+
3507+ bool active() const;
3508+ void setActive(bool active);
3509+
3510+public Q_SLOTS:
3511+ void lock();
3512+
3513+Q_SIGNALS:
3514+ void activeChanged();
3515+
3516+private:
3517+ bool m_active;
3518+};
3519+
3520+#endif
3521
3522=== added file 'tests/mocks/SessionManager/plugin.cpp'
3523--- tests/mocks/SessionManager/plugin.cpp 1970-01-01 00:00:00 +0000
3524+++ tests/mocks/SessionManager/plugin.cpp 2014-03-27 20:58:22 +0000
3525@@ -0,0 +1,34 @@
3526+/*
3527+ * Copyright (C) 2013 Canonical, Ltd.
3528+ *
3529+ * This program is free software; you can redistribute it and/or modify
3530+ * it under the terms of the GNU General Public License as published by
3531+ * the Free Software Foundation; version 3.
3532+ *
3533+ * This program is distributed in the hope that it will be useful,
3534+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3535+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3536+ * GNU General Public License for more details.
3537+ *
3538+ * You should have received a copy of the GNU General Public License
3539+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3540+ *
3541+ * Authors: Michael Terry <michael.terry@canonical.com>
3542+ */
3543+
3544+#include "plugin.h"
3545+#include "SessionManager.h"
3546+#include <QtQml/qqml.h>
3547+
3548+static QObject *sessionmanager_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
3549+{
3550+ Q_UNUSED(engine)
3551+ Q_UNUSED(scriptEngine)
3552+ return new SessionManager();
3553+}
3554+
3555+void SessionManagerPlugin::registerTypes(const char *uri)
3556+{
3557+ Q_ASSERT(uri == QLatin1String("SessionManager"));
3558+ qmlRegisterSingletonType<SessionManager>(uri, 0, 1, "SessionManager", sessionmanager_provider);
3559+}
3560
3561=== added file 'tests/mocks/SessionManager/plugin.h'
3562--- tests/mocks/SessionManager/plugin.h 1970-01-01 00:00:00 +0000
3563+++ tests/mocks/SessionManager/plugin.h 2014-03-27 20:58:22 +0000
3564@@ -0,0 +1,34 @@
3565+/*
3566+ * Copyright (C) 2013 Canonical, Ltd.
3567+ *
3568+ * This program is free software; you can redistribute it and/or modify
3569+ * it under the terms of the GNU General Public License as published by
3570+ * the Free Software Foundation; version 3.
3571+ *
3572+ * This program is distributed in the hope that it will be useful,
3573+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3574+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3575+ * GNU General Public License for more details.
3576+ *
3577+ * You should have received a copy of the GNU General Public License
3578+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3579+ *
3580+ * Authors: Michael Terry <michael.terry@canonical.com>
3581+ */
3582+
3583+#ifndef MOCK_SESSIONMANAGER_PLUGIN_H
3584+#define MOCK_SESSIONMANAGER_PLUGIN_H
3585+
3586+#include <QQmlEngine>
3587+#include <QQmlExtensionPlugin>
3588+
3589+class SessionManagerPlugin : public QQmlExtensionPlugin
3590+{
3591+ Q_OBJECT
3592+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
3593+
3594+public:
3595+ void registerTypes(const char *uri);
3596+};
3597+
3598+#endif
3599
3600=== added file 'tests/mocks/SessionManager/qmldir'
3601--- tests/mocks/SessionManager/qmldir 1970-01-01 00:00:00 +0000
3602+++ tests/mocks/SessionManager/qmldir 2014-03-27 20:58:22 +0000
3603@@ -0,0 +1,2 @@
3604+module SessionManager
3605+plugin MockSessionManager-qml
3606
3607=== renamed directory 'tests/mocks/LightDM' => 'tests/mocks/liblightdm'
3608=== modified file 'tests/mocks/liblightdm/CMakeLists.txt'
3609--- tests/mocks/LightDM/CMakeLists.txt 2014-01-14 21:01:28 +0000
3610+++ tests/mocks/liblightdm/CMakeLists.txt 2014-03-27 20:58:22 +0000
3611@@ -1,57 +1,4 @@
3612-# This is a copy of the normal LightDM plugin, but instead of statically
3613-# linking in the lightdm bits, this one uses shared libraries so we can swap
3614-# out different sets of users for different tests. When we finally switch to
3615-# actually using the system liblightdm in the normal plugin, this version can
3616-# be deleted.
3617-
3618-add_subdirectory(demo)
3619 add_subdirectory(full)
3620 add_subdirectory(single)
3621 add_subdirectory(single-pin)
3622 add_subdirectory(single-passphrase)
3623-
3624-include_directories(
3625- ${CMAKE_CURRENT_SOURCE_DIR}
3626- ${CMAKE_CURRENT_BINARY_DIR}
3627- ${CMAKE_SOURCE_DIR}/plugins/Utils
3628- ${CMAKE_SOURCE_DIR}/tests/mocks/libusermetrics
3629-)
3630-
3631-set(QMLPLUGIN_SRC
3632- ${CMAKE_SOURCE_DIR}/plugins/LightDM/DBusGreeterList.cpp
3633- ${CMAKE_SOURCE_DIR}/plugins/LightDM/Greeter.cpp
3634- ${CMAKE_SOURCE_DIR}/plugins/LightDM/plugin.cpp
3635- ${CMAKE_SOURCE_DIR}/plugins/LightDM/UsersModel.cpp
3636- ${CMAKE_SOURCE_DIR}/plugins/Utils/qsortfilterproxymodelqml.cpp
3637- )
3638-
3639-add_library(MockLightDM-qml MODULE
3640- ${QMLPLUGIN_SRC}
3641- )
3642-
3643-# We want to link to liblightdm-qt5-2, but we don't want to depend on it being
3644-# installed on the system. So we make sure we link to our full fake version
3645-# At run time, we can point to whichever version we happen to be using via
3646-# LD_LIBRARY_PATH.
3647-add_dependencies(MockLightDM-qml MockLightDM-full MockUserMetrics)
3648-target_link_libraries(MockLightDM-qml
3649- -L${CMAKE_CURRENT_BINARY_DIR}/full
3650- -llightdm-qt5-2
3651- -L${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics
3652- -lusermetricsoutput
3653- )
3654-
3655-qt5_use_modules(MockLightDM-qml DBus Gui Qml)
3656-
3657-# copy qmldir file into build directory for shadow builds
3658-file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
3659- DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
3660- )
3661-
3662-install(TARGETS MockLightDM-qml
3663- DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM
3664- )
3665-
3666-install(FILES qmldir
3667- DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM
3668- )
3669
3670=== modified file 'tests/mocks/liblightdm/full/CMakeLists.txt'
3671--- tests/mocks/LightDM/full/CMakeLists.txt 2013-11-25 17:26:15 +0000
3672+++ tests/mocks/liblightdm/full/CMakeLists.txt 2014-03-27 20:58:22 +0000
3673@@ -11,8 +11,9 @@
3674 qt5_use_modules(MockLightDM-full Gui)
3675
3676 set_target_properties(MockLightDM-full PROPERTIES
3677- OUTPUT_NAME lightdm-qt5-2)
3678+ OUTPUT_NAME lightdm-qt5-3
3679+ SOVERSION 0)
3680
3681 install(TARGETS MockLightDM-full
3682- DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/full
3683+ DESTINATION ${SHELL_INSTALL_QML}/mocks/liblightdm/full
3684 )
3685
3686=== modified file 'tests/mocks/liblightdm/single-passphrase/CMakeLists.txt'
3687--- tests/mocks/LightDM/single-passphrase/CMakeLists.txt 2013-11-25 17:26:15 +0000
3688+++ tests/mocks/liblightdm/single-passphrase/CMakeLists.txt 2014-03-27 20:58:22 +0000
3689@@ -12,8 +12,9 @@
3690 qt5_use_modules(MockLightDM-single-passphrase Gui)
3691
3692 set_target_properties(MockLightDM-single-passphrase PROPERTIES
3693- OUTPUT_NAME lightdm-qt5-2)
3694+ OUTPUT_NAME lightdm-qt5-3
3695+ SOVERSION 0)
3696
3697 install(TARGETS MockLightDM-single-passphrase
3698- DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/single-passphrase
3699+ DESTINATION ${SHELL_INSTALL_QML}/mocks/liblightdm/single-passphrase
3700 )
3701
3702=== modified file 'tests/mocks/liblightdm/single-pin/CMakeLists.txt'
3703--- tests/mocks/LightDM/single-pin/CMakeLists.txt 2013-11-25 17:26:15 +0000
3704+++ tests/mocks/liblightdm/single-pin/CMakeLists.txt 2014-03-27 20:58:22 +0000
3705@@ -12,8 +12,9 @@
3706 qt5_use_modules(MockLightDM-single-pin Gui)
3707
3708 set_target_properties(MockLightDM-single-pin PROPERTIES
3709- OUTPUT_NAME lightdm-qt5-2)
3710+ OUTPUT_NAME lightdm-qt5-3
3711+ SOVERSION 0)
3712
3713 install(TARGETS MockLightDM-single-pin
3714- DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/single-pin
3715+ DESTINATION ${SHELL_INSTALL_QML}/mocks/liblightdm/single-pin
3716 )
3717
3718=== modified file 'tests/mocks/liblightdm/single/CMakeLists.txt'
3719--- tests/mocks/LightDM/single/CMakeLists.txt 2013-11-25 17:26:15 +0000
3720+++ tests/mocks/liblightdm/single/CMakeLists.txt 2014-03-27 20:58:22 +0000
3721@@ -11,8 +11,9 @@
3722 qt5_use_modules(MockLightDM-single Gui)
3723
3724 set_target_properties(MockLightDM-single PROPERTIES
3725- OUTPUT_NAME lightdm-qt5-2)
3726+ OUTPUT_NAME lightdm-qt5-3
3727+ SOVERSION 0)
3728
3729 install(TARGETS MockLightDM-single
3730- DESTINATION ${SHELL_INSTALL_QML}/mocks/LightDM/single
3731+ DESTINATION ${SHELL_INSTALL_QML}/mocks/liblightdm/single
3732 )
3733
3734=== modified file 'tests/plugins/CMakeLists.txt'
3735--- tests/plugins/CMakeLists.txt 2013-12-12 16:45:35 +0000
3736+++ tests/plugins/CMakeLists.txt 2014-03-27 20:58:22 +0000
3737@@ -1,6 +1,7 @@
3738 add_subdirectory(AccountsService)
3739+add_subdirectory(DashViews)
3740 add_subdirectory(LightDM)
3741-add_subdirectory(DashViews)
3742+add_subdirectory(SessionManager)
3743 add_subdirectory(Ubuntu)
3744 add_subdirectory(Unity)
3745 add_subdirectory(Utils)
3746
3747=== modified file 'tests/plugins/LightDM/CMakeLists.txt'
3748--- tests/plugins/LightDM/CMakeLists.txt 2014-01-14 21:01:28 +0000
3749+++ tests/plugins/LightDM/CMakeLists.txt 2014-03-27 20:58:22 +0000
3750@@ -1,3 +1,6 @@
3751+include(FindPkgConfig)
3752+pkg_check_modules(LIBLIGHTDM REQUIRED liblightdm-qt5-3)
3753+
3754 add_executable(test-lightdm-dbus
3755 dbus.cpp
3756 ${CMAKE_SOURCE_DIR}/plugins/LightDM/Greeter.cpp
3757@@ -7,19 +10,17 @@
3758 include_directories(
3759 ${CMAKE_CURRENT_BINARY_DIR}
3760 ${CMAKE_SOURCE_DIR}/plugins/LightDM
3761- ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
3762 ${LIBLIGHTDM_INCLUDE_DIRS}
3763 )
3764
3765 add_dependencies(test-lightdm-dbus MockLightDM-full)
3766 target_link_libraries(test-lightdm-dbus
3767- -L${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full
3768- -llightdm-qt5-2
3769+ ${LIBLIGHTDM_LDFLAGS}
3770 )
3771
3772 add_definitions(-DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
3773
3774-add_custom_target(testLightDMDBus dbus-launch env QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full ${CMAKE_CURRENT_BINARY_DIR}/test-lightdm-dbus)
3775+add_custom_target(testLightDMDBus dbus-launch env QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/plugins LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/full ${CMAKE_CURRENT_BINARY_DIR}/test-lightdm-dbus)
3776 add_dependencies(testLightDMDBus test-lightdm-dbus)
3777
3778 add_dependencies(qmluitests testLightDMDBus)
3779
3780=== added directory 'tests/plugins/SessionManager'
3781=== added file 'tests/plugins/SessionManager/CMakeLists.txt'
3782--- tests/plugins/SessionManager/CMakeLists.txt 1970-01-01 00:00:00 +0000
3783+++ tests/plugins/SessionManager/CMakeLists.txt 2014-03-27 20:58:22 +0000
3784@@ -0,0 +1,48 @@
3785+macro(make_dbus_class PREFIX SERVICE INTERFACE)
3786+ if (${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${INTERFACE}Adaptor.h)
3787+ execute_process(COMMAND qdbusxml2cpp -c ${PREFIX}${INTERFACE}Adaptor -a ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${INTERFACE}Adaptor ${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml ${SERVICE}.${INTERFACE})
3788+ endif ()
3789+endmacro(make_dbus_class)
3790+
3791+make_dbus_class(LightDM org.freedesktop.DisplayManager Session)
3792+make_dbus_class(Login org.freedesktop.login1 Manager)
3793+make_dbus_class(Login org.freedesktop.login1 Session)
3794+make_dbus_class(Login org.freedesktop.DBus Properties)
3795+
3796+include_directories(
3797+ ${CMAKE_CURRENT_BINARY_DIR}
3798+ ${CMAKE_SOURCE_DIR}/plugins/SessionManager
3799+ )
3800+
3801+add_definitions(-DSM_BUSNAME=sessionBus)
3802+
3803+add_executable(sessionmanagermock
3804+ ${CMAKE_CURRENT_BINARY_DIR}/LightDMSessionAdaptor.cpp
3805+ ${CMAKE_CURRENT_BINARY_DIR}/LoginManagerAdaptor.cpp
3806+ ${CMAKE_CURRENT_BINARY_DIR}/LoginPropertiesAdaptor.cpp
3807+ ${CMAKE_CURRENT_BINARY_DIR}/LoginSessionAdaptor.cpp
3808+ server.cpp
3809+ LightDMSessionServer.cpp
3810+ LoginManagerServer.cpp
3811+ LoginSessionServer.cpp
3812+ )
3813+qt5_use_modules(sessionmanagermock Core DBus)
3814+
3815+add_executable(sessionmanagertest
3816+ ${CMAKE_SOURCE_DIR}/plugins/SessionManager/SessionManager.cpp
3817+ client.cpp
3818+ )
3819+qt5_use_modules(sessionmanagertest Core DBus Test)
3820+
3821+add_test(NAME sessionmanagertest
3822+ COMMAND env
3823+ XDG_SESSION_ID=sessionid
3824+ XDG_SESSION_PATH=/mocksession/lightdm
3825+ dbus-test-runner
3826+ --task ${CMAKE_CURRENT_BINARY_DIR}/sessionmanagermock
3827+ --task-name server
3828+ --ignore-return
3829+ --task ${CMAKE_CURRENT_BINARY_DIR}/sessionmanagertest
3830+ --task-name client
3831+ --wait-for org.freedesktop.login1
3832+ )
3833
3834=== added file 'tests/plugins/SessionManager/LightDMSessionServer.cpp'
3835--- tests/plugins/SessionManager/LightDMSessionServer.cpp 1970-01-01 00:00:00 +0000
3836+++ tests/plugins/SessionManager/LightDMSessionServer.cpp 2014-03-27 20:58:22 +0000
3837@@ -0,0 +1,38 @@
3838+/*
3839+ * Copyright 2013 Canonical Ltd.
3840+ *
3841+ * This program is free software: you can redistribute it and/or modify it
3842+ * under the terms of the GNU General Public License version 3, as published
3843+ * by the Free Software Foundation.
3844+ *
3845+ * This program is distributed in the hope that it will be useful, but
3846+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3847+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
3848+ * PURPOSE. See the GNU General Public License for more details.
3849+ *
3850+ * You should have received a copy of the GNU General Public License
3851+ * version 3 along with this program. If not, see
3852+ * <http://www.gnu.org/licenses/>
3853+ *
3854+ * Authored by: Michael Terry <michael.terry@canonical.com>
3855+ */
3856+
3857+#include "LightDMSessionServer.h"
3858+
3859+LightDMSessionServer::LightDMSessionServer(LoginSessionServer *logind, QObject *parent)
3860+ : QObject(parent),
3861+ logind(logind)
3862+{
3863+}
3864+
3865+void LightDMSessionServer::Lock()
3866+{
3867+ // As a side effect of locking, change Active state of logind.
3868+ // Note that this will say Active is true while the Active property will be
3869+ // false. This is intentional, as we don't want to keep any state in the
3870+ // mocks. Having this signal side effect lets us test that lock() was
3871+ // actually called by the plugin as well as test the changed signal itself.
3872+ QVariantMap changes;
3873+ changes.insert("Active", QVariant(true));
3874+ Q_EMIT logind->PropertiesChanged("org.freedesktop.login1.Session", changes, QStringList());
3875+}
3876
3877=== added file 'tests/plugins/SessionManager/LightDMSessionServer.h'
3878--- tests/plugins/SessionManager/LightDMSessionServer.h 1970-01-01 00:00:00 +0000
3879+++ tests/plugins/SessionManager/LightDMSessionServer.h 2014-03-27 20:58:22 +0000
3880@@ -0,0 +1,40 @@
3881+/*
3882+ * Copyright 2013 Canonical Ltd.
3883+ *
3884+ * This program is free software: you can redistribute it and/or modify it
3885+ * under the terms of the GNU General Public License version 3, as published
3886+ * by the Free Software Foundation.
3887+ *
3888+ * This program is distributed in the hope that it will be useful, but
3889+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3890+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
3891+ * PURPOSE. See the GNU General Public License for more details.
3892+ *
3893+ * You should have received a copy of the GNU General Public License
3894+ * version 3 along with this program. If not, see
3895+ * <http://www.gnu.org/licenses/>
3896+ *
3897+ * Authored by: Michael Terry <michael.terry@canonical.com>
3898+ */
3899+
3900+#ifndef UNITY_LIGHTDMSESSIONSERVER_H
3901+#define UNITY_LIGHTDMSESSIONSERVER_H
3902+
3903+#include "LoginSessionServer.h"
3904+#include <QtCore/QObject>
3905+
3906+class LightDMSessionServer: public QObject
3907+{
3908+ Q_OBJECT
3909+
3910+public:
3911+ explicit LightDMSessionServer(LoginSessionServer *logind, QObject *parent = 0);
3912+
3913+public Q_SLOTS:
3914+ void Lock();
3915+
3916+private:
3917+ LoginSessionServer *logind;
3918+};
3919+
3920+#endif
3921
3922=== added file 'tests/plugins/SessionManager/LoginManagerServer.cpp'
3923--- tests/plugins/SessionManager/LoginManagerServer.cpp 1970-01-01 00:00:00 +0000
3924+++ tests/plugins/SessionManager/LoginManagerServer.cpp 2014-03-27 20:58:22 +0000
3925@@ -0,0 +1,34 @@
3926+/*
3927+ * Copyright 2013 Canonical Ltd.
3928+ *
3929+ * This program is free software: you can redistribute it and/or modify it
3930+ * under the terms of the GNU General Public License version 3, as published
3931+ * by the Free Software Foundation.
3932+ *
3933+ * This program is distributed in the hope that it will be useful, but
3934+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3935+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
3936+ * PURPOSE. See the GNU General Public License for more details.
3937+ *
3938+ * You should have received a copy of the GNU General Public License
3939+ * version 3 along with this program. If not, see
3940+ * <http://www.gnu.org/licenses/>
3941+ *
3942+ * Authored by: Michael Terry <michael.terry@canonical.com>
3943+ */
3944+
3945+#include "LoginManagerServer.h"
3946+
3947+LoginManagerServer::LoginManagerServer(QObject *parent)
3948+ : QObject(parent)
3949+{
3950+}
3951+
3952+QDBusObjectPath LoginManagerServer::GetSession(const QString &id)
3953+{
3954+ if (id == "sessionid") {
3955+ return QDBusObjectPath("/mocksession/login1");
3956+ } else {
3957+ return QDBusObjectPath();
3958+ }
3959+}
3960
3961=== added file 'tests/plugins/SessionManager/LoginManagerServer.h'
3962--- tests/plugins/SessionManager/LoginManagerServer.h 1970-01-01 00:00:00 +0000
3963+++ tests/plugins/SessionManager/LoginManagerServer.h 2014-03-27 20:58:22 +0000
3964@@ -0,0 +1,37 @@
3965+/*
3966+ * Copyright 2013 Canonical Ltd.
3967+ *
3968+ * This program is free software: you can redistribute it and/or modify it
3969+ * under the terms of the GNU General Public License version 3, as published
3970+ * by the Free Software Foundation.
3971+ *
3972+ * This program is distributed in the hope that it will be useful, but
3973+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3974+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
3975+ * PURPOSE. See the GNU General Public License for more details.
3976+ *
3977+ * You should have received a copy of the GNU General Public License
3978+ * version 3 along with this program. If not, see
3979+ * <http://www.gnu.org/licenses/>
3980+ *
3981+ * Authored by: Michael Terry <michael.terry@canonical.com>
3982+ */
3983+
3984+#ifndef UNITY_LOGINMANAGERSERVER_H
3985+#define UNITY_LOGINMANAGERSERVER_H
3986+
3987+#include <QtCore/QObject>
3988+#include <QtDBus/QDBusObjectPath>
3989+
3990+class LoginManagerServer: public QObject
3991+{
3992+ Q_OBJECT
3993+
3994+public:
3995+ explicit LoginManagerServer(QObject *parent = 0);
3996+
3997+public Q_SLOTS:
3998+ QDBusObjectPath GetSession(const QString &id);
3999+};
4000+
4001+#endif
4002
4003=== added file 'tests/plugins/SessionManager/LoginSessionServer.cpp'
4004--- tests/plugins/SessionManager/LoginSessionServer.cpp 1970-01-01 00:00:00 +0000
4005+++ tests/plugins/SessionManager/LoginSessionServer.cpp 2014-03-27 20:58:22 +0000
4006@@ -0,0 +1,25 @@
4007+/*
4008+ * Copyright 2013 Canonical Ltd.
4009+ *
4010+ * This program is free software: you can redistribute it and/or modify it
4011+ * under the terms of the GNU General Public License version 3, as published
4012+ * by the Free Software Foundation.
4013+ *
4014+ * This program is distributed in the hope that it will be useful, but
4015+ * WITHOUT ANY WARRANTY; without even the implied warranties of
4016+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
4017+ * PURPOSE. See the GNU General Public License for more details.
4018+ *
4019+ * You should have received a copy of the GNU General Public License
4020+ * version 3 along with this program. If not, see
4021+ * <http://www.gnu.org/licenses/>
4022+ *
4023+ * Authored by: Michael Terry <michael.terry@canonical.com>
4024+ */
4025+
4026+#include "LoginSessionServer.h"
4027+
4028+LoginSessionServer::LoginSessionServer(QObject *parent)
4029+ : QObject(parent)
4030+{
4031+}
4032
4033=== added file 'tests/plugins/SessionManager/LoginSessionServer.h'
4034--- tests/plugins/SessionManager/LoginSessionServer.h 1970-01-01 00:00:00 +0000
4035+++ tests/plugins/SessionManager/LoginSessionServer.h 2014-03-27 20:58:22 +0000
4036@@ -0,0 +1,39 @@
4037+/*
4038+ * Copyright 2013 Canonical Ltd.
4039+ *
4040+ * This program is free software: you can redistribute it and/or modify it
4041+ * under the terms of the GNU General Public License version 3, as published
4042+ * by the Free Software Foundation.
4043+ *
4044+ * This program is distributed in the hope that it will be useful, but
4045+ * WITHOUT ANY WARRANTY; without even the implied warranties of
4046+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
4047+ * PURPOSE. See the GNU General Public License for more details.
4048+ *
4049+ * You should have received a copy of the GNU General Public License
4050+ * version 3 along with this program. If not, see
4051+ * <http://www.gnu.org/licenses/>
4052+ *
4053+ * Authored by: Michael Terry <michael.terry@canonical.com>
4054+ */
4055+
4056+#ifndef UNITY_LOGINSESSIONSERVER_H
4057+#define UNITY_LOGINSESSIONSERVER_H
4058+
4059+#include <QtCore/QObject>
4060+#include <QtCore/QStringList>
4061+#include <QtCore/QVariant>
4062+#include <QtCore/QVariantMap>
4063+
4064+class LoginSessionServer: public QObject
4065+{
4066+ Q_OBJECT
4067+
4068+public:
4069+ explicit LoginSessionServer(QObject *parent = 0);
4070+
4071+Q_SIGNALS:
4072+ void PropertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid);
4073+};
4074+
4075+#endif
4076
4077=== added file 'tests/plugins/SessionManager/client.cpp'
4078--- tests/plugins/SessionManager/client.cpp 1970-01-01 00:00:00 +0000
4079+++ tests/plugins/SessionManager/client.cpp 2014-03-27 20:58:22 +0000
4080@@ -0,0 +1,88 @@
4081+/*
4082+ * Copyright 2013 Canonical Ltd.
4083+ *
4084+ * This program is free software: you can redistribute it and/or modify it
4085+ * under the terms of the GNU General Public License version 3, as published
4086+ * by the Free Software Foundation.
4087+ *
4088+ * This program is distributed in the hope that it will be useful, but
4089+ * WITHOUT ANY WARRANTY; without even the implied warranties of
4090+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
4091+ * PURPOSE. See the GNU General Public License for more details.
4092+ *
4093+ * You should have received a copy of the GNU General Public License
4094+ * version 3 along with this program. If not, see
4095+ * <http://www.gnu.org/licenses/>
4096+ *
4097+ * Authored by: Michael Terry <michael.terry@canonical.com>
4098+ */
4099+
4100+#include "SessionManager.h"
4101+#include <QtTest/QSignalSpy>
4102+#include <QtTest/QTest>
4103+
4104+
4105+// These tests assume the following behavior from our mock logind server:
4106+// * IsActive will return false
4107+// * Lock() will emit an ActiveChanged(true) signal
4108+//
4109+// This should lead to the following behavior from our SessionManager plugin:
4110+// * Starts active
4111+// * Becomes inactive once it connects to logind and sees IsActive result
4112+// * Becomes active once Lock() is called (which isn't really sensible, but
4113+// it's just a mock)
4114+
4115+class SessionManagerTest : public QObject
4116+{
4117+ Q_OBJECT
4118+
4119+private Q_SLOTS:
4120+
4121+ void waitForChange(SessionManager *session)
4122+ {
4123+ // Wait 5 seconds for initial activeChanged signal
4124+ QSignalSpy spy(session, SIGNAL(activeChanged()));
4125+ int i = 0;
4126+ while (spy.count() == 0 && i++ < 50)
4127+ QTest::qWait(100);
4128+ QCOMPARE(spy.count(), 1);
4129+ }
4130+
4131+ void testAssumeActive()
4132+ {
4133+ // Test that active() starts as true before we connect to service
4134+ SessionManager session;
4135+ QCOMPARE(session.active(), true);
4136+ }
4137+
4138+ void testSafeLock()
4139+ {
4140+ // Test that lock() doesn't crash if used before we connect to service
4141+ // (i.e. just test that we're not being stupid about pointers)
4142+ SessionManager session;
4143+ session.lock();
4144+ }
4145+
4146+ void testInitialSignal()
4147+ {
4148+ // Test that we get notified of change once we connect to service
4149+ SessionManager session;
4150+ waitForChange(&session);
4151+ QCOMPARE(session.active(), false);
4152+ }
4153+
4154+ void testLock()
4155+ {
4156+ // Test that lock() gets called correctly and that we listen for
4157+ // the activeChanged signal too.
4158+ SessionManager session;
4159+ waitForChange(&session);
4160+ session.lock();
4161+ waitForChange(&session);
4162+ QCOMPARE(session.active(), true);
4163+ }
4164+};
4165+
4166+QTEST_MAIN(SessionManagerTest)
4167+
4168+#include "client.moc"
4169
4170=== added file 'tests/plugins/SessionManager/interfaces.xml'
4171--- tests/plugins/SessionManager/interfaces.xml 1970-01-01 00:00:00 +0000
4172+++ tests/plugins/SessionManager/interfaces.xml 2014-03-27 20:58:22 +0000
4173@@ -0,0 +1,22 @@
4174+<node>
4175+ <interface name="org.freedesktop.login1.Manager">
4176+ <method name="GetSession">
4177+ <arg name="id" type="s" direction="in" />
4178+ <arg name="path" type="o" direction="out" />
4179+ </method>
4180+ </interface>
4181+ <interface name="org.freedesktop.login1.Session">
4182+ <property name="Active" type="b" access="read"/>
4183+ </interface>
4184+ <interface name="org.freedesktop.DBus.Properties">
4185+ <signal name="PropertiesChanged">
4186+ <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
4187+ <arg name="interface" type="s" direction="out"/>
4188+ <arg name="changed" type="a{sv}" direction="out"/>
4189+ <arg name="invalid" type="as" direction="out"/>
4190+ </signal>
4191+ </interface>
4192+ <interface name="org.freedesktop.DisplayManager.Session">
4193+ <method name="Lock"/>
4194+ </interface>
4195+</node>
4196
4197=== added file 'tests/plugins/SessionManager/server.cpp'
4198--- tests/plugins/SessionManager/server.cpp 1970-01-01 00:00:00 +0000
4199+++ tests/plugins/SessionManager/server.cpp 2014-03-27 20:58:22 +0000
4200@@ -0,0 +1,57 @@
4201+/*
4202+ * Copyright 2013 Canonical Ltd.
4203+ *
4204+ * This program is free software: you can redistribute it and/or modify it
4205+ * under the terms of the GNU General Public License version 3, as published
4206+ * by the Free Software Foundation.
4207+ *
4208+ * This program is distributed in the hope that it will be useful, but
4209+ * WITHOUT ANY WARRANTY; without even the implied warranties of
4210+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
4211+ * PURPOSE. See the GNU General Public License for more details.
4212+ *
4213+ * You should have received a copy of the GNU General Public License
4214+ * version 3 along with this program. If not, see
4215+ * <http://www.gnu.org/licenses/>
4216+ *
4217+ * Authored by: Michael Terry <michael.terry@canonical.com>
4218+ */
4219+
4220+#include "LightDMSessionAdaptor.h"
4221+#include "LightDMSessionServer.h"
4222+#include "LoginManagerAdaptor.h"
4223+#include "LoginManagerServer.h"
4224+#include "LoginPropertiesAdaptor.h"
4225+#include "LoginSessionAdaptor.h"
4226+#include "LoginSessionServer.h"
4227+#include <QtCore/QCoreApplication>
4228+
4229+int main(int argc, char *argv[])
4230+{
4231+ QCoreApplication a(argc, argv);
4232+
4233+ LoginManagerServer *manager = new LoginManagerServer();
4234+ new LoginManagerAdaptor(manager);
4235+
4236+ LoginSessionServer *l1_session = new LoginSessionServer();
4237+ new LoginSessionAdaptor(l1_session);
4238+ new LoginPropertiesAdaptor(l1_session);
4239+
4240+ LightDMSessionServer *ldm_session = new LightDMSessionServer(l1_session);
4241+ new LightDMSessionAdaptor(ldm_session);
4242+
4243+ // We use the session bus for testing. The real plugin uses the system bus
4244+ QDBusConnection connection = QDBusConnection::sessionBus();
4245+ if (!connection.registerObject("/org/freedesktop/login1", manager))
4246+ return 1;
4247+ if (!connection.registerObject("/mocksession/login1", l1_session))
4248+ return 1;
4249+ if (!connection.registerObject("/mocksession/lightdm", ldm_session))
4250+ return 1;
4251+ if (!connection.registerService("org.freedesktop.DisplayManager"))
4252+ return 1;
4253+ if (!connection.registerService("org.freedesktop.login1"))
4254+ return 1;
4255+
4256+ return a.exec();
4257+}
4258
4259=== modified file 'tests/qmltests/CMakeLists.txt'
4260--- tests/qmltests/CMakeLists.txt 2014-03-17 11:44:05 +0000
4261+++ tests/qmltests/CMakeLists.txt 2014-03-27 20:58:22 +0000
4262@@ -4,6 +4,7 @@
4263 add_subdirectory(Components)
4264
4265 set(qmltest_DEFAULT_IMPORT_PATHS
4266+ ${CMAKE_BINARY_DIR}/plugins
4267 ${CMAKE_BINARY_DIR}/tests/utils/modules
4268 ${CMAKE_BINARY_DIR}/tests/mocks
4269 )
4270@@ -20,12 +21,12 @@
4271 set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
4272 set(qmltest_DEFAULT_PROPERTIES "")
4273
4274-add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks
4275- ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
4276+add_qml_test(. Shell)
4277+add_qml_test(. GreeterShell ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/single")
4278 add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
4279 add_qml_test(Components DraggingArea)
4280 add_qml_test(Components EdgeDemoOverlay)
4281-add_qml_test(Components FilterGrid IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)
4282+add_qml_test(Components FilterGrid)
4283 add_qml_test(Components LazyImage)
4284 add_qml_test(Components Rating)
4285 add_qml_test(Components ResponsiveFlowView)
4286@@ -33,56 +34,43 @@
4287 add_qml_test(Components Revealer)
4288 add_qml_test(Components SeeMore)
4289 add_qml_test(Components Showable)
4290-add_qml_test(Components Stage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}
4291- ${CMAKE_BINARY_DIR}/tests/mocks
4292- ${CMAKE_BINARY_DIR}/plugins)
4293+add_qml_test(Components Stage)
4294 add_qml_test(Components PageHeaderLabel)
4295-add_qml_test(Dash Dash IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4296-add_qml_test(Dash DashContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4297+add_qml_test(Dash Dash)
4298+add_qml_test(Dash DashContent)
4299 add_qml_test(Dash Card)
4300 add_qml_test(Dash CardHeader)
4301 add_qml_test(Dash CardTool)
4302-add_qml_test(Dash GenericScopeView IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4303-add_qml_test(Dash/Apps RunningApplicationsGrid IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}
4304- ${CMAKE_BINARY_DIR}/tests/mocks
4305- ${CMAKE_BINARY_DIR}/plugins)
4306-add_qml_test(Dash/Previews Preview IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4307-add_qml_test(Dash/Previews PreviewActions IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4308-add_qml_test(Dash/Previews PreviewAudioPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4309-add_qml_test(Dash/Previews PreviewHeader IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4310-add_qml_test(Dash/Previews PreviewImageGallery IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4311-add_qml_test(Dash/Previews PreviewProgress IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4312-add_qml_test(Dash/Previews PreviewRatingDisplay IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4313-add_qml_test(Dash/Previews PreviewRatingInput IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4314-add_qml_test(Dash/Previews PreviewTextSummary IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4315-add_qml_test(Dash/Previews PreviewVideoPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4316-add_qml_test(Dash/Previews PreviewWidgetFactory IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4317-add_qml_test(Dash/Previews PreviewZoomableImage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
4318-add_qml_test(Greeter Lockscreen IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
4319- PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
4320-add_qml_test(Greeter Tablet IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
4321- ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
4322-add_qml_test(Greeter Phone IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
4323- ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
4324-add_qml_test(Greeter Infographics IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
4325- ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
4326-add_qml_test(Greeter Clock IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
4327- ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
4328+add_qml_test(Dash GenericScopeView)
4329+add_qml_test(Dash/Apps RunningApplicationsGrid)
4330+add_qml_test(Dash/Previews Preview)
4331+add_qml_test(Dash/Previews PreviewActions)
4332+add_qml_test(Dash/Previews PreviewAudioPlayback)
4333+add_qml_test(Dash/Previews PreviewHeader)
4334+add_qml_test(Dash/Previews PreviewImageGallery)
4335+add_qml_test(Dash/Previews PreviewProgress)
4336+add_qml_test(Dash/Previews PreviewRatingDisplay)
4337+add_qml_test(Dash/Previews PreviewRatingInput)
4338+add_qml_test(Dash/Previews PreviewTextSummary)
4339+add_qml_test(Dash/Previews PreviewVideoPlayback)
4340+add_qml_test(Dash/Previews PreviewWidgetFactory)
4341+add_qml_test(Dash/Previews PreviewZoomableImage)
4342+add_qml_test(Greeter Lockscreen ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/full")
4343+add_qml_test(Greeter Tablet ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/full")
4344+add_qml_test(Greeter Phone ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/single")
4345+add_qml_test(Greeter Infographics ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/full")
4346+add_qml_test(Greeter Clock ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
4347 add_qml_test(Hud Hud)
4348 add_qml_test(Hud Result)
4349-add_qml_test(Launcher Launcher IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4350-add_qml_test(Notifications Notifications IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)
4351+add_qml_test(Launcher Launcher)
4352+add_qml_test(Notifications Notifications)
4353 add_qml_test(Panel IndicatorRow)
4354-add_qml_test(Panel Indicators IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4355-add_qml_test(Panel MenuContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4356-add_qml_test(Panel Panel IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4357+add_qml_test(Panel Indicators)
4358+add_qml_test(Panel MenuContent)
4359+add_qml_test(Panel Panel)
4360 add_qml_test(Panel SearchIndicator)
4361-add_qml_test(Panel/Indicators DefaultIndicatorWidget IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
4362- ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
4363-add_qml_test(Panel/Indicators DefaultIndicatorPage IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
4364- ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
4365-add_qml_test(Panel/Indicators MenuItemFactory IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)
4366-add_qml_test(Panel/Indicators MessageMenuItemFactory IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)
4367-add_qml_test(SideStage SideStage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}
4368- ${CMAKE_BINARY_DIR}/tests/mocks
4369- ${CMAKE_BINARY_DIR}/plugins)
4370+add_qml_test(Panel/Indicators DefaultIndicatorWidget ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
4371+add_qml_test(Panel/Indicators DefaultIndicatorPage ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
4372+add_qml_test(Panel/Indicators MenuItemFactory)
4373+add_qml_test(Panel/Indicators MessageMenuItemFactory)
4374+add_qml_test(SideStage SideStage)
4375
4376=== modified file 'tests/qmltests/Greeter/tst_Phone.qml'
4377--- tests/qmltests/Greeter/tst_Phone.qml 2014-02-20 20:14:40 +0000
4378+++ tests/qmltests/Greeter/tst_Phone.qml 2014-03-27 20:58:22 +0000
4379@@ -33,7 +33,7 @@
4380 height: parent.height
4381 x: 0; y: 0
4382
4383- defaultBackground: Qt.resolvedUrl("../../../qml/graphics/phone_background.jpg")
4384+ background: Qt.resolvedUrl("../../../qml/graphics/phone_background.jpg")
4385
4386 property int minX: 0
4387
4388@@ -61,6 +61,12 @@
4389 signalName: "unlocked"
4390 }
4391
4392+ SignalSpy {
4393+ id: teaseSpy
4394+ target: greeter
4395+ signalName: "tease"
4396+ }
4397+
4398 UT.UnityTestCase {
4399 name: "Greeter"
4400 when: windowShown
4401@@ -82,56 +88,10 @@
4402 }
4403
4404 function test_teasingArea(data) {
4405- tryCompare(greeter, "leftTeaserPressed", false)
4406- tryCompare(greeter, "rightTeaserPressed", false)
4407- mousePress(greeter, data.posX, greeter.height - units.gu(1))
4408- tryCompare(greeter, "leftTeaserPressed", data.leftPressed)
4409- tryCompare(greeter, "rightTeaserPressed", data.rightPressed)
4410- mouseRelease(greeter, data.posX, greeter.height - units.gu(1))
4411- tryCompare(greeter, "leftTeaserPressed", false)
4412- tryCompare(greeter, "rightTeaserPressed", false)
4413- }
4414-
4415- function test_teaseLockedUnlocked_data() {
4416- return [
4417- {tag: "unlocked", locked: false, moved: false},
4418- {tag: "locked", locked: true, moved: false},
4419- {tag: "moved", locked: false, moved: true}
4420- ];
4421- }
4422-
4423- function test_teaseLockedUnlocked(data) {
4424- tryCompare(greeter, "rightTeaserPressed", false);
4425- tryCompare(greeter, "x", 0);
4426- greeter.locked = data.locked;
4427-
4428- // simulate greeter being in the middle of a swipe
4429- if (data.moved) {
4430- greeter.x = -units.gu(4);
4431- tryCompare(greeter, "x", -units.gu(4));
4432- }
4433-
4434- mouseClick(greeter, greeter.width - units.gu(5), greeter.height - units.gu(1));
4435- greeter.minX = 0; // This is needed because the transition actually makes x jump once before animating
4436-
4437- if (!data.moved) {
4438- // Check if it has been moved over by 2 GUs. Give it a 2 pixel grace area
4439- // because animation duration and teaseTimer are the same duration and
4440- // might cause slight offsets
4441- tryCompareFunction(function() { return greeter.minX <= -units.gu(2) + 2}, true);
4442- } else {
4443- // waiting 100ms to make sure nothing moves
4444- wait(100);
4445- compare(greeter.minX, 0, "Greeter teasing not disabled even though it's locked or moving.");
4446- }
4447-
4448- // Restore position in case we moved it for the test
4449- if (data.moved) {
4450- greeter.x = 0;
4451- }
4452-
4453- // Wait until we're back to 0
4454- tryCompareFunction(function() { return greeter.x;}, 0);
4455+ teaseSpy.clear()
4456+ mouseClick(greeter, data.posX, greeter.height - units.gu(1))
4457+ teaseSpy.wait()
4458+ tryCompare(teaseSpy, "count", 1)
4459 }
4460
4461 function test_statsWelcomeScreen() {
4462@@ -144,22 +104,6 @@
4463 tryCompare(LightDM.Infographic, "username", "single")
4464 }
4465
4466- function test_background_data() {
4467- return [
4468- {tag: "set", accounts: Qt.resolvedUrl("../../data/unity/backgrounds/blue.png"), expected: "blue.png"},
4469- {tag: "unset", accounts: "", expected: "background.jpg"},
4470- {tag: "invalid", accounts: "invalid", expected: "background.jpg"},
4471- ]
4472- }
4473-
4474- function test_background(data) {
4475- var loader = findChild(greeter, "greeterContentLoader")
4476- var background = findChild(loader.item, "greeterBackground")
4477- AccountsService.backgroundFile = data.accounts
4478- tryCompareFunction(function() { return background.source.toString().indexOf(data.expected) !== -1; }, true)
4479- tryCompare(background, "status", Image.Ready)
4480- }
4481-
4482 function test_initial_selected_signal() {
4483 var greeterObj = greeterComponent.createObject(this)
4484 var spy = findChild(greeterObj, "selectedSpy")
4485
4486=== modified file 'tests/qmltests/Greeter/tst_Tablet.qml'
4487--- tests/qmltests/Greeter/tst_Tablet.qml 2014-02-20 20:14:40 +0000
4488+++ tests/qmltests/Greeter/tst_Tablet.qml 2014-03-27 20:58:22 +0000
4489@@ -54,6 +54,12 @@
4490 signalName: "selected"
4491 }
4492
4493+ SignalSpy {
4494+ id: teaseSpy
4495+ target: greeter
4496+ signalName: "tease"
4497+ }
4498+
4499 UT.UnityTestCase {
4500 name: "Greeter"
4501 when: windowShown
4502@@ -325,14 +331,36 @@
4503 }
4504
4505 function test_teasingArea(data) {
4506- tryCompare(greeter, "leftTeaserPressed", false)
4507- tryCompare(greeter, "rightTeaserPressed", false)
4508- mousePress(greeter, data.posX, greeter.height - units.gu(1))
4509- tryCompare(greeter, "leftTeaserPressed", data.leftPressed)
4510- tryCompare(greeter, "rightTeaserPressed", data.rightPressed)
4511- mouseRelease(greeter, data.posX, greeter.height - units.gu(1))
4512- tryCompare(greeter, "leftTeaserPressed", false)
4513- tryCompare(greeter, "rightTeaserPressed", false)
4514+ teaseSpy.clear()
4515+ mouseClick(greeter, data.posX, greeter.height - units.gu(1))
4516+ teaseSpy.wait()
4517+ tryCompare(teaseSpy, "count", 1)
4518+ }
4519+
4520+ function test_teaseLockedUnlocked_data() {
4521+ return [
4522+ {tag: "unlocked", locked: false, narrow: false},
4523+ {tag: "locked", locked: true, narrow: false},
4524+ ];
4525+ }
4526+
4527+ function test_teaseLockedUnlocked(data) {
4528+ teaseSpy.clear()
4529+ greeter.locked = data.locked;
4530+
4531+ mouseClick(greeter, greeter.width - units.gu(5), greeter.height - units.gu(1));
4532+
4533+ if (!data.locked || data.narrow) {
4534+ teaseSpy.wait()
4535+ tryCompare(teaseSpy, "count", 1);
4536+ } else {
4537+ // waiting 100ms to make sure nothing happens
4538+ wait(100);
4539+ compare(teaseSpy.count, 0, "Greeter teasing not disabled even though it's locked.");
4540+ }
4541+
4542+ // Reset value
4543+ greeter.locked = false;
4544 }
4545
4546 function test_dbus_set_active_entry() {
4547
4548=== added file 'tests/qmltests/tst_GreeterShell.qml'
4549--- tests/qmltests/tst_GreeterShell.qml 1970-01-01 00:00:00 +0000
4550+++ tests/qmltests/tst_GreeterShell.qml 2014-03-27 20:58:22 +0000
4551@@ -0,0 +1,79 @@
4552+/*
4553+ * Copyright (C) 2013 Canonical, Ltd.
4554+ *
4555+ * Authors:
4556+ * Michael Terry <michael.terry@canonical.com>
4557+ *
4558+ * This program is free software; you can redistribute it and/or modify
4559+ * it under the terms of the GNU General Public License as published by
4560+ * the Free Software Foundation; version 3.
4561+ *
4562+ * This program is distributed in the hope that it will be useful,
4563+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4564+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4565+ * GNU General Public License for more details.
4566+ *
4567+ * You should have received a copy of the GNU General Public License
4568+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4569+ */
4570+
4571+import QtQuick 2.0
4572+import QtTest 1.0
4573+import AccountsService 0.1
4574+import GSettings 1.0
4575+import Unity.Application 0.1
4576+import Unity.Test 0.1 as UT
4577+import Powerd 0.1
4578+
4579+import "../../qml"
4580+
4581+Item {
4582+ width: shell.width
4583+ height: shell.height
4584+
4585+ QtObject {
4586+ id: applicationArguments
4587+
4588+ function hasGeometry() {
4589+ return false;
4590+ }
4591+
4592+ function width() {
4593+ return 0;
4594+ }
4595+
4596+ function height() {
4597+ return 0;
4598+ }
4599+ }
4600+
4601+ GreeterShell {
4602+ id: shell
4603+ defaultBackground: Qt.resolvedUrl("../../qml/graphics/phone_background.jpg")
4604+ }
4605+
4606+ UT.UnityTestCase {
4607+ name: "GreeterShell"
4608+ when: windowShown
4609+
4610+ function test_wallpaper_data() {
4611+ return [
4612+ {tag: "both", accounts: "../tests/data/unity/backgrounds/blue.png", gsettings: "../tests/data/unity/backgrounds/red.png", expected: "blue.png"},
4613+ {tag: "accounts", accounts: "../tests/data/unity/backgrounds/blue.png", gsettings: "", expected: "blue.png"},
4614+ {tag: "gsettings", accounts: "", gsettings: "../tests/data/unity/backgrounds/red.png", expected: "red.png"},
4615+ {tag: "none", accounts: "", gsettings: "", expected: shell.defaultBackground},
4616+ {tag: "invalid-both", accounts: "invalid", gsettings: "invalid", expected: shell.defaultBackground},
4617+ {tag: "invalid-accounts", accounts: "invalid", gsettings: "../tests/data/unity/backgrounds/red.png", expected: shell.defaultBackground},
4618+ {tag: "invalid-gsettings", accounts: "../tests/data/unity/backgrounds/blue.png", gsettings: "invalid", expected: "blue.png"},
4619+ ]
4620+ }
4621+
4622+ function test_wallpaper(data) {
4623+ var greeterBackground = findChild(shell, "greeterBackground")
4624+ GSettingsController.setPictureUri(data.gsettings)
4625+ AccountsService.backgroundFile = data.accounts
4626+ verify(greeterBackground.source.toString().indexOf(data.expected) !== -1)
4627+ tryCompare(greeterBackground, "status", Image.Ready)
4628+ }
4629+ }
4630+}
4631
4632=== modified file 'tests/qmltests/tst_Shell.qml'
4633--- tests/qmltests/tst_Shell.qml 2014-03-19 10:48:06 +0000
4634+++ tests/qmltests/tst_Shell.qml 2014-03-27 20:58:22 +0000
4635@@ -23,6 +23,7 @@
4636 import Unity.Application 0.1
4637 import Unity.Test 0.1 as UT
4638 import Powerd 0.1
4639+import SessionManager 0.1
4640
4641 import "../../qml"
4642
4643@@ -48,6 +49,7 @@
4644
4645 Shell {
4646 id: shell
4647+ defaultBackground: Qt.resolvedUrl("../../qml/graphics/phone_background.jpg")
4648 }
4649
4650 UT.UnityTestCase {
4651@@ -72,9 +74,6 @@
4652 ok = homeLoader !== null
4653 && homeLoader.item !== undefined;
4654
4655- var greeter = findChild(shell, "greeter");
4656- ok &= greeter !== null;
4657-
4658 var launcherPanel = findChild(shell, "launcherPanel");
4659 ok &= launcherPanel !== null;
4660
4661@@ -89,17 +88,9 @@
4662 } while (!ok && attempts <= maxAttempts);
4663
4664 verify(ok);
4665-
4666- swipeAwayGreeter();
4667 }
4668
4669 function cleanup() {
4670- // If a test invoked the greeter, make sure we swipe it away again
4671- var greeter = findChild(shell, "greeter");
4672- if (greeter.shown) {
4673- swipeAwayGreeter();
4674- }
4675-
4676 // kill all (fake) running apps
4677 killApps(ApplicationManager);
4678
4679@@ -180,8 +171,6 @@
4680 }
4681
4682 function test_suspend() {
4683- var greeter = findChild(shell, "greeter");
4684-
4685 // Launch an app from the launcher
4686 dragLauncherIntoView();
4687 tapOnAppIconInLauncher();
4688@@ -192,35 +181,21 @@
4689
4690 // Try to suspend while proximity is engaged...
4691 Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
4692- tryCompare(greeter, "showProgress", 0);
4693+ tryCompare(ApplicationManager, "focusedApplicationId", mainApp);
4694
4695 // Now really suspend
4696 Powerd.displayPowerStateChange(Powerd.Off, 0);
4697- tryCompare(greeter, "showProgress", 1);
4698 tryCompare(ApplicationManager, "focusedApplicationId", "");
4699
4700 // And wake up
4701 Powerd.displayPowerStateChange(Powerd.On, 0);
4702 tryCompare(ApplicationManager, "focusedApplicationId", "");
4703- tryCompare(greeter, "showProgress", 1);
4704
4705- // Swipe away greeter to focus app
4706- swipeAwayGreeter();
4707+ // Activate session to focus app
4708+ SessionManager.active = true;
4709 tryCompare(ApplicationManager, "focusedApplicationId", mainApp);
4710 }
4711
4712- function swipeAwayGreeter() {
4713- var greeter = findChild(shell, "greeter");
4714- tryCompare(greeter, "showProgress", 1);
4715-
4716- var touchX = shell.width - (shell.edgeSize / 2);
4717- var touchY = shell.height / 2;
4718- touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY);
4719-
4720- // wait until the animation has finished
4721- tryCompare(greeter, "showProgress", 0);
4722- }
4723-
4724 /*
4725 Perform a right-edge drag when the Dash is being show and there are
4726 no running/minimized apps to be restored.
4727@@ -477,23 +452,15 @@
4728
4729 function test_DashShown_data() {
4730 return [
4731- {tag: "in focus", greeter: false, app: false, launcher: false, indicators: false, expectedShown: true},
4732- {tag: "under greeter", greeter: true, app: false, launcher: false, indicators: false, expectedShown: false},
4733- {tag: "under app", greeter: false, app: true, launcher: false, indicators: false, expectedShown: false},
4734- {tag: "under launcher", greeter: false, app: false, launcher: true, indicators: false, expectedShown: true},
4735- {tag: "under indicators", greeter: false, app: false, launcher: false, indicators: true, expectedShown: true},
4736+ {tag: "in focus", app: false, launcher: false, indicators: false, expectedShown: true},
4737+ {tag: "under app", app: true, launcher: false, indicators: false, expectedShown: false},
4738+ {tag: "under launcher", app: false, launcher: true, indicators: false, expectedShown: true},
4739+ {tag: "under indicators", app: false, launcher: false, indicators: true, expectedShown: true},
4740 ]
4741 }
4742
4743 function test_DashShown(data) {
4744
4745- if (data.greeter) {
4746- // Swipe the greeter in
4747- var greeter = findChild(shell, "greeter");
4748- Powerd.displayPowerStateChange(Powerd.Off, 0);
4749- tryCompare(greeter, "showProgress", 1);
4750- }
4751-
4752 if (data.app) {
4753 dragLauncherIntoView();
4754 tapOnAppIconInLauncher();
4755@@ -523,17 +490,6 @@
4756 tryCompare(searchIndicator, "opacity", 0);
4757 }
4758
4759- function test_searchIndicatorHidesOnGreeterShown() {
4760- var searchIndicator = findChild(shell, "container")
4761- var greeter = findChild(shell, "greeter");
4762-
4763- tryCompare(searchIndicator, "opacity", 1)
4764-
4765- greeter.show()
4766- tryCompare(greeter, "shown", true)
4767- tryCompare(searchIndicator, "opacity", 0)
4768- }
4769-
4770 function test_searchIndicatorHideOnPreviewShown() {
4771 var searchIndicator = findChild(shell, "container");
4772 var dashContent = findChild(shell, "dashContent");

Subscribers

People subscribed via source and target branches