on xenial help sign in
merge trunk
c8adabcMichael Zanetti
debian/changelog+27
@@ -1,3 +1,30 @@
1+unity8 (8.00+14.10.20141013.2-0ubuntu1) utopic; urgency=low
2+
3+ [ Michael Terry ]
4+ * Don't show initial lockscreen during the edge demo. The user just
5+ set up their phone with a password, it's pointless to ask them
6+ again. (LP: #1358283)
7+ * Distinguish between incoming calls and other dialer-app opens. (LP:
8+ #1378218) (LP: #1378218)
9+
10+ [ Andrea Cimitan ]
11+ * Fix flickable speed to be resolution independent, by subclassing
12+ components (LP: #1348557)
13+
14+ [ Michał Sawicz ]
15+ * Fix the ShellWithPin test and some functionality.
16+
17+ [ Albert Astals ]
18+ * Move Base.qml to DashCategoryBase
19+ * Fix first item positioning when m_clipItem->y() is not 0 (LP:
20+ #1251597)
21+ * Fix some small qml warnings
22+
23+ [ Daniel d'Andrada ]
24+ * Add touch ownership logic on top of qt input handling
25+
26+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 13 Oct 2014 15:43:03 +0000
27+
1unity8 (8.00+14.10.20141009.4-0ubuntu1) utopic; urgency=low
28unity8 (8.00+14.10.20141009.4-0ubuntu1) utopic; urgency=low
2
29
3 [ Michał Sawicz ]
30 [ Michał Sawicz ]
plugins/Dash/listviewwithpageheader.cpp+1−1
@@ -851,7 +851,7 @@ ListViewWithPageHeader::ListItem *ListViewWithPageHeader::createItem(int modelIn
851 if (nextItem) {
851 if (nextItem) {
852 listItem->setY(nextItem->y() - listItem->height());
852 listItem->setY(nextItem->y() - listItem->height());
853 } else if (modelIndex == 0) {
853 } else if (modelIndex == 0) {
854− listItem->setY(m_headerItem ? m_headerItem->height() : 0);
854+ listItem->setY(-m_clipItem->y() + (m_headerItem ? m_headerItem->height() : 0));
855 } else if (!m_visibleItems.isEmpty()) {
855 } else if (!m_visibleItems.isEmpty()) {
856 lostItem = true;
856 lostItem = true;
857 }
857 }
po/en_AU.po+16−22
@@ -8,14 +8,14 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2014-10-07 11:37+0300\n"
10"POT-Creation-Date: 2014-10-07 11:37+0300\n"
11−"PO-Revision-Date: 2014-09-23 01:24+0000\n"
11+"PO-Revision-Date: 2014-10-12 09:41+0000\n"
12"Last-Translator: Jared Norris <jarednorris@ubuntu.com>\n"
12"Last-Translator: Jared Norris <jarednorris@ubuntu.com>\n"
13"Language-Team: English (Australia) <en_AU@li.org>\n"
13"Language-Team: English (Australia) <en_AU@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2014-10-09 06:37+0000\n"
18+"X-Launchpad-Export-Date: 2014-10-13 06:15+0000\n"
19"X-Generator: Launchpad (build 17196)\n"
19"X-Generator: Launchpad (build 17196)\n"
20
20
21#: plugins/LightDM/Greeter.cpp:130
21#: plugins/LightDM/Greeter.cpp:130
@@ -33,22 +33,22 @@ msgstr "Unpin shortcut"
33
33
34#: qml/Components/DelayedLockscreen.qml:47
34#: qml/Components/DelayedLockscreen.qml:47
35msgid "Device Locked"
35msgid "Device Locked"
36−msgstr ""
36+msgstr "Device Locked"
37
37
38#: qml/Components/DelayedLockscreen.qml:62
38#: qml/Components/DelayedLockscreen.qml:62
39msgid "You have been locked out due to too many failed passphrase attempts."
39msgid "You have been locked out due to too many failed passphrase attempts."
40−msgstr ""
40+msgstr "You have been locked out due to too many failed passphrase attempts."
41
41
42#: qml/Components/DelayedLockscreen.qml:63
42#: qml/Components/DelayedLockscreen.qml:63
43msgid "You have been locked out due to too many failed passcode attempts."
43msgid "You have been locked out due to too many failed passcode attempts."
44−msgstr ""
44+msgstr "You have been locked out due to too many failed passcode attempts."
45
45
46#: qml/Components/DelayedLockscreen.qml:72
46#: qml/Components/DelayedLockscreen.qml:72
47#, qt-format
47#, qt-format
48msgid "Please wait %1 minute and then try again…"
48msgid "Please wait %1 minute and then try again…"
49msgid_plural "Please wait %1 minutes and then try again…"
49msgid_plural "Please wait %1 minutes and then try again…"
50−msgstr[0] ""
50+msgstr[0] "Please wait %1 minute and then try again…"
51−msgstr[1] ""
51+msgstr[1] "Please wait %1 minutes and then try again…"
52
52
53#: qml/Components/Dialogs.qml:70
53#: qml/Components/Dialogs.qml:70
54msgid "Log out"
54msgid "Log out"
@@ -211,15 +211,15 @@ msgstr "Send"
211
211
212#: qml/Dash/PullToRefreshScopeStyle.qml:55
212#: qml/Dash/PullToRefreshScopeStyle.qml:55
213msgid "Pull to refresh…"
213msgid "Pull to refresh…"
214−msgstr ""
214+msgstr "Pull to refresh…"
215
215
216#: qml/Dash/PullToRefreshScopeStyle.qml:60
216#: qml/Dash/PullToRefreshScopeStyle.qml:60
217msgid "Release to refresh…"
217msgid "Release to refresh…"
218−msgstr ""
218+msgstr "Release to refresh…"
219
219
220#: qml/Dash/ScopesOverview.qml:206
220#: qml/Dash/ScopesOverview.qml:206
221msgid "Manage Scopes"
221msgid "Manage Scopes"
222−msgstr ""
222+msgstr "Manage Scopes"
223
223
224#: qml/Dash/ScopesOverview.qml:428
224#: qml/Dash/ScopesOverview.qml:428
225msgid "Done"
225msgid "Done"
@@ -239,7 +239,7 @@ msgstr "All"
239
239
240#: qml/Greeter/Greeter.qml:157
240#: qml/Greeter/Greeter.qml:157
241msgid "Unlock"
241msgid "Unlock"
242−msgstr ""
242+msgstr "Unlock"
243
243
244#: qml/Hud/HudParametrizedActionsPage.qml:139
244#: qml/Hud/HudParametrizedActionsPage.qml:139
245msgid "Confirm"
245msgid "Confirm"
@@ -275,7 +275,7 @@ msgstr "Conference"
275
275
276#: qml/Panel/Indicators/MenuItemFactory.qml:600
276#: qml/Panel/Indicators/MenuItemFactory.qml:600
277msgid "Nothing is playing"
277msgid "Nothing is playing"
278−msgstr ""
278+msgstr "Nothing is playing"
279
279
280#: qml/Panel/Indicators/MenuItemFactory.qml:748
280#: qml/Panel/Indicators/MenuItemFactory.qml:748
281msgid "In queue…"
281msgid "In queue…"
@@ -311,7 +311,7 @@ msgstr "Roaming"
311
311
312#: qml/Shell.qml:346
312#: qml/Shell.qml:346
313msgid "Enter passphrase"
313msgid "Enter passphrase"
314−msgstr ""
314+msgstr "Enter passphrase"
315
315
316#: qml/Shell.qml:347
316#: qml/Shell.qml:347
317msgid "Sorry, incorrect passphrase"
317msgid "Sorry, incorrect passphrase"
@@ -319,11 +319,11 @@ msgstr "Sorry, incorrect passphrase"
319
319
320#: qml/Shell.qml:348
320#: qml/Shell.qml:348
321msgid "Please re-enter"
321msgid "Please re-enter"
322−msgstr ""
322+msgstr "Please re-enter"
323
323
324#: qml/Shell.qml:350
324#: qml/Shell.qml:350
325msgid "Enter passcode"
325msgid "Enter passcode"
326−msgstr ""
326+msgstr "Enter passcode"
327
327
328#: qml/Shell.qml:351
328#: qml/Shell.qml:351
329msgid "Sorry, incorrect passcode"
329msgid "Sorry, incorrect passcode"
@@ -332,7 +332,7 @@ msgstr "Sorry, incorrect passcode"
332#: qml/Shell.qml:354
332#: qml/Shell.qml:354
333#, qt-format
333#, qt-format
334msgid "Enter %1"
334msgid "Enter %1"
335−msgstr ""
335+msgstr "Enter %1"
336
336
337#: qml/Shell.qml:355
337#: qml/Shell.qml:355
338#, qt-format
338#, qt-format
@@ -366,9 +366,3 @@ msgid ""
366msgstr ""
366msgstr ""
367"If passcode is entered incorrectly, your phone will conduct a factory reset "
367"If passcode is entered incorrectly, your phone will conduct a factory reset "
368"and all personal data will be deleted."
368"and all personal data will be deleted."
369−
370−#~ msgid "Sorry, incorrect PIN"
371−#~ msgstr "Sorry, incorrect PIN"
372−
373−#~ msgid "Enter SIM PIN"
374−#~ msgstr "Enter SIM PIN"
po/fa.po+4−10
@@ -8,14 +8,14 @@ msgstr ""
8"Project-Id-Version: unity8\n"
8"Project-Id-Version: unity8\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2014-10-07 11:37+0300\n"
10"POT-Creation-Date: 2014-10-07 11:37+0300\n"
11−"PO-Revision-Date: 2014-10-02 23:07+0000\n"
11+"PO-Revision-Date: 2014-10-11 23:41+0000\n"
12"Last-Translator: Danial Behzadi <dani.behzi@gmail.com>\n"
12"Last-Translator: Danial Behzadi <dani.behzi@gmail.com>\n"
13"Language-Team: Persian <fa@li.org>\n"
13"Language-Team: Persian <fa@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=1; plural=0;\n"
17"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2014-10-09 06:36+0000\n"
18+"X-Launchpad-Export-Date: 2014-10-12 06:55+0000\n"
19"X-Generator: Launchpad (build 17196)\n"
19"X-Generator: Launchpad (build 17196)\n"
20
20
21#: plugins/LightDM/Greeter.cpp:130
21#: plugins/LightDM/Greeter.cpp:130
@@ -211,11 +211,11 @@ msgstr "ارسال"
211
211
212#: qml/Dash/PullToRefreshScopeStyle.qml:55
212#: qml/Dash/PullToRefreshScopeStyle.qml:55
213msgid "Pull to refresh…"
213msgid "Pull to refresh…"
214−msgstr ""
214+msgstr "برای تازه‌سازی بکشید…"
215
215
216#: qml/Dash/PullToRefreshScopeStyle.qml:60
216#: qml/Dash/PullToRefreshScopeStyle.qml:60
217msgid "Release to refresh…"
217msgid "Release to refresh…"
218−msgstr ""
218+msgstr "برای تازه‌سازی رها کنید…"
219
219
220#: qml/Dash/ScopesOverview.qml:206
220#: qml/Dash/ScopesOverview.qml:206
221msgid "Manage Scopes"
221msgid "Manage Scopes"
@@ -366,9 +366,3 @@ msgid ""
366msgstr ""
366msgstr ""
367"اگر رمزعبور نادرست وارد شود، تلفن شما بازنشانی کارخانه خواهد شد و تمامی "
367"اگر رمزعبور نادرست وارد شود، تلفن شما بازنشانی کارخانه خواهد شد و تمامی "
368"اطّلاعات شخصی حذف خواهند شد."
368"اطّلاعات شخصی حذف خواهند شد."
369−
370−#~ msgid "Sorry, incorrect PIN"
371−#~ msgstr "متأسّفیم، PIN نادرست بود"
372−
373−#~ msgid "Enter SIM PIN"
374−#~ msgstr "PIN سیم‌کارت را وارد کنید"
po/hu.po+3−9
@@ -8,14 +8,14 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2014-10-07 11:37+0300\n"
10"POT-Creation-Date: 2014-10-07 11:37+0300\n"
11−"PO-Revision-Date: 2014-10-08 08:13+0000\n"
11+"PO-Revision-Date: 2014-10-11 10:50+0000\n"
12"Last-Translator: Richard Somlói <ricsipontaz@gmail.com>\n"
12"Last-Translator: Richard Somlói <ricsipontaz@gmail.com>\n"
13"Language-Team: Hungarian <hu@li.org>\n"
13"Language-Team: Hungarian <hu@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2014-10-09 06:36+0000\n"
18+"X-Launchpad-Export-Date: 2014-10-12 06:55+0000\n"
19"X-Generator: Launchpad (build 17196)\n"
19"X-Generator: Launchpad (build 17196)\n"
20
20
21#: plugins/LightDM/Greeter.cpp:130
21#: plugins/LightDM/Greeter.cpp:130
@@ -321,7 +321,7 @@ msgstr "Sajnáljuk, helytelen jelmondat"
321
321
322#: qml/Shell.qml:348
322#: qml/Shell.qml:348
323msgid "Please re-enter"
323msgid "Please re-enter"
324−msgstr "Kérjük adja meg újra"
324+msgstr "Kérjük próbálja újra"
325
325
326#: qml/Shell.qml:350
326#: qml/Shell.qml:350
327msgid "Enter passcode"
327msgid "Enter passcode"
@@ -368,9 +368,3 @@ msgid ""
368msgstr ""
368msgstr ""
369"Ha helytelen jelkódot ad meg, a telefonja visszaállítja a gyári "
369"Ha helytelen jelkódot ad meg, a telefonja visszaállítja a gyári "
370"beállításokat és törli minden személyes adatát."
370"beállításokat és törli minden személyes adatát."
371−
372−#~ msgid "Sorry, incorrect PIN"
373−#~ msgstr "Sajnáljuk, helytelen PIN"
374−
375−#~ msgid "Enter SIM PIN"
376−#~ msgstr "Adja meg a SIM PIN kódját"
qml/Components/Carousel.qml+2−3
@@ -17,6 +17,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import "carousel.js" as CarouselJS
19import "carousel.js" as CarouselJS
20+import "Flickables" as Flickables
20
21
21/*! The Carousel component presents the items of a model in a carousel view. It's similar to a
22/*! The Carousel component presents the items of a model in a carousel view. It's similar to a
22 cover flow. But it stops at it's boundaries (therefore no PathView is used).
23 cover flow. But it stops at it's boundaries (therefore no PathView is used).
@@ -63,7 +64,7 @@ Item {
63 and footer item to compensate that.
64 and footer item to compensate that.
64
65
65 The scaling of the items is controlled by the variable continuousIndex, described below. */
66 The scaling of the items is controlled by the variable continuousIndex, described below. */
66− ListView {
67+ Flickables.ListView {
67 id: listView
68 id: listView
68 objectName: "listView"
69 objectName: "listView"
69
70
@@ -135,8 +136,6 @@ Item {
135
136
136 boundsBehavior: Flickable.DragOverBounds
137 boundsBehavior: Flickable.DragOverBounds
137 cacheBuffer: carousel.cacheBuffer
138 cacheBuffer: carousel.cacheBuffer
138− flickDeceleration: Math.max(1500 * Math.pow(realWidth / referenceWidth, 1.5), 1500) // 1500 is platform default
139− maximumFlickVelocity: Math.max(2500 * Math.pow(realWidth / referenceWidth, 1.5), 2500) // 2500 is platform default
140 orientation: ListView.Horizontal
139 orientation: ListView.Horizontal
141
140
142 function getXFromContinuousIndex(index) {
141 function getXFromContinuousIndex(index) {
qml/Components/Flickables/Flickable.qmlnew file+23
@@ -0,0 +1,23 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.3 as QtQuick
18+import Ubuntu.Components 1.1
19+
20+QtQuick.Flickable {
21+ flickDeceleration: 1500 * units.gridUnit / 8
22+ maximumFlickVelocity: 2500 * units.gridUnit / 8
23+}
qml/Components/Flickables/GridView.qmlnew file+25
@@ -0,0 +1,25 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.3 as QtQuick
18+import Ubuntu.Components 1.1
19+
20+QtQuick.GridView {
21+ // Attached components and usages like GridView.onRemove are known not to work
22+ // please use GridView directly from QtQuick if needed
23+ flickDeceleration: 1500 * units.gridUnit / 8
24+ maximumFlickVelocity: 2500 * units.gridUnit / 8
25+}
qml/Components/Flickables/ListView.qmlnew file+25
@@ -0,0 +1,25 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.3 as QtQuick
18+import Ubuntu.Components 1.1
19+
20+QtQuick.ListView {
21+ // Attached components and usages like ListView.onRemove are known not to work
22+ // please use ListView directly from QtQuick if needed
23+ flickDeceleration: 1500 * units.gridUnit / 8
24+ maximumFlickVelocity: 2500 * units.gridUnit / 8
25+}
qml/Components/Flickables/ListViewWithPageHeader.qmlnew file+23
@@ -0,0 +1,23 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import Dash 0.1
18+import Ubuntu.Components 1.1
19+
20+ListViewWithPageHeader {
21+ flickDeceleration: 1500 * units.gridUnit / 8
22+ maximumFlickVelocity: 2500 * units.gridUnit / 8
23+}
qml/Components/ListItems/Base.qmldeleted−116
@@ -1,116 +0,0 @@
1−/*
2− * Copyright (C) 2012 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−
20−Item {
21− id: emptyListItem
22− width: parent ? parent.width : units.gu(31)
23− height: body.height + bottomDividerLine.height
24−
25− /*!
26− \preliminary
27− Specifies whether the list item is selected.
28− */
29− property bool selected: false
30−
31− /*!
32− \preliminary
33− Set to show or hide the thin bottom divider line (drawn by the \l ThinDivider component).
34− This line is shown by default except in cases where this item is the delegate of a ListView.
35− */
36− property bool showDivider: __showDivider()
37−
38− /*!
39− \internal
40− Method to automatically determine if the bottom divider line should be drawn.
41− This always returns true, unless item is a delegate in a ListView. If in a ListView
42− it will return false only when:
43− + if this is the final item in the list, and ListView.footer is set (again as thin
44− divider line won't look well with footer below it)
45− */
46− function __showDivider() {
47− // if we're not in ListView, always show a thin dividing line at the bottom
48− var model = null;
49− if (typeof ListViewWithPageHeader !== 'undefined') {
50− if (typeof ListViewWithPageHeader.model !== 'undefined') {
51− model = ListViewWithPageHeader.model;
52− }
53− } else if (ListView.view !== null) {
54− model = ListView.view.model;
55− }
56− // if we're last item in ListView don't show divider
57− if (model && index === model.count - 1) return false;
58−
59− return true;
60− }
61−
62− /* Relevant really only for ListViewWithPageHeader case: specify how many pixels we can overlap with the section header */
63− readonly property int allowedOverlap: units.dp(1)
64−
65− property real __heightToClip: {
66− // Check this is in position where clipping is needed
67− if (typeof ListViewWithPageHeader !== 'undefined') {
68− if (typeof heightToClip !== 'undefined') {
69− if (heightToClip >= allowedOverlap) {
70− return heightToClip - allowedOverlap;
71− }
72− }
73− }
74− return 0;
75− }
76−
77− /*!
78− \internal
79− Reparent so that the visuals of the children does not
80− occlude the bottom divider line.
81− */
82− default property alias children: body.children
83−
84− Item {
85− id: clippingContainer
86− height: parent.height - __heightToClip
87− anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
88− clip: __heightToClip > 0
89−
90− Item {
91− id: body
92− anchors {
93− left: parent.left
94− right: parent.right
95− bottom: bottomDividerLine.top
96− }
97− height: childrenRect.height
98− }
99−
100− ThinDivider {
101− id: bottomDividerLine
102− anchors.bottom: parent.bottom
103− visible: showDivider
104− }
105−
106− Highlight {
107− anchors {
108− top: parent.top
109− left: parent.left
110− right: parent.right
111− bottom: bottomDividerLine.top
112− }
113− pressed: emptyListItem.selected
114− }
115− }
116−}
qml/Components/ListItems/Highlight.qmldeleted−46
@@ -1,46 +0,0 @@
1−/*
2− * Copyright (C) 2013 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−
19−Rectangle {
20− id: highlight
21−
22− property bool pressed: false
23− property real pressedOpacity: 0.3
24−
25− color: "black"
26− opacity: 0
27− state: pressed ? "pressed" : ""
28− states: [
29− State {
30− name: "pressed"
31− PropertyChanges { target: highlight; opacity: pressedOpacity}
32− }
33− ]
34− transitions: [
35− Transition {
36− from: ""
37− to: "pressed"
38− NumberAnimation { target: highlight; property: "opacity"; duration: 50}
39− },
40− Transition {
41− from: "pressed"
42− to: ""
43− NumberAnimation { target: highlight; property: "opacity"; duration: 100}
44− }
45− ]
46−}
qml/Components/ResponsiveGridView.qml+2−1
@@ -16,6 +16,7 @@
16
16
17import QtQuick 2.3
17import QtQuick 2.3
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import "Flickables" as Flickables
19
20
20/*
21/*
21 Essentially a GridView where you can specify the maximum number of columns it can have.
22 Essentially a GridView where you can specify the maximum number of columns it can have.
@@ -55,7 +56,7 @@ Item {
55 return rows * height
56 return rows * height
56 }
57 }
57
58
58− GridView {
59+ Flickables.GridView {
59 id: gridView
60 id: gridView
60 objectName: "responsiveGridViewGrid"
61 objectName: "responsiveGridViewGrid"
61 anchors {
62 anchors {
qml/Components/ZoomableImage.qml+2−2
@@ -16,7 +16,7 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19−import "../Components"
19+import "Flickables" as Flickables
20
20
21/*! \brief Zoomable for image.
21/*! \brief Zoomable for image.
22
22
@@ -32,7 +32,7 @@ Item {
32 property alias scaleTo: lazyImage.scaleTo
32 property alias scaleTo: lazyImage.scaleTo
33 property alias asynchronous: lazyImage.asynchronous
33 property alias asynchronous: lazyImage.asynchronous
34
34
35− Flickable {
35+ Flickables.Flickable {
36 id: flickable
36 id: flickable
37 objectName: "flickable"
37 objectName: "flickable"
38 clip: true
38 clip: true
qml/Dash/CardHorizontalList.qml+2−1
@@ -17,6 +17,7 @@
17import QtQuick 2.2
17import QtQuick 2.2
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19import "../Components"
19import "../Components"
20+import "../Components/Flickables" as Flickables
20
21
21DashRenderer {
22DashRenderer {
22 id: root
23 id: root
@@ -25,7 +26,7 @@ DashRenderer {
25 collapsedHeight: expandedHeight
26 collapsedHeight: expandedHeight
26 clip: true
27 clip: true
27
28
28− ListView {
29+ Flickables.ListView {
29 id: listView
30 id: listView
30 anchors {
31 anchors {
31 fill: parent
32 fill: parent
qml/Dash/DashCategoryBase.qmlnew file+62
@@ -0,0 +1,62 @@
1+/*
2+ * Copyright (C) 2012-2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+
20+Item {
21+ width: parent.width
22+ height: body.height
23+
24+ /* Relevant really only for ListViewWithPageHeader case: specify how many pixels we can overlap with the section header */
25+ readonly property int allowedOverlap: units.dp(1)
26+
27+ property real __heightToClip: {
28+ // Check this is in position where clipping is needed
29+ if (typeof ListViewWithPageHeader !== 'undefined') {
30+ if (typeof heightToClip !== 'undefined') {
31+ if (heightToClip >= allowedOverlap) {
32+ return heightToClip - allowedOverlap;
33+ }
34+ }
35+ }
36+ return 0;
37+ }
38+
39+ /*!
40+ \internal
41+ Reparent so that the visuals of the children does not
42+ occlude the bottom divider line.
43+ */
44+ default property alias children: body.children
45+
46+ Item {
47+ id: clippingContainer
48+ height: parent.height - __heightToClip
49+ anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
50+ clip: __heightToClip > 0
51+
52+ Item {
53+ id: body
54+ anchors {
55+ left: parent.left
56+ right: parent.right
57+ bottom: parent.bottom
58+ }
59+ height: childrenRect.height
60+ }
61+ }
62+}
qml/Dash/DashContent.qml+2−3
@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
19import Unity 0.2
19import Unity 0.2
20import Utils 0.1
20import Utils 0.1
21import "../Components"
21import "../Components"
22+import "../Components/Flickables" as Flickables
22
23
23Item {
24Item {
24 id: dashContent
25 id: dashContent
@@ -98,7 +99,7 @@ Item {
98 anchors.fill: parent
99 anchors.fill: parent
99 }
100 }
100
101
101− ListView {
102+ Flickables.ListView {
102 id: dashContentList
103 id: dashContentList
103 objectName: "dashContentList"
104 objectName: "dashContentList"
104
105
@@ -107,8 +108,6 @@ Item {
107 anchors.fill: parent
108 anchors.fill: parent
108 orientation: ListView.Horizontal
109 orientation: ListView.Horizontal
109 boundsBehavior: Flickable.DragAndOvershootBounds
110 boundsBehavior: Flickable.DragAndOvershootBounds
110− flickDeceleration: units.gu(625)
111− maximumFlickVelocity: width * 5
112 snapMode: ListView.SnapOneItem
111 snapMode: ListView.SnapOneItem
113 highlightMoveDuration: 250
112 highlightMoveDuration: 250
114 highlightRangeMode: ListView.StrictlyEnforceRange
113 highlightRangeMode: ListView.StrictlyEnforceRange
qml/Dash/DashNavigationButton.qml+2−1
@@ -16,6 +16,7 @@
16
16
17import QtQuick 2.2
17import QtQuick 2.2
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19+import "../Components/Flickables" as Flickables
19
20
20AbstractButton {
21AbstractButton {
21 id: root
22 id: root
@@ -75,7 +76,7 @@ AbstractButton {
75 }
76 }
76
77
77 // navigationListView is outside root
78 // navigationListView is outside root
78− ListView {
79+ Flickables.ListView {
79 id: navigationListView
80 id: navigationListView
80 objectName: "navigationListView"
81 objectName: "navigationListView"
81 visible: height > 0
82 visible: height > 0
qml/Dash/DashNavigationList.qml+2−1
@@ -17,6 +17,7 @@
17import QtQuick 2.2
17import QtQuick 2.2
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19import "../Components"
19import "../Components"
20+import "../Components/Flickables" as Flickables
20
21
21Item {
22Item {
22 id: root
23 id: root
@@ -45,7 +46,7 @@ Item {
45 }
46 }
46 }
47 }
47
48
48− Flickable {
49+ Flickables.Flickable {
49 id: flickable
50 id: flickable
50
51
51 anchors.fill: parent
52 anchors.fill: parent
qml/Dash/GenericScopeView.qml+5−2
@@ -212,10 +212,13 @@ FocusScope {
212 }
212 }
213 }
213 }
214
214
215− delegate: ListItems.Base {
215+ delegate: DashCategoryBase {
216 id: baseItem
216 id: baseItem
217 objectName: "dashCategory" + category
217 objectName: "dashCategory" + category
218+<<<<<<< TREE
218 showDivider: false
219 showDivider: false
220+=======
221+>>>>>>> MERGE-SOURCE
219
222
220 property Item seeAllButton: seeAll
223 property Item seeAllButton: seeAll
221
224
@@ -238,7 +241,7 @@ FocusScope {
238 CardTool {
241 CardTool {
239 id: cardTool
242 id: cardTool
240 objectName: "cardTool"
243 objectName: "cardTool"
241− count: results.count
244+ count: results ? results.count : 0
242 template: model.renderer
245 template: model.renderer
243 components: model.components
246 components: model.components
244 viewWidth: parent.width
247 viewWidth: parent.width
qml/Dash/PageHeader.qml+2−1
@@ -21,6 +21,7 @@ import Ubuntu.Components.Popups 1.0
21import Ubuntu.Components.ListItems 1.0
21import Ubuntu.Components.ListItems 1.0
22import "../Components"
22import "../Components"
23import "../Components/SearchHistoryModel"
23import "../Components/SearchHistoryModel"
24+import "../Components/Flickables" as Flickables
24
25
25Item {
26Item {
26 id: root
27 id: root
@@ -127,7 +128,7 @@ Item {
127 }
128 }
128 }
129 }
129
130
130− Flickable {
131+ Flickables.Flickable {
131 id: headerContainer
132 id: headerContainer
132 objectName: "headerContainer"
133 objectName: "headerContainer"
133 clip: contentY < height
134 clip: contentY < height
qml/Dash/PreviewListView.qml+2−3
@@ -18,6 +18,7 @@ import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Unity 0.2
19import Unity 0.2
20import "../Components"
20import "../Components"
21+import "../Components/Flickables" as Flickables
21import "Previews" as Previews
22import "Previews" as Previews
22
23
23Item {
24Item {
@@ -52,7 +53,7 @@ Item {
52 onBackClicked: root.backClicked()
53 onBackClicked: root.backClicked()
53 }
54 }
54
55
55− ListView {
56+ Flickables.ListView {
56 id: previewListView
57 id: previewListView
57 objectName: "listView"
58 objectName: "listView"
58 anchors {
59 anchors {
@@ -66,8 +67,6 @@ Item {
66 snapMode: ListView.SnapOneItem
67 snapMode: ListView.SnapOneItem
67 boundsBehavior: Flickable.DragAndOvershootBounds
68 boundsBehavior: Flickable.DragAndOvershootBounds
68 highlightMoveDuration: 250
69 highlightMoveDuration: 250
69− flickDeceleration: units.gu(625)
70− maximumFlickVelocity: width * 5
71 cacheBuffer: 0
70 cacheBuffer: 0
72
71
73 property bool open: false
72 property bool open: false
qml/Dash/Previews/Preview.qml+2−1
@@ -16,6 +16,7 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import "../../Components/Flickables" as Flickables
19
20
20/*! \brief This component constructs the Preview UI.
21/*! \brief This component constructs the Preview UI.
21 *
22 *
@@ -63,7 +64,7 @@ Item {
63 Repeater {
64 Repeater {
64 model: previewModel
65 model: previewModel
65
66
66− delegate: ListView {
67+ delegate: Flickables.ListView {
67 id: column
68 id: column
68 anchors { top: parent.top; bottom: parent.bottom }
69 anchors { top: parent.top; bottom: parent.bottom }
69 width: row.columnWidth
70 width: row.columnWidth
qml/Dash/Previews/PreviewImageGallery.qml+3−2
@@ -17,6 +17,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19import "../../Components"
19import "../../Components"
20+import "../../Components/Flickables" as Flickables
20
21
21/*! This preview widget shows a horizontal list of images.
22/*! This preview widget shows a horizontal list of images.
22 * The URIs for the images should be an array in widgetData["sources"].
23 * The URIs for the images should be an array in widgetData["sources"].
@@ -28,7 +29,7 @@ PreviewWidget {
28
29
29 property Item rootItem: QuickUtils.rootItem(root)
30 property Item rootItem: QuickUtils.rootItem(root)
30
31
31− ListView {
32+ Flickables.ListView {
32 id: previewImageListView
33 id: previewImageListView
33 objectName: "previewImageListView"
34 objectName: "previewImageListView"
34 spacing: units.gu(1)
35 spacing: units.gu(1)
@@ -102,7 +103,7 @@ PreviewWidget {
102 UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
103 UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
103 }
104 }
104
105
105− ListView {
106+ Flickables.ListView {
106 id: slideShowListView
107 id: slideShowListView
107 objectName: "slideShowListView"
108 objectName: "slideShowListView"
108 anchors.fill: parent
109 anchors.fill: parent
qml/Dash/Previews/PreviewTextSummary.qml+1−1
@@ -63,7 +63,7 @@ PreviewWidget {
63 lineHeight: 1.2
63 lineHeight: 1.2
64 color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
64 color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
65 opacity: .8
65 opacity: .8
66− text: widgetData["text"]
66+ text: widgetData["text"] || ""
67 wrapMode: Text.Wrap
67 wrapMode: Text.Wrap
68
68
69 Behavior on height {
69 Behavior on height {
qml/Dash/ScopeListView.qml+3−6
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2014 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -14,11 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17−import QtQuick 2.0
17+import "../Components/Flickables" as Flickables
18−import Dash 0.1
19
18
20−ListViewWithPageHeader {
19+Flickables.ListViewWithPageHeader {
21− maximumFlickVelocity: height * 10
22− flickDeceleration: height * 2
23 cacheBuffer: Number.MAX_VALUE
20 cacheBuffer: Number.MAX_VALUE
24}
21}
qml/Dash/ScopeSettingsPage.qml+2−1
@@ -18,6 +18,7 @@ import QtQuick 2.2
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19import Unity 0.2
19import Unity 0.2
20import "../Components"
20import "../Components"
21+import "../Components/Flickables" as Flickables
21import "ScopeSettings"
22import "ScopeSettings"
22
23
23Item {
24Item {
@@ -39,7 +40,7 @@ Item {
39 onBackClicked: root.backClicked()
40 onBackClicked: root.backClicked()
40 }
41 }
41
42
42− ListView {
43+ Flickables.ListView {
43 id: scopeSettings
44 id: scopeSettings
44 objectName: "scopeSettings"
45 objectName: "scopeSettings"
45 anchors {
46 anchors {
qml/Dash/ScopesOverviewAll.qml+2−1
@@ -16,8 +16,9 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import "../Components/Flickables" as Flickables
19
20
20−Flickable {
21+Flickables.Flickable {
21 id: root
22 id: root
22
23
23 property alias model: cardGrid.model
24 property alias model: cardGrid.model
qml/Dash/ScopesOverviewFavorites.qml+4−2
@@ -14,9 +14,11 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17−import QtQuick 2.0
17+import QtQuick 2.3
18+import Ubuntu.Components 1.1
19+import "../Components/Flickables" as Flickables
18
20
19−Flickable {
21+Flickables.Flickable {
20 id: root
22 id: root
21
23
22 signal clicked(int index, var result, var itemModel)
24 signal clicked(int index, var result, var itemModel)
qml/Greeter/LoginList.qml+2−2
@@ -18,6 +18,7 @@ import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import LightDM 0.1 as LightDM
19import LightDM 0.1 as LightDM
20import "../Components"
20import "../Components"
21+import "../Components/Flickables" as Flickables
21
22
22Item {
23Item {
23 id: root
24 id: root
@@ -68,7 +69,7 @@ Item {
68 antialiasing: true
69 antialiasing: true
69 }
70 }
70
71
71− ListView {
72+ Flickables.ListView {
72 id: userList
73 id: userList
73 objectName: "userList"
74 objectName: "userList"
74
75
@@ -78,7 +79,6 @@ Item {
78 preferredHighlightEnd: userList.height / 2 - root.highlightedHeight / 2
79 preferredHighlightEnd: userList.height / 2 - root.highlightedHeight / 2
79 highlightRangeMode: ListView.StrictlyEnforceRange
80 highlightRangeMode: ListView.StrictlyEnforceRange
80 highlightMoveDuration: root.moveDuration
81 highlightMoveDuration: root.moveDuration
81− flickDeceleration: 10000
82
82
83 readonly property bool movingInternally: moveTimer.running || userList.moving
83 readonly property bool movingInternally: moveTimer.running || userList.moving
84
84
qml/Hud/Hud.qml+2−1
@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
19import HudClient 0.1
19import HudClient 0.1
20
20
21import "../Components"
21import "../Components"
22+import "../Components/Flickables" as Flickables
22
23
23Item {
24Item {
24 id: hud
25 id: hud
@@ -400,7 +401,7 @@ Item {
400 }
401 }
401 progress: MathUtils.clamp((y - hudShowable.y + height - units.gu(8))/elementsYSliding, 0, 1)
402 progress: MathUtils.clamp((y - hudShowable.y + height - units.gu(8))/elementsYSliding, 0, 1)
402
403
403− Flickable {
404+ Flickables.Flickable {
404 anchors.left: parent.left
405 anchors.left: parent.left
405 anchors.right: parent.right
406 anchors.right: parent.right
406 contentHeight: resultList.height
407 contentHeight: resultList.height
qml/Hud/HudParametrizedActionsPage.qml+2−1
@@ -18,6 +18,7 @@ import QtQuick 2.0
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19import Ubuntu.Components.Themes.Ambiance 1.1
19import Ubuntu.Components.Themes.Ambiance 1.1
20import "../Components"
20import "../Components"
21+import "../Components/Flickables" as Flickables
21
22
22Item {
23Item {
23 property alias header: header.title
24 property alias header: header.title
@@ -74,7 +75,7 @@ Item {
74 return values
75 return values
75 }
76 }
76
77
77− Flickable {
78+ Flickables.Flickable {
78 anchors.top: parent.top
79 anchors.top: parent.top
79 anchors.bottom: buttons.top
80 anchors.bottom: buttons.top
80 anchors.left: parent.left
81 anchors.left: parent.left
qml/Launcher/LauncherPanel.qml+2−1
@@ -21,6 +21,7 @@ import Unity.Launcher 0.1
21import Ubuntu.Components.Popups 0.1
21import Ubuntu.Components.Popups 0.1
22import "../Components/ListItems"
22import "../Components/ListItems"
23import "../Components/"
23import "../Components/"
24+import "../Components/Flickables" as Flickables
24
25
25Rectangle {
26Rectangle {
26 id: root
27 id: root
@@ -75,7 +76,7 @@ Rectangle {
75 anchors.fill: parent
76 anchors.fill: parent
76 clip: true
77 clip: true
77
78
78− ListView {
79+ Flickables.ListView {
79 id: launcherListView
80 id: launcherListView
80 objectName: "launcherListView"
81 objectName: "launcherListView"
81 anchors {
82 anchors {
qml/Notifications/Notification.qml+2−1
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.1
20import Unity.Notifications 1.0
20import Unity.Notifications 1.0
21import QMenuModel 0.1
21import QMenuModel 0.1
22import Utils 0.1
22import Utils 0.1
23+import "../Components/Flickables" as Flickables
23
24
24import Ubuntu.Components.ListItems 0.1 as ListItem
25import Ubuntu.Components.ListItems 0.1 as ListItem
25
26
@@ -455,7 +456,7 @@ Item {
455 onClicked: notification.notification.invokeAction(comboRepeater.itemAt(2).actionId)
456 onClicked: notification.notification.invokeAction(comboRepeater.itemAt(2).actionId)
456 expanded: false
457 expanded: false
457 expandedHeight: (comboRepeater.count - 2) * units.gu(4) + units.gu(.5)
458 expandedHeight: (comboRepeater.count - 2) * units.gu(4) + units.gu(.5)
458− comboList: Flickable {
459+ comboList: Flickables.Flickable {
459 // this has to be wrapped inside a flickable
460 // this has to be wrapped inside a flickable
460 // to work around a feature/bug? of the
461 // to work around a feature/bug? of the
461 // ComboButton SDK-element, making a regular
462 // ComboButton SDK-element, making a regular
qml/Notifications/Notifications.qml+2−1
@@ -19,8 +19,9 @@ import Ubuntu.Components 0.1
19import Unity.Notifications 1.0 as UnityNotifications
19import Unity.Notifications 1.0 as UnityNotifications
20import Utils 0.1
20import Utils 0.1
21import "../Components"
21import "../Components"
22+import "../Components/Flickables" as Flickables
22
23
23−ListView {
24+Flickables.ListView {
24 id: notificationList
25 id: notificationList
25
26
26 objectName: "notificationList"
27 objectName: "notificationList"
qml/Panel/IndicatorRow.qml+2−1
@@ -18,6 +18,7 @@ import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Unity.Indicators 0.1 as Indicators
19import Unity.Indicators 0.1 as Indicators
20import "../Components"
20import "../Components"
21+import "../Components/Flickables" as Flickables
21
22
22Item {
23Item {
23 id: indicatorRow
24 id: indicatorRow
@@ -60,7 +61,7 @@ Item {
60 }
61 }
61 }
62 }
62
63
63− ListView {
64+ Flickables.ListView {
64 id: itemView
65 id: itemView
65 objectName: "indicatorRowItems"
66 objectName: "indicatorRowItems"
66 interactive: false
67 interactive: false
qml/Panel/Indicators/DefaultIndicatorPage.qml+2−1
@@ -21,6 +21,7 @@
21import QtQuick 2.0
21import QtQuick 2.0
22import Ubuntu.Components 0.1 as Components
22import Ubuntu.Components 0.1 as Components
23import Unity.Indicators 0.1 as Indicators
23import Unity.Indicators 0.1 as Indicators
24+import "../../Components/Flickables" as Flickables
24
25
25IndicatorBase {
26IndicatorBase {
26 id: main
27 id: main
@@ -65,7 +66,7 @@ IndicatorBase {
65 }
66 }
66 }
67 }
67
68
68− ListView {
69+ Flickables.ListView {
69 id: mainMenu
70 id: mainMenu
70 objectName: "mainMenu"
71 objectName: "mainMenu"
71 model: menuStack.rootMenu
72 model: menuStack.rootMenu
qml/Panel/Indicators/client/IndicatorsList.qml+2−1
@@ -22,6 +22,7 @@ import Ubuntu.Components 0.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.Components.ListItems 0.1 as ListItem
23import Unity.Indicators 0.1 as Indicators
23import Unity.Indicators 0.1 as Indicators
24import "../.."
24import "../.."
25+import "../../../Components/Flickables" as Flickables
25
26
26Page {
27Page {
27 id: page
28 id: page
@@ -35,7 +36,7 @@ Page {
35 Component.onCompleted: load(profile)
36 Component.onCompleted: load(profile)
36 }
37 }
37
38
38− ListView {
39+ Flickables.ListView {
39 id: mainMenu
40 id: mainMenu
40 objectName: "mainMenu"
41 objectName: "mainMenu"
41 anchors.fill: parent
42 anchors.fill: parent
qml/Panel/Indicators/client/IndicatorsTree.qml+2−1
@@ -22,6 +22,7 @@ import Ubuntu.Components 0.1
22import Unity.Indicators 0.1 as Indicators
22import Unity.Indicators 0.1 as Indicators
23import QMenuModel 0.1
23import QMenuModel 0.1
24import Ubuntu.Components.ListItems 0.1 as ListItem
24import Ubuntu.Components.ListItems 0.1 as ListItem
25+import "../../../Components/Flickables" as Flickables
25
26
26Page {
27Page {
27 id: page
28 id: page
@@ -52,7 +53,7 @@ Page {
52 model: unityModel
53 model: unityModel
53 }
54 }
54
55
55− Flickable {
56+ Flickables.Flickable {
56 anchors.fill: parent
57 anchors.fill: parent
57 contentHeight: all_data.height
58 contentHeight: all_data.height
58 clip:true
59 clip:true
qml/Panel/MenuContent.qml+3−2
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.1
20import Unity.Indicators 0.1 as Indicators
20import Unity.Indicators 0.1 as Indicators
21import Utils 0.1
21import Utils 0.1
22import "../Components"
22import "../Components"
23+import "../Components/Flickables" as Flickables
23import "Indicators"
24import "Indicators"
24
25
25Rectangle {
26Rectangle {
@@ -39,7 +40,7 @@ Rectangle {
39 listViewHeader.currentIndex = index;
40 listViewHeader.currentIndex = index;
40 }
41 }
41
42
42− ListView {
43+ Flickables.ListView {
43 id: listViewHeader
44 id: listViewHeader
44 objectName: "indicatorsHeaderListView"
45 objectName: "indicatorsHeaderListView"
45 model: content.indicatorsModel
46 model: content.indicatorsModel
@@ -80,7 +81,7 @@ Rectangle {
80 }
81 }
81 }
82 }
82
83
83− ListView {
84+ Flickables.ListView {
84 id: listViewContent
85 id: listViewContent
85 objectName: "indicatorsContentListView"
86 objectName: "indicatorsContentListView"
86 anchors {
87 anchors {
qml/Shell.qml+55−21
@@ -53,7 +53,9 @@ Item {
53 property url background
53 property url background
54 readonly property real panelHeight: panel.panelHeight
54 readonly property real panelHeight: panel.panelHeight
55
55
56− readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated
56+ readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
57+ readonly property bool forcedUnlock: edgeDemo.running
58+ onForcedUnlockChanged: if (forcedUnlock) lockscreen.hide()
57
59
58 property bool sideStageEnabled: shell.width >= units.gu(100)
60 property bool sideStageEnabled: shell.width >= units.gu(100)
59 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
61 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
@@ -87,11 +89,13 @@ Item {
87 }
89 }
88 }
90 }
89
91
90− function setLockedApp(app) {
92+ function startLockedApp(app) {
91− if (shell.locked) {
93+ if (!shell.locked) {
92− greeter.lockedApp = app
94+ console.warn("Called startLockedApp(%1) when not locked, ignoring".arg(app))
93− lockscreen.hide()
95+ return
94 }
96 }
97+ greeter.lockedApp = app
98+ shell.activateApplication(app)
95 }
99 }
96
100
97 Binding {
101 Binding {
@@ -170,12 +174,18 @@ Item {
170 target: ApplicationManager
174 target: ApplicationManager
171 onFocusRequested: {
175 onFocusRequested: {
172 if (greeter.narrowMode) {
176 if (greeter.narrowMode) {
173− if (appId === "dialer-app") {
177+ if (appId === "dialer-app" && callManager.hasCalls) {
174− // Always let the dialer-app through. Either user asked
178+ // If we are in the middle of a call, make dialer lockedApp and show it.
175− // for an emergency call or accepted an incoming call.
179+ // This can happen if user backs out of dialer back to greeter, then
176− setLockedApp(appId)
180+ // launches dialer again.
177− } else if (greeter.hasLockedApp && greeter.lockedApp !== appId) {
181+ greeter.lockedApp = appId;
182+ }
183+ if (greeter.hasLockedApp) {
184+ if (appId === greeter.lockedApp) {
185+ lockscreen.hide() // show locked app
186+ } else {
178− greeter.startUnlock()
187+ greeter.startUnlock() // show lockscreen if necessary
188+ }
179 }
189 }
180 greeter.hide();
190 greeter.hide();
181 } else {
191 } else {
@@ -196,10 +206,8 @@ Item {
196 if (greeter.shown && appId != "unity8-dash") {
206 if (greeter.shown && appId != "unity8-dash") {
197 greeter.startUnlock()
207 greeter.startUnlock()
198 }
208 }
199− if (greeter.narrowMode && appId === "dialer-app") {
209+ if (greeter.narrowMode && greeter.hasLockedApp && appId === greeter.lockedApp) {
200− // Always let the dialer-app through. Either user asked
210+ lockscreen.hide() // show locked app
201− // for an emergency call or accepted an incoming call.
202− setLockedApp(appId)
203 }
211 }
204 launcher.hide();
212 launcher.hide();
205 }
213 }
@@ -325,10 +333,16 @@ Item {
325
333
326 onEntered: LightDM.Greeter.respond(passphrase);
334 onEntered: LightDM.Greeter.respond(passphrase);
327 onCancel: greeter.show()
335 onCancel: greeter.show()
328− onEmergencyCall: shell.activateApplication("dialer-app") // will automatically enter locked-app mode
336+ onEmergencyCall: startLockedApp("dialer-app")
329
337
330 onShownChanged: if (shown) greeter.lockedApp = ""
338 onShownChanged: if (shown) greeter.lockedApp = ""
331
339
340+ function maybeShow() {
341+ if (!shell.forcedUnlock) {
342+ show()
343+ }
344+ }
345+
332 Timer {
346 Timer {
333 id: forcedDelayTimer
347 id: forcedDelayTimer
334 interval: 1000 * 60
348 interval: 1000 * 60
@@ -371,7 +385,7 @@ Item {
371 lockscreen.errorText = i18n.tr("Sorry, incorrect %1").arg(text.toLowerCase())
385 lockscreen.errorText = i18n.tr("Sorry, incorrect %1").arg(text.toLowerCase())
372 }
386 }
373
387
374− lockscreen.show();
388+ lockscreen.maybeShow();
375 }
389 }
376 }
390 }
377
391
@@ -381,7 +395,7 @@ Item {
381 lockscreen.hide()
395 lockscreen.hide()
382 } else {
396 } else {
383 lockscreen.reset();
397 lockscreen.reset();
384− lockscreen.show();
398+ lockscreen.maybeShow();
385 }
399 }
386 }
400 }
387 }
401 }
@@ -460,14 +474,14 @@ Item {
460 // Wait until the greeter is completely covering lockscreen before resetting it.
474 // Wait until the greeter is completely covering lockscreen before resetting it.
461 if (greeter.narrowMode && fullyShown && !LightDM.Greeter.authenticated) {
475 if (greeter.narrowMode && fullyShown && !LightDM.Greeter.authenticated) {
462 lockscreen.reset();
476 lockscreen.reset();
463− lockscreen.show();
477+ lockscreen.maybeShow();
464 }
478 }
465 }
479 }
466
480
467 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
481 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
468 onShowProgressChanged: {
482 onShowProgressChanged: {
469 if (showProgress === 0) {
483 if (showProgress === 0) {
470− if (LightDM.Greeter.promptless && LightDM.Greeter.authenticated) {
484+ if ((LightDM.Greeter.promptless && LightDM.Greeter.authenticated) || shell.forcedUnlock) {
471 greeter.login()
485 greeter.login()
472 } else if (greeter.narrowMode) {
486 } else if (greeter.narrowMode) {
473 lockscreen.clear(false) // to reset focus if necessary
487 lockscreen.clear(false) // to reset focus if necessary
@@ -501,7 +515,7 @@ Item {
501 function startUnlock() {
515 function startUnlock() {
502 if (narrowMode) {
516 if (narrowMode) {
503 if (!LightDM.Greeter.authenticated) {
517 if (!LightDM.Greeter.authenticated) {
504− lockscreen.show()
518+ lockscreen.maybeShow()
505 }
519 }
506 hide()
520 hide()
507 } else {
521 } else {
@@ -556,6 +570,25 @@ Item {
556 }
570 }
557 }
571 }
558
572
573+ Connections {
574+ id: callConnection
575+ target: callManager
576+
577+ onHasCallsChanged: {
578+ if (shell.locked && callManager.hasCalls) {
579+ // We just received an incoming call while locked. The
580+ // indicator will have already launched dialer-app for us, but
581+ // there is a race between "hasCalls" changing and the dialer
582+ // starting up. So in case we lose that race, we'll start/
583+ // focus the dialer ourselves here too. Even if the indicator
584+ // didn't launch the dialer for some reason (or maybe a call
585+ // started via some other means), if an active call is
586+ // happening, we want to be in the dialer.
587+ startLockedApp("dialer-app")
588+ }
589+ }
590+ }
591+
559 Connections {
592 Connections {
560 id: powerConnection
593 id: powerConnection
561 target: Powerd
594 target: Powerd
@@ -725,6 +758,7 @@ Item {
725
758
726 EdgeDemo {
759 EdgeDemo {
727 id: edgeDemo
760 id: edgeDemo
761+ objectName: "edgeDemo"
728 z: alphaDisclaimerLabel.z + 10
762 z: alphaDisclaimerLabel.z + 10
729 paused: Powerd.status === Powerd.Off // Saves power
763 paused: Powerd.status === Powerd.Off // Saves power
730 greeter: greeter
764 greeter: greeter
qml/Stages/PhoneStage.qml+2−1
@@ -21,6 +21,7 @@ import Unity.Application 0.1
21import Unity.Session 0.1
21import Unity.Session 0.1
22import Utils 0.1
22import Utils 0.1
23import "../Components"
23import "../Components"
24+import "../Components/Flickables" as Flickables
24
25
25Rectangle {
26Rectangle {
26 id: root
27 id: root
@@ -120,7 +121,7 @@ Rectangle {
120
121
121 }
122 }
122
123
123− Flickable {
124+ Flickables.Flickable {
124 id: spreadView
125 id: spreadView
125 objectName: "spreadView"
126 objectName: "spreadView"
126 anchors.fill: parent
127 anchors.fill: parent
qml/Stages/TabletStage.qml+2−1
@@ -20,6 +20,7 @@ import Ubuntu.Gestures 0.1
20import Unity.Application 0.1
20import Unity.Application 0.1
21import Utils 0.1
21import Utils 0.1
22import "../Components"
22import "../Components"
23+import "../Components/Flickables" as Flickables
23
24
24Rectangle {
25Rectangle {
25 id: root
26 id: root
@@ -153,7 +154,7 @@ Rectangle {
153 }
154 }
154 }
155 }
155
156
156− Flickable {
157+ Flickables.Flickable {
157 id: spreadView
158 id: spreadView
158 anchors.fill: parent
159 anchors.fill: parent
159 interactive: (spreadDragArea.status == DirectionalDragArea.Recognized || phase > 1)
160 interactive: (spreadDragArea.status == DirectionalDragArea.Recognized || phase > 1)
tests/autopilot/unity8/shell/emulators/dash.py+1−1
@@ -206,7 +206,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
206 def _get_category_element(self, category):
206 def _get_category_element(self, category):
207 try:
207 try:
208 return self.wait_select_single(
208 return self.wait_select_single(
209− 'Base', objectName='dashCategory{}'.format(category))
209+ 'DashCategoryBase', objectName='dashCategory{}'.format(category))
210 except dbus.StateNotFoundError:
210 except dbus.StateNotFoundError:
211 raise emulators.UnityEmulatorException(
211 raise emulators.UnityEmulatorException(
212 'No category found with name {}'.format(category))
212 'No category found with name {}'.format(category))
tests/mocks/AccountsService/AccountsService.cpp+5−3
@@ -26,7 +26,8 @@ AccountsService::AccountsService(QObject* parent)
26 m_enableIndicatorsWhileLocked(true),
26 m_enableIndicatorsWhileLocked(true),
27 m_backgroundFile(qmlDirectory() + "graphics/phone_background.jpg"),
27 m_backgroundFile(qmlDirectory() + "graphics/phone_background.jpg"),
28 m_statsWelcomeScreen(true),
28 m_statsWelcomeScreen(true),
29− m_failedLogins(0)
29+ m_failedLogins(0),
30+ m_demoEdges(false)
30{
31{
31}
32}
32
33
@@ -44,12 +45,13 @@ void AccountsService::setUser(const QString &user)
44
45
45bool AccountsService::demoEdges() const
46bool AccountsService::demoEdges() const
46{
47{
47− return false;
48+ return m_demoEdges;
48}
49}
49
50
50void AccountsService::setDemoEdges(bool demoEdges)
51void AccountsService::setDemoEdges(bool demoEdges)
51{
52{
52− Q_UNUSED(demoEdges)
53+ m_demoEdges = demoEdges;
54+ Q_EMIT demoEdgesChanged();
53}
55}
54
56
55bool AccountsService::enableLauncherWhileLocked() const
57bool AccountsService::enableLauncherWhileLocked() const
tests/mocks/AccountsService/AccountsService.h+1
@@ -101,6 +101,7 @@ private:
101 QString m_user;
101 QString m_user;
102 bool m_statsWelcomeScreen;
102 bool m_statsWelcomeScreen;
103 uint m_failedLogins;
103 uint m_failedLogins;
104+ bool m_demoEdges;
104};
105};
105
106
106#endif
107#endif
tests/qmltests/tst_ShellWithPin.qml+90−43
@@ -21,15 +21,17 @@ import AccountsService 0.1
21import GSettings 1.0
21import GSettings 1.0
22import LightDM 0.1 as LightDM
22import LightDM 0.1 as LightDM
23import Ubuntu.SystemImage 0.1
23import Ubuntu.SystemImage 0.1
24+import Ubuntu.Telephony 0.1 as Telephony
24import Unity.Application 0.1
25import Unity.Application 0.1
25import Unity.Test 0.1 as UT
26import Unity.Test 0.1 as UT
26import Powerd 0.1
27import Powerd 0.1
27
28
28import "../../qml"
29import "../../qml"
29
30
30−Row {
31+Item {
31 id: root
32 id: root
32− spacing: 0
33+ width: contentRow.width
34+ height: contentRow.height
33
35
34 QtObject {
36 QtObject {
35 id: applicationArguments
37 id: applicationArguments
@@ -47,34 +49,36 @@ Row {
47 }
49 }
48 }
50 }
49
51
50− Loader {
52+ Row {
51− id: shellLoader
53+ id: contentRow
52
54
53− width: units.gu(40)
55+ Loader {
54− height: units.gu(71)
56+ id: shellLoader
55
57
58+ width: units.gu(40)
59+ height: units.gu(71)
60+
56− property bool itemDestroyed: false
61+ property bool itemDestroyed: false
57− sourceComponent: Component {
62+ sourceComponent: Component {
58− Shell {
63+ Shell {
59− Component.onDestruction: {
64+ Component.onDestruction: {
60− shellLoader.itemDestroyed = true
65+ shellLoader.itemDestroyed = true
66+ }
67+ maxFailedLogins: maxRetriesTextField.text
61 }
68 }
62− maxFailedLogins: maxRetriesTextField.text
63 }
69 }
64 }
70 }
65− }
66
71
67− Rectangle {
72+ Rectangle {
68− color: "white"
73+ color: "white"
69− width: units.gu(30)
74+ width: units.gu(30)
70− height: shellLoader.height
75+ height: shellLoader.height
71
76
72− Column {
77+ Column {
73− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
78+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
74− spacing: units.gu(1)
79+ spacing: units.gu(1)
75− Row {
76− anchors { left: parent.left; right: parent.right }
77 Button {
80 Button {
81+ anchors { left: parent.left; right: parent.right }
78 text: "Show Greeter"
82 text: "Show Greeter"
79 onClicked: {
83 onClicked: {
80 if (shellLoader.status !== Loader.Ready)
84 if (shellLoader.status !== Loader.Ready)
@@ -86,15 +90,15 @@ Row {
86 }
90 }
87 }
91 }
88 }
92 }
89− }
90
93
91− Label {
94+ Label {
92− text: "Max retries:"
95+ text: "Max retries:"
93− color: "black"
96+ color: "black"
94− }
97+ }
95− TextField {
98+ TextField {
96− id: maxRetriesTextField
99+ id: maxRetriesTextField
97− text: "-1"
100+ text: "-1"
101+ }
98 }
102 }
99 }
103 }
100 }
104 }
@@ -110,7 +114,13 @@ Row {
110 signalName: "resettingDevice"
114 signalName: "resettingDevice"
111 }
115 }
112
116
117+ Telephony.CallEntry {
118+ id: phoneCall
119+ phoneNumber: "+447812221111"
120+ }
121+
113 UT.UnityTestCase {
122 UT.UnityTestCase {
123+ id: testCase
114 name: "ShellWithPin"
124 name: "ShellWithPin"
115 when: windowShown
125 when: windowShown
116
126
@@ -119,10 +129,9 @@ Row {
119 function init() {
129 function init() {
120 sessionSpy.target = findChild(shell, "greeter")
130 sessionSpy.target = findChild(shell, "greeter")
121 swipeAwayGreeter()
131 swipeAwayGreeter()
132+ waitForLockscreen()
122 shell.failedLoginsDelayAttempts = -1
133 shell.failedLoginsDelayAttempts = -1
123 maxRetriesTextField.text = "-1"
134 maxRetriesTextField.text = "-1"
124− AccountsService.enableLauncherWhileLocked = true
125− AccountsService.enableIndicatorsWhileLocked = true
126 }
135 }
127
136
128 function cleanup() {
137 function cleanup() {
@@ -143,6 +152,10 @@ Row {
143 // kill all (fake) running apps
152 // kill all (fake) running apps
144 killApps()
153 killApps()
145
154
155+ AccountsService.enableLauncherWhileLocked = true
156+ AccountsService.enableIndicatorsWhileLocked = true
157+ AccountsService.demoEdges = false
158+
146 // reload our test subject to get it in a fresh state once again
159 // reload our test subject to get it in a fresh state once again
147 shellLoader.active = true
160 shellLoader.active = true
148
161
@@ -169,8 +182,9 @@ Row {
169
182
170 // wait until the animation has finished
183 // wait until the animation has finished
171 tryCompare(greeter, "showProgress", 0);
184 tryCompare(greeter, "showProgress", 0);
185+ }
172
186
173− // and for pin to be ready
187+ function waitForLockscreen() {
174 var lockscreen = findChild(shell, "lockscreen");
188 var lockscreen = findChild(shell, "lockscreen");
175 var pinPadLoader = findChild(lockscreen, "pinPadLoader");
189 var pinPadLoader = findChild(lockscreen, "pinPadLoader");
176 tryCompare(pinPadLoader, "status", Loader.Ready)
190 tryCompare(pinPadLoader, "status", Loader.Ready)
@@ -182,10 +196,20 @@ Row {
182 for (var i = 0; i < pin.length; ++i) {
196 for (var i = 0; i < pin.length; ++i) {
183 var character = pin.charAt(i)
197 var character = pin.charAt(i)
184 var button = findChild(shell, "pinPadButton" + character)
198 var button = findChild(shell, "pinPadButton" + character)
185− mouseClick(button, units.gu(1), units.gu(1))
199+ tap(button)
186 }
200 }
187 }
201 }
188
202
203+ function confirmLockedApp(app) {
204+ var greeter = findChild(shell, "greeter")
205+ var lockscreen = findChild(shell, "lockscreen")
206+ tryCompare(greeter, "shown", false)
207+ tryCompare(lockscreen, "shown", false)
208+ tryCompare(greeter, "hasLockedApp", true)
209+ tryCompare(greeter, "lockedApp", app)
210+ tryCompare(ApplicationManager, "focusedApplicationId", app)
211+ }
212+
189 function test_login() {
213 function test_login() {
190 sessionSpy.clear()
214 sessionSpy.clear()
191 tryCompare(sessionSpy, "count", 0)
215 tryCompare(sessionSpy, "count", 0)
@@ -193,6 +217,25 @@ Row {
193 tryCompare(sessionSpy, "count", 1)
217 tryCompare(sessionSpy, "count", 1)
194 }
218 }
195
219
220+ function test_edgeDemoHidesLockscreen() {
221+ LightDM.Greeter.showGreeter()
222+ sessionSpy.clear()
223+ var lockscreen = findChild(shell, "lockscreen")
224+
225+ tryCompare(lockscreen, "shown", true)
226+ AccountsService.demoEdges = true
227+ tryCompare(lockscreen, "shown", false)
228+
229+ swipeAwayGreeter()
230+ tryCompare(sessionSpy, "count", 1)
231+
232+ // Lockscreen is only hidden by the edge demo, so if we turn that
233+ // off and show greeter again, lockscreen should appear
234+ AccountsService.demoEdges = false
235+ LightDM.Greeter.showGreeter()
236+ tryCompare(lockscreen, "shown", true)
237+ }
238+
196 function test_disabledEdges() {
239 function test_disabledEdges() {
197 var launcher = findChild(shell, "launcher")
240 var launcher = findChild(shell, "launcher")
198 tryCompare(launcher, "available", true)
241 tryCompare(launcher, "available", true)
@@ -214,7 +257,7 @@ Row {
214 var launcher = findChild(shell, "launcher")
257 var launcher = findChild(shell, "launcher")
215 var stage = findChild(shell, "stage")
258 var stage = findChild(shell, "stage")
216
259
217− mouseClick(emergencyButton, units.gu(1), units.gu(1))
260+ tap(emergencyButton)
218
261
219 tryCompare(greeter, "lockedApp", "dialer-app")
262 tryCompare(greeter, "lockedApp", "dialer-app")
220 tryCompare(greeter, "hasLockedApp", true)
263 tryCompare(greeter, "hasLockedApp", true)
@@ -241,7 +284,7 @@ Row {
241 function test_emergencyCallCrash() {
284 function test_emergencyCallCrash() {
242 var lockscreen = findChild(shell, "lockscreen")
285 var lockscreen = findChild(shell, "lockscreen")
243 var emergencyButton = findChild(lockscreen, "emergencyCallLabel")
286 var emergencyButton = findChild(lockscreen, "emergencyCallLabel")
244− mouseClick(emergencyButton, units.gu(1), units.gu(1))
287+ tap(emergencyButton)
245
288
246 tryCompare(lockscreen, "shown", false)
289 tryCompare(lockscreen, "shown", false)
247 killApps() // kill dialer-app, as if it crashed
290 killApps() // kill dialer-app, as if it crashed
@@ -251,7 +294,7 @@ Row {
251 function test_emergencyCallAppLaunch() {
294 function test_emergencyCallAppLaunch() {
252 var lockscreen = findChild(shell, "lockscreen")
295 var lockscreen = findChild(shell, "lockscreen")
253 var emergencyButton = findChild(lockscreen, "emergencyCallLabel")
296 var emergencyButton = findChild(lockscreen, "emergencyCallLabel")
254− mouseClick(emergencyButton, units.gu(1), units.gu(1))
297+ tap(emergencyButton)
255
298
256 tryCompare(lockscreen, "shown", false)
299 tryCompare(lockscreen, "shown", false)
257 ApplicationManager.startApplication("gallery-app", ApplicationManager.NoFlag)
300 ApplicationManager.startApplication("gallery-app", ApplicationManager.NoFlag)
@@ -296,7 +339,7 @@ Row {
296
339
297 var dialog = findChild(root, "infoPopup")
340 var dialog = findChild(root, "infoPopup")
298 var button = findChild(dialog, "infoPopupOkButton")
341 var button = findChild(dialog, "infoPopupOkButton")
299− mouseClick(button, units.gu(1), units.gu(1))
342+ tap(button)
300 tryCompareFunction(function() {return findChild(root, "infoPopup")}, null)
343 tryCompareFunction(function() {return findChild(root, "infoPopup")}, null)
301
344
302 tryCompare(resetSpy, "count", 0)
345 tryCompare(resetSpy, "count", 0)
@@ -317,11 +360,9 @@ Row {
317 tryCompare(shell, "sideStageEnabled", false)
360 tryCompare(shell, "sideStageEnabled", false)
318 tryCompare(applicationsDisplayLoader, "tabletMode", false)
361 tryCompare(applicationsDisplayLoader, "tabletMode", false)
319
362
320− var app = ApplicationManager.startApplication("dialer-app")
363+ var lockscreen = findChild(shell, "lockscreen")
321−
364+ lockscreen.emergencyCall()
322− var greeter = findChild(shell, "greeter")
365+ confirmLockedApp("dialer-app")
323− tryCompare(greeter, "showProgress", 0)
324− tryCompare(greeter, "hasLockedApp", true)
325
366
326 // OK, we're in. Now try (but fail) to switch to tablet mode
367 // OK, we're in. Now try (but fail) to switch to tablet mode
327 shell.tablet = true
368 shell.tablet = true
@@ -330,9 +371,15 @@ Row {
330
371
331 // And when we kill the app, we go back to locked tablet mode
372 // And when we kill the app, we go back to locked tablet mode
332 killApps()
373 killApps()
374+ var greeter = findChild(shell, "greeter")
333 tryCompare(greeter, "showProgress", 1)
375 tryCompare(greeter, "showProgress", 1)
334 tryCompare(shell, "sideStageEnabled", true)
376 tryCompare(shell, "sideStageEnabled", true)
335 tryCompare(applicationsDisplayLoader, "tabletMode", true)
377 tryCompare(applicationsDisplayLoader, "tabletMode", true)
336 }
378 }
379+
380+ function test_emergencyDialerIncoming() {
381+ callManager.foregroundCall = phoneCall
382+ confirmLockedApp("dialer-app")
383+ }
337 }
384 }
338}
385}
tests/qmltests/tst_TabletShell.qml+10−2
@@ -16,6 +16,7 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19+import AccountsService 0.1
19import GSettings 1.0
20import GSettings 1.0
20import LightDM 0.1 as LightDM
21import LightDM 0.1 as LightDM
21import Ubuntu.Components 1.1
22import Ubuntu.Components 1.1
@@ -142,6 +143,7 @@ Row {
142 killApps()
143 killApps()
143
144
144 unlockAllModemsSpy.clear()
145 unlockAllModemsSpy.clear()
146+ AccountsService.demoEdges = false
145
147
146 // reload our test subject to get it in a fresh state once again
148 // reload our test subject to get it in a fresh state once again
147 shellLoader.active = true
149 shellLoader.active = true
@@ -274,13 +276,19 @@ Row {
274
276
275 function test_leftEdgeDrag_data() {
277 function test_leftEdgeDrag_data() {
276 return [
278 return [
277− {tag: "without password", user: "no-password", loggedIn: true},
279+ {tag: "without password", user: "no-password", loggedIn: true, demo: false},
278− {tag: "with password", user: "has-password", loggedIn: false},
280+ {tag: "with password", user: "has-password", loggedIn: false, demo: false},
281+ {tag: "with demo", user: "has-password", loggedIn: true, demo: true},
279 ]
282 ]
280 }
283 }
281
284
282 function test_leftEdgeDrag(data) {
285 function test_leftEdgeDrag(data) {
283 selectUser(data.user)
286 selectUser(data.user)
287+
288+ AccountsService.demoEdges = data.demo
289+ var edgeDemo = findChild(shell, "edgeDemo")
290+ tryCompare(edgeDemo, "running", data.demo)
291+
284 swipeFromLeftEdge(shell.width * 0.75)
292 swipeFromLeftEdge(shell.width * 0.75)
285 wait(500) // to give time to handle dash() signal from Launcher
293 wait(500) // to give time to handle dash() signal from Launcher
286 confirmLoggedIn(data.loggedIn)
294 confirmLoggedIn(data.loggedIn)
tests/utils/modules/Unity/Test/UnityTestCase.qml+9
@@ -321,7 +321,16 @@ TestCase {
321 event.commit()
321 event.commit()
322 }
322 }
323
323
324+ /*! \brief Tap the item with a touch event.
325+
326+ \param item The item to be tapped
327+ \param x The x coordinate of the tap, defaults to horizontal center
328+ \param y The y coordinate of the tap, defaults to vertical center
329+ */
324 function tap(item, x, y) {
330 function tap(item, x, y) {
331+ if (typeof x !== "number") x = item.width / 2;
332+ if (typeof y !== "number") y = item.height / 2;
333+
325 var root = fetchRootItem(item)
334 var root = fetchRootItem(item)
326 var rootPoint = item.mapToItem(root, x, y)
335 var rootPoint = item.mapToItem(root, x, y)
327
336