on xenial help sign in
merge trunk
commitcfda3705537c6e85bd16ef695f03c8b8edd3f119 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 23 Aug 2013, 18:14 (13 years ago) parent5252824a8ae7fd
60 files changed+288−116
Launcher/LauncherPanel.qml+30−4 Shell.qml+5−3 debian/changelog+38 debian/control+1−1 plugins/Powerd/Powerd.cpp+2−2 plugins/Powerd/Powerd.h+15−1 plugins/Unity/Launcher/launchermodel.cpp+34 plugins/Unity/Launcher/launchermodel.h+5 plugins/Unity/categories.cpp+6 plugins/Unity/categories.h+1 plugins/Unity/genericoptionsmodel.cpp+2−2 plugins/Unity/genericoptionsmodel.h+1−1 plugins/Unity/plugin.cpp+2 po/ar.po+2−2 po/az.po+2−2 po/bg.po+2−2 po/ca.po+2−2 po/de.po+2−2 po/el.po+2−2 po/en_AU.po+2−2 po/en_GB.po+2−2 po/eo.po+2−2 po/es.po+2−2 po/fi.po+2−2 po/fo.po+2−2 po/fr.po+2−2 po/gl.po+2−2 po/he.po+2−2 po/hr.po+2−2 po/hu.po+2−2 po/hy.po+2−2 po/id.po+2−2 po/it.po+2−2 po/ja.po+2−2 po/kn.po+2−2 po/ko.po+2−2 po/ky.po+2−2 po/lv.po+2−2 po/my.po+2−2 po/nb.po+2−2 po/nl.po+2−2 po/pl.po+2−2 po/pt_BR.po+2−2 po/ro.po+2−2 po/ru.po+2−2 po/si.po+2−2 po/sl.po+2−2 po/sr.po+2−2 po/sv.po+2−2 po/te.po+2−2 po/tr.po+2−2 po/ug.po+2−2 po/uk.po+2−2 po/zh_CN.po+2−2 po/zh_TW.po+2−2 tests/mocks/Powerd/Powerd.h+15−2 tests/mocks/Unity/Launcher/MockLauncherModel.cpp+6 tests/mocks/Unity/Launcher/MockLauncherModel.h+1 tests/qmltests/Launcher/tst_Launcher.qml+33−13 tests/qmltests/tst_Shell.qml+7−3
Launcher/LauncherPanel.qml+30−4
@@ -123,6 +123,12 @@ Item {
123123 property real realContentY: contentY - originY + topMargin
124124 property int realItemHeight: itemHeight + spacing
125125
126+ // In case the start dragging transition is running, we need to delay the
127+ // move because the displaced transition would clash with it and cause items
128+ // to be moved to wrong places
129+ property bool draggingTransitionRunning: false
130+ property int scheduledMoveTo: -1
131+
126132 displaced: Transition {
127133 NumberAnimation { properties: "x,y"; duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
128134 }
@@ -203,10 +209,26 @@ Item {
203209 UbuntuNumberAnimation { properties: "angle,offset" }
204210 },
205211 Transition {
212+ id: draggingTransition
206213 from: "selected"
207214 to: "dragging"
208− UbuntuNumberAnimation { properties: "height" }
209− NumberAnimation { target: dropIndicator; properties: "opacity"; duration: UbuntuAnimation.FastDuration }
215+ SequentialAnimation {
216+ PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: true }
217+ ParallelAnimation {
218+ UbuntuNumberAnimation { properties: "height" }
219+ NumberAnimation { target: dropIndicator; properties: "opacity"; duration: UbuntuAnimation.FastDuration }
220+ }
221+ ScriptAction {
222+ script: {
223+ if (launcherListView.scheduledMoveTo > -1) {
224+ launcherListView.model.move(dndArea.draggedIndex, launcherListView.scheduledMoveTo)
225+ dndArea.draggedIndex = launcherListView.scheduledMoveTo
226+ launcherListView.scheduledMoveTo = -1
227+ }
228+ }
229+ }
230+ PropertyAction { target: launcherListView; property: "draggingTransitionRunning"; value: false }
231+ }
210232 },
211233 Transition {
212234 from: "dragging"
@@ -388,8 +410,12 @@ Item {
388410 }
389411
390412 if (newIndex >= 0 && newIndex < launcherListView.count) {
391− launcherListView.model.move(draggedIndex, newIndex)
392− draggedIndex = newIndex
413+ if (launcherListView.draggingTransitionRunning) {
414+ launcherListView.scheduledMoveTo = newIndex
415+ } else {
416+ launcherListView.model.move(draggedIndex, newIndex)
417+ draggedIndex = newIndex
418+ }
393419 }
394420 }
395421 }
Shell.qml+5−3
@@ -497,11 +497,13 @@ FocusScope {
497497 }
498498 }
499499
500− onPowerStateChange: {
501− if (state == 0) { // suspend
500+ onDisplayPowerStateChange: {
501+ // We ignore any display-off signals when the proximity sensor
502+ // is active. This usually indicates something like a phone call.
503+ if (status == Powerd.Off && (flags & Powerd.UseProximity) == 0) {
502504 powerConnection.setFocused(false);
503505 greeter.show();
504− } else if (state == 1) { // active
506+ } else if (status == Powerd.On) {
505507 powerConnection.setFocused(true);
506508 }
507509 }
debian/changelog+38
@@ -1,3 +1,41 @@
1+unity8 (7.81.3+13.10.20130821.2-0ubuntu1) saucy; urgency=low
2+
3+ [ Michael Terry ]
4+ * Listen to display-power-changed rather than system-power-changed
5+ signals when showing the greeter; ignore such signals when the
6+ proximity sensor is active. (LP: #1214477)
7+
8+ [ Pawel Stolowski ]
9+ * Added a role for accessing progress-source property of categories.
10+
11+ [ Ubuntu daily release ]
12+ * Automatic snapshot from revision 233
13+
14+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 21 Aug 2013 22:09:53 +0000
15+
16+unity8 (7.81.3+13.10.20130821.1-0ubuntu1) saucy; urgency=low
17+
18+ [ Michael Zanetti ]
19+ * allow testing at 11:13. Old code failed because the text actually
20+ says "11:13 AM".
21+ * add some checks if we actually clicked an item or in the spacing
22+ between them gets rid of some warnings printed by the launcher .
23+
24+ [ Michał Sawicz ]
25+ * Update runtime deps in the build script.
26+
27+ [ Nick Dedekind ]
28+ * Added/Updated legacy network indicator components to use with new
29+ indicator backend.
30+
31+ [ Albert Astals ]
32+ * Fix insertions/removals on the qlimitproxymodel . (LP: #1213959)
33+
34+ [ Ubuntu daily release ]
35+ * Automatic snapshot from revision 230
36+
37+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 21 Aug 2013 15:04:59 +0000
38+
139unity8 (7.81.3+13.10.20130821-0ubuntu1) saucy; urgency=low
240
341 [ Michael Zanetti ]
debian/control+1−1
@@ -20,7 +20,7 @@ Build-Depends: cmake,
2020 libsigc++-2.0-dev,
2121 libunity-api-dev (>= 7.80.3),
2222 libunity-core-6.0-dev (<< 7.80),
23− libunity-dev (>= 7.0.3),
23+ libunity-dev (>= 7.0.12),
2424 libunity-scopes-json-def-phone,
2525 libupstart-dev,
2626 libusermetricsoutput1-dev,
plugins/Powerd/Powerd.cpp+2−2
@@ -30,7 +30,7 @@ Powerd::Powerd(QObject* parent)
3030 powerd->connection().connect("com.canonical.powerd",
3131 "/com/canonical/powerd",
3232 "com.canonical.powerd",
33− "SysPowerStateChange",
33+ "DisplayPowerStateChange",
3434 this,
35− SIGNAL(powerStateChange(int)));
35+ SIGNAL(displayPowerStateChange(int, unsigned int)));
3636}
plugins/Powerd/Powerd.h+15−1
@@ -26,12 +26,26 @@
2626class Powerd: public QObject
2727{
2828 Q_OBJECT
29+ Q_ENUMS(Status)
30+ Q_FLAGS(DisplayFlag DisplayFlags)
2931
3032public:
33+ enum DisplayFlag {
34+ UseProximity = 1, // Use proximity sensor to override screen state
35+ DisableAutoBrightness = 2, // Force autobrightness to be disabled
36+ Bright = 4, // Request the screen to stay bright
37+ };
38+ Q_DECLARE_FLAGS(DisplayFlags, DisplayFlag)
39+
40+ enum Status {
41+ Off,
42+ On,
43+ };
44+
3145 explicit Powerd(QObject *parent = 0);
3246
3347Q_SIGNALS:
34− void powerStateChange(int state);
48+ void displayPowerStateChange(int status, unsigned int flags);
3549
3650private:
3751 QDBusInterface *powerd;
plugins/Unity/Launcher/launchermodel.cpp+34
@@ -25,6 +25,9 @@ LauncherModel::LauncherModel(QObject *parent):
2525 LauncherModelInterface(parent),
2626 m_backend(new LauncherBackend(this))
2727{
28+ connect(m_backend, SIGNAL(countChanged(QString,int)), SLOT(countChanged(QString,int)));
29+ connect(m_backend, SIGNAL(progressChanged(QString,int)), SLOT(progressChanged(QString,int)));
30+
2831 Q_FOREACH (const QString &entry, m_backend->storedApplications()) {
2932 LauncherItem *item = new LauncherItem(entry,
3033 m_backend->desktopFile(entry),
@@ -67,6 +70,10 @@ QVariant LauncherModel::data(const QModelIndex &index, int role) const
6770 return item->icon();
6871 case RolePinned:
6972 return item->pinned();
73+ case RoleCount:
74+ return item->count();
75+ case RoleProgress:
76+ return item->progress();
7077 }
7178
7279 return QVariant();
@@ -177,6 +184,12 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
177184 }
178185}
179186
187+void LauncherModel::setUser(const QString &username)
188+{
189+ Q_UNUSED(username)
190+ // TODO: Implement this...
191+}
192+
180193void LauncherModel::storeAppList()
181194{
182195 QStringList appIds;
@@ -198,3 +211,24 @@ int LauncherModel::findApplication(const QString &appId)
198211 }
199212 return -1;
200213}
214+
215+void LauncherModel::progressChanged(const QString &appId, int progress)
216+{
217+ int idx = findApplication(appId);
218+ if (idx >= 0) {
219+ LauncherItem *item = m_list.at(idx);
220+ item->setProgress(progress);
221+ Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleProgress);
222+ }
223+}
224+
225+
226+void LauncherModel::countChanged(const QString &appId, int count)
227+{
228+ int idx = findApplication(appId);
229+ if (idx >= 0) {
230+ LauncherItem *item = m_list.at(idx);
231+ item->setCount(count);
232+ Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleCount);
233+ }
234+}
plugins/Unity/Launcher/launchermodel.h+5
@@ -48,11 +48,16 @@ public:
4848 Q_INVOKABLE void pin(const QString &appId, int index = -1);
4949 Q_INVOKABLE void requestRemove(const QString &appId);
5050 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
51+ Q_INVOKABLE void setUser(const QString &username);
5152
5253private:
5354 void storeAppList();
5455 int findApplication(const QString &appId);
5556
57+private Q_SLOTS:
58+ void progressChanged(const QString &appId, int progress);
59+ void countChanged(const QString &appId, int count);
60+
5661private:
5762 QList<LauncherItem*> m_list;
5863 LauncherBackend *m_backend;
plugins/Unity/categories.cpp+6
@@ -39,6 +39,7 @@ Categories::Categories(QObject* parent)
3939 m_roles[Categories::RoleIcon] = "icon";
4040 m_roles[Categories::RoleRenderer] = "renderer";
4141 m_roles[Categories::RoleContentType] = "contentType";
42+ m_roles[Categories::RoleProgressSource] = "progressSource";
4243 m_roles[Categories::RoleHints] = "hints";
4344 m_roles[Categories::RoleResults] = "results";
4445 m_roles[Categories::RoleCount] = "count";
@@ -198,6 +199,11 @@ Categories::data(const QModelIndex& index, int role) const
198199 auto hints = DeeListModel::data(index, CategoryColumn::HINTS).toHash();
199200 return hints.contains("content-type") ? hints["content-type"] : QVariant(QString("default"));
200201 }
202+ case RoleProgressSource:
203+ {
204+ auto hints = DeeListModel::data(index, CategoryColumn::HINTS).toHash();
205+ return hints.contains("progress-source") ? hints["progress-source"] : QVariant();
206+ }
201207 case RoleHints:
202208 return DeeListModel::data(index, CategoryColumn::HINTS);
203209 case RoleResults:
plugins/Unity/categories.h+1
@@ -47,6 +47,7 @@ public:
4747 RoleIcon,
4848 RoleRenderer,
4949 RoleContentType,
50+ RoleProgressSource,
5051 RoleHints,
5152 RoleResults,
5253 RoleCount,
plugins/Unity/genericoptionsmodel.cpp+2−2
@@ -76,9 +76,9 @@ int GenericOptionsModel::rowCount(const QModelIndex& /* parent */) const
7676 return m_options.size ();
7777}
7878
79−void GenericOptionsModel::setActive(QVector<AbstractFilterOption *>::size_type idx, bool value)
79+void GenericOptionsModel::setActive(int idx, bool value)
8080{
81− if (idx < m_options.size())
81+ if (idx >= 0 && idx < m_options.size())
8282 {
8383 m_options[idx]->setActive(value);
8484 }
plugins/Unity/genericoptionsmodel.h+1−1
@@ -49,7 +49,7 @@ public:
4949 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
5050 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
5151
52− Q_INVOKABLE void setActive(QVector<AbstractFilterOption *>::size_type idx, bool value);
52+ Q_INVOKABLE void setActive(int idx, bool value);
5353 Q_INVOKABLE void setActive(const QString &id, bool value);
5454
5555 AbstractFilterOption* getRawOption(QVector<AbstractFilterOption *>::size_type idx) const;
plugins/Unity/plugin.cpp+2
@@ -33,6 +33,7 @@
3333#include "categories.h"
3434#include "categoryresults.h"
3535#include "bottombarvisibilitycommunicatorshell.h"
36+#include "genericoptionsmodel.h"
3637
3738// libqtdee
3839#include "deelistmodel.h"
@@ -47,6 +48,7 @@ void UnityPlugin::registerTypes(const char *uri)
4748 qmlRegisterUncreatableType<PreviewAction>(uri, 0, 1, "PreviewAction", "Can't create PreviewAction object in QML.");
4849 qmlRegisterUncreatableType<PreviewInfoHint>(uri, 0, 1, "PreviewInfoHint", "Can't create PreviewInfoHint object in QML.");
4950 qmlRegisterUncreatableType<SocialPreviewComment>(uri, 0, 1, "SocialPreviewComment", "Can't create SocialPreviewComment object in QML.");
51+ qmlRegisterUncreatableType<GenericOptionsModel>(uri, 0, 1, "GenericOptionsModel", "Can't create options model in QML.");
5052 qmlRegisterType<Scope>(uri, 0, 1, "Scope");
5153 qmlRegisterType<Scopes>(uri, 0, 1, "Scopes");
5254 qmlRegisterType<Categories>(uri, 0, 1, "Categories");
po/ar.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n % 100 >= "
1818"3 && n % 100 <= 10 ? 3 : n % 100 >= 11 && n % 100 <= 99 ? 4 : 5;\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/az.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/bg.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Type: text/plain; charset=UTF-8\n"
1717"Content-Transfer-Encoding: 8bit\n"
1818"Plural-Forms: nplurals=2; plural=n != 1;\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/ca.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/de.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/el.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/en_AU.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:26+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/en_GB.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:26+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/eo.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/es.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/fi.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/fo.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/fr.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n > 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/gl.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/he.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/hr.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
1818"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/hu.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/hy.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/id.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/it.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/ja.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/kn.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/ko.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/ky.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/lv.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/my.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/nb.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/nl.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/pl.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
1818"|| n%100>=20) ? 1 : 2;\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/pt_BR.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n > 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:26+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/ro.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=3; plural=(n == 1 ? 0: (((n % 100 > 19) || ((n % 100 "
1818"== 0) && (n != 0))) ? 2: 1));\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/ru.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
1818"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/si.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/sl.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
1818"n%100==4 ? 3 : 0);\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/sr.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
1818"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/sv.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/te.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/tr.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/ug.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:25+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/uk.po+2−2
@@ -16,8 +16,8 @@ msgstr ""
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
1818"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
19−"X-Launchpad-Export-Date: 2013-08-14 06:26+0000\n"
20−"X-Generator: Launchpad (build 16723)\n"
19+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
20+"X-Generator: Launchpad (build 16734)\n"
2121
2222#: Applications/applications.js:23
2323msgid "Phone"
po/zh_CN.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:26+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
po/zh_TW.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-08-14 06:26+0000\n"
19−"X-Generator: Launchpad (build 16723)\n"
18+"X-Launchpad-Export-Date: 2013-08-22 06:11+0000\n"
19+"X-Generator: Launchpad (build 16734)\n"
2020
2121#: Applications/applications.js:23
2222msgid "Phone"
tests/mocks/Powerd/Powerd.h+15−2
@@ -20,17 +20,30 @@
2020#define UNITY_MOCK_POWERD_H
2121
2222#include <QtCore/QObject>
23−#include <QtDBus/QDBusInterface>
2423
2524class Powerd: public QObject
2625{
2726 Q_OBJECT
27+ Q_ENUMS(Status)
28+ Q_FLAGS(DisplayFlag DisplayFlags)
2829
2930public:
31+ enum DisplayFlag {
32+ UseProximity = 1, // Use proximity sensor to override screen state
33+ DisableAutoBrightness = 2, // Force autobrightness to be disabled
34+ Bright = 4, // Request the screen to stay bright
35+ };
36+ Q_DECLARE_FLAGS(DisplayFlags, DisplayFlag)
37+
38+ enum Status {
39+ Off,
40+ On,
41+ };
42+
3043 explicit Powerd(QObject *parent = 0);
3144
3245Q_SIGNALS:
33− void powerStateChange(int state);
46+ void displayPowerStateChange(int status, unsigned int flags);
3447};
3548
3649#endif
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+6
@@ -174,3 +174,9 @@ int MockLauncherModel::findApp(const QString &appId)
174174 }
175175 return -1;
176176}
177+
178+void MockLauncherModel::setUser(const QString &username)
179+{
180+ Q_UNUSED(username)
181+ // TODO: implement this...
182+}
tests/mocks/Unity/Launcher/MockLauncherModel.h+1
@@ -43,6 +43,7 @@ public:
4343 Q_INVOKABLE void pin(const QString &appId, int index = -1);
4444 Q_INVOKABLE void requestRemove(const QString &appId);
4545 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
46+ Q_INVOKABLE void setUser(const QString &username);
4647
4748Q_SIGNALS:
4849 void quickListTriggered(const QString &appId, int index);
tests/qmltests/Launcher/tst_Launcher.qml+33−13
@@ -277,8 +277,9 @@ Item {
277277
278278 function test_dragndrop_data() {
279279 return [
280− {tag: "startDrag", fullDrag: false},
281− {tag: "fullDrag", fullDrag: true},
280+ {tag: "startDrag", fullDrag: false },
281+ {tag: "fullDrag horizontal", fullDrag: true, orientation: ListView.Horizontal },
282+ {tag: "fullDrag vertical", fullDrag: true, orientation: ListView.Vertical },
282283 ];
283284 }
284285
@@ -288,8 +289,8 @@ Item {
288289 var item0 = findChild(launcher, "launcherDelegate0")
289290 var fakeDragItem = findChild(launcher, "fakeDragItem")
290291 var initialItemHeight = draggedItem.height
291− var item5Name = LauncherModel.get(5).iconName
292− var item4Name = LauncherModel.get(4).iconName
292+ var item5 = LauncherModel.get(5).appId
293+ var item4 = LauncherModel.get(4).appId
293294
294295 // Initial state
295296 compare(draggedItem.itemOpacity, 1, "Item's opacity is not 1 at beginning")
@@ -297,28 +298,43 @@ Item {
297298 tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 0)
298299
299300 // Doing longpress
300− mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
301+ var currentMouseX = draggedItem.width / 2
302+ var currentMouseY = draggedItem.height / 2
303+ mousePress(draggedItem, currentMouseX, currentMouseY)
301304 // DraggedItem needs to hide and fakeDragItem become visible
302305 tryCompare(draggedItem, "itemOpacity", 0)
303306 tryCompare(fakeDragItem, "visible", true)
304307
305308 // Dragging a bit (> 1.5 gu)
306− mouseMove(draggedItem, -units.gu(2), draggedItem.height / 2)
309+ currentMouseX -= units.gu(2)
310+ mouseMove(draggedItem, currentMouseX, currentMouseY)
307311 // Other items need to expand and become 0.6 opaque
308312 tryCompare(item0, "angle", 0)
309313 tryCompare(item0, "itemOpacity", 0.6)
310314
311315 if (data.fullDrag) {
312316 // Dragging a bit more
313− mouseMove(draggedItem, -units.gu(15), draggedItem.height / 2, 100)
314− tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 1)
315− tryCompare(draggedItem, "height", units.gu(1))
317+ if (data.orientation == ListView.Horizontal) {
318+ currentMouseX -= units.gu(15)
319+ mouseMove(draggedItem, currentMouseX, currentMouseY, 100)
320+
321+ tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 1)
322+ tryCompare(draggedItem, "height", units.gu(1))
323+
324+ // Dragging downwards. Item needs to move in the model
325+ currentMouseY -= initialItemHeight * 1.5
326+ mouseMove(draggedItem, currentMouseX, currentMouseY)
327+ } else if (data.orientation == ListView.Vertical) {
328+ currentMouseY -= initialItemHeight * 1.5
329+ mouseMove(draggedItem, currentMouseX, currentMouseY, 100)
330+
331+ tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 1)
332+ tryCompare(draggedItem, "height", units.gu(1))
333+ }
316334
317− // Dragging downwards. Item needs to move in the model
318− mouseMove(draggedItem, -units.gu(15), -initialItemHeight)
319335 waitForRendering(draggedItem)
320− compare(LauncherModel.get(5).iconName, item4Name)
321− compare(LauncherModel.get(5).iconName, item5Name)
336+ compare(LauncherModel.get(5).appId, item4)
337+ compare(LauncherModel.get(4).appId, item5)
322338 }
323339
324340 // Releasing and checking if initial values are restored
@@ -326,6 +342,10 @@ Item {
326342 tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 0)
327343 tryCompare(draggedItem, "itemOpacity", 1)
328344 tryCompare(fakeDragItem, "visible", false)
345+
346+ // Click somewhere in the empty space to make it hide in case it isn't
347+ mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
348+ revealer.waitUntilLauncherDisappears();
329349 }
330350
331351 function test_quicklist_dismiss() {
tests/qmltests/tst_Shell.qml+7−3
@@ -125,13 +125,17 @@ Item {
125125 var mainApp = ApplicationManager.mainStageFocusedApplication;
126126 tryCompareFunction(function() { return mainApp != null; }, true);
127127
128− // Now suspend
129− Powerd.powerStateChange(0);
128+ // Try to suspend while proximity is engaged...
129+ Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
130+ tryCompare(greeter, "showProgress", 0);
131+
132+ // Now really suspend
133+ Powerd.displayPowerStateChange(Powerd.Off, 0);
130134 tryCompare(greeter, "showProgress", 1);
131135 tryCompare(ApplicationManager, "mainStageFocusedApplication", null);
132136
133137 // And wake up
134− Powerd.powerStateChange(1);
138+ Powerd.displayPowerStateChange(Powerd.On, 0);
135139 tryCompare(ApplicationManager, "mainStageFocusedApplication", mainApp);
136140 tryCompare(greeter, "showProgress", 1);
137141 }