Merge lp:~aacid/unity8/no_preview_in_preview_title into lp:unity8

Proposed by Albert Astals Cid
Status: Superseded
Proposed branch: lp:~aacid/unity8/no_preview_in_preview_title
Merge into: lp:unity8
Diff against target: 4962 lines (+828/-2258)
104 files modified
CMakeLists.txt (+0/-1)
data/51-unity8-greeter.conf (+0/-2)
data/CMakeLists.txt (+0/-13)
data/unity8-greeter-init.conf (+0/-12)
data/unity8-greeter-wrapper (+0/-109)
data/unity8-greeter.desktop.in (+0/-5)
debian/changelog (+8/-0)
debian/control (+2/-15)
debian/copyright (+1/-1)
debian/rules (+4/-0)
debian/unity8-greeter.install (+0/-6)
debian/unity8-private.install (+0/-1)
debian/unity8.install (+1/-0)
plugins/AccountsService/AccountsService.cpp (+11/-34)
plugins/AccountsService/AccountsService.h (+0/-9)
plugins/CMakeLists.txt (+0/-1)
plugins/LightDM/CMakeLists.txt (+9/-6)
plugins/LightDM/Greeter.cpp (+0/-3)
plugins/LightDM/Greeter.h (+0/-2)
plugins/LightDM/URLDispatcher.cpp (+0/-55)
plugins/LightDM/URLDispatcher.h (+0/-34)
plugins/LightDM/plugin.cpp (+0/-9)
plugins/SessionBroadcast/SessionBroadcast.cpp (+0/-35)
plugins/SessionBroadcast/SessionBroadcast.h (+0/-11)
plugins/SessionManager/CMakeLists.txt (+0/-22)
plugins/SessionManager/SessionManager.cpp (+0/-124)
plugins/SessionManager/SessionManager.h (+0/-61)
plugins/SessionManager/plugin.cpp (+0/-35)
plugins/SessionManager/plugin.h (+0/-35)
plugins/SessionManager/qmldir (+0/-2)
plugins/Unity/Launcher/backend/launcherbackend.cpp (+2/-16)
plugins/Unity/Launcher/backend/launcherbackend.h (+1/-7)
plugins/Unity/Launcher/launcheritem.cpp (+9/-14)
plugins/Unity/Launcher/launcheritem.h (+1/-2)
plugins/Unity/Launcher/launchermodel.cpp (+11/-41)
plugins/Unity/Launcher/launchermodel.h (+0/-2)
po/unity8.pot (+29/-34)
qml/Components/BasicShell.qml (+0/-84)
qml/Components/EdgeDemo.qml (+53/-1)
qml/Components/Lockscreen.qml (+19/-0)
qml/Components/PageHeader.qml (+2/-3)
qml/Dash/PreviewListView.qml (+1/-1)
qml/Dash/ScopeListView.qml (+2/-3)
qml/Greeter/Clock.qml (+1/-1)
qml/Greeter/Greeter.qml (+3/-36)
qml/Greeter/GreeterContent.qml (+38/-0)
qml/Greeter/GreeterEdgeDemo.qml (+0/-102)
qml/Greeter/Infographics.qml (+2/-0)
qml/GreeterShell.qml (+0/-283)
qml/Hud/Hud.qml (+4/-1)
qml/Notifications/NotificationMenuItemFactory.qml (+12/-29)
qml/Shell.qml (+177/-31)
run.sh (+4/-6)
src/CMakeLists.txt (+3/-15)
src/main.cpp (+4/-18)
tests/autopilot/unity8/application_lifecycle/tests/__init__.py (+2/-0)
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py (+29/-1)
tests/autopilot/unity8/application_lifecycle/tests/test_greeter.py (+0/-75)
tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py (+0/-1)
tests/autopilot/unity8/indicators/tests/test_indicators.py (+2/-0)
tests/autopilot/unity8/process_helpers.py (+56/-0)
tests/autopilot/unity8/shell/tests/__init__.py (+4/-16)
tests/autopilot/unity8/shell/tests/disabled_test_hud.py (+7/-1)
tests/autopilot/unity8/shell/tests/test_emulators.py (+3/-0)
tests/autopilot/unity8/shell/tests/test_lock_screen.py (+13/-12)
tests/autopilot/unity8/shell/tests/test_notifications.py (+14/-2)
tests/mocks/AccountsService/AccountsService.cpp (+0/-9)
tests/mocks/AccountsService/AccountsService.h (+0/-7)
tests/mocks/CMakeLists.txt (+1/-2)
tests/mocks/LightDM/CMakeLists.txt (+46/-0)
tests/mocks/LightDM/Greeter.cpp (+0/-11)
tests/mocks/LightDM/Greeter.h (+0/-4)
tests/mocks/LightDM/demo/CMakeLists.txt (+21/-0)
tests/mocks/LightDM/demo/GreeterPrivate.cpp (+70/-0)
tests/mocks/LightDM/demo/UsersModelPrivate.cpp (+41/-0)
tests/mocks/LightDM/full/CMakeLists.txt (+2/-3)
tests/mocks/LightDM/qmldir (+3/-0)
tests/mocks/LightDM/single-passphrase/CMakeLists.txt (+2/-3)
tests/mocks/LightDM/single-pin/CMakeLists.txt (+2/-3)
tests/mocks/LightDM/single/CMakeLists.txt (+2/-3)
tests/mocks/SessionManager/CMakeLists.txt (+0/-19)
tests/mocks/SessionManager/SessionManager.cpp (+0/-43)
tests/mocks/SessionManager/SessionManager.h (+0/-49)
tests/mocks/SessionManager/plugin.cpp (+0/-34)
tests/mocks/SessionManager/plugin.h (+0/-34)
tests/mocks/SessionManager/qmldir (+0/-2)
tests/plugins/CMakeLists.txt (+1/-2)
tests/plugins/LightDM/CMakeLists.txt (+4/-5)
tests/plugins/SessionManager/CMakeLists.txt (+0/-48)
tests/plugins/SessionManager/LightDMSessionServer.cpp (+0/-38)
tests/plugins/SessionManager/LightDMSessionServer.h (+0/-40)
tests/plugins/SessionManager/LoginManagerServer.cpp (+0/-34)
tests/plugins/SessionManager/LoginManagerServer.h (+0/-37)
tests/plugins/SessionManager/LoginSessionServer.cpp (+0/-25)
tests/plugins/SessionManager/LoginSessionServer.h (+0/-39)
tests/plugins/SessionManager/client.cpp (+0/-88)
tests/plugins/SessionManager/interfaces.xml (+0/-22)
tests/plugins/SessionManager/server.cpp (+0/-57)
tests/qmltests/CMakeLists.txt (+6/-6)
tests/qmltests/Greeter/tst_Lockscreen.qml (+1/-0)
tests/qmltests/Greeter/tst_SingleGreeter.qml (+0/-2)
tests/qmltests/tst_GreeterShell.qml (+0/-88)
tests/qmltests/tst_Shell.qml (+64/-10)
tools/unlock-device (+18/-10)
To merge this branch: bzr merge lp:~aacid/unity8/no_preview_in_preview_title
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity Team Pending
Review via email: mp+223027@code.launchpad.net

Commit message

Drop the " Preview" suffix from Preview title

As requested in https://bugs.launchpad.net/unity8/+bug/1316671

Description of the change

* Are there any related MPs required for this MP to build/function as expected?
No

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

 * Did you make sure that your branch does not contain spurious tags?
Yes

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

 * If you changed the UI, has there been a design review?
It's a design driven change.

To post a comment you must log in.
967. By Albert Astals Cid

Merge ~mterry/unity8/unsplit/

968. By Albert Astals Cid

update pot

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

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

Subscribers

People subscribed via source and target branches