on xenial help sign in
Merge trunk
f0a8a30Daniel d'Andrada
debian/changelog+25
@@ -1,3 +1,28 @@
1+unity8 (8.02+15.04.20150121.2-0ubuntu1) vivid; urgency=low
2+
3+ [ Michael Terry ]
4+ * Don't show any power dialogs while the screen is off. This is a
5+ band-aid to avoid the symptom, while we still investigate the source
6+ of why the screen doesn't turn on (and why we seem to not handle the
7+ power-button-release event). (LP: #1409003, #1410830)
8+ * Don't refocus the dialer-app when a call is started by the user.
9+ Because of how qtmir works, this would cause the dialer-app to
10+ unfocus momentarily, causing interface oddities for the user. (LP:
11+ #1413065)
12+
13+ [ CI Train Bot ]
14+ * Resync trunk
15+
16+ [ Albert Astals Cid ]
17+ * Build with ninja
18+ * Fixes for Table Preview Widget (LP: #1410420)
19+
20+ [ Michael Zanetti ]
21+ * Add support for earpiece media buttons (LP: #1398427)
22+ * Add a WindowMoveResizeArea and tests for it
23+
24+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 21 Jan 2015 18:33:18 +0000
25+
1unity8 (8.02+15.04.20150113.1-0ubuntu1) vivid; urgency=low
26unity8 (8.02+15.04.20150113.1-0ubuntu1) vivid; urgency=low
2
27
3 [ Andrea Cimitan ]
28 [ Andrea Cimitan ]
po/pt.po+30−29
@@ -8,15 +8,15 @@ 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-12-10 10:55+0100\n"
10"POT-Creation-Date: 2014-12-10 10:55+0100\n"
11−"PO-Revision-Date: 2014-11-06 10:25+0000\n"
11+"PO-Revision-Date: 2015-01-20 21:11+0000\n"
12−"Last-Translator: Ivo Xavier <ivofernandes12@gmail.com>\n"
12+"Last-Translator: Filipe André Pinho <Unknown>\n"
13"Language-Team: Portuguese <pt@li.org>\n"
13"Language-Team: Portuguese <pt@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-12-13 07:11+0000\n"
18+"X-Launchpad-Export-Date: 2015-01-21 06:43+0000\n"
19−"X-Generator: Launchpad (build 17286)\n"
19+"X-Generator: Launchpad (build 17306)\n"
20
20
21#: plugins/LightDM/Greeter.cpp:130
21#: plugins/LightDM/Greeter.cpp:130
22msgid "Password: "
22msgid "Password: "
@@ -229,15 +229,15 @@ msgstr "Solte para atualizar..."
229
229
230#: qml/Dash/ScopesList.qml:63
230#: qml/Dash/ScopesList.qml:63
231msgid "Manage"
231msgid "Manage"
232−msgstr ""
232+msgstr "Gerir"
233
233
234#: qml/Dash/ScopesList.qml:107
234#: qml/Dash/ScopesList.qml:107
235msgid "Home"
235msgid "Home"
236−msgstr ""
236+msgstr "Página inicial"
237
237
238#: qml/Dash/ScopesList.qml:108
238#: qml/Dash/ScopesList.qml:108
239msgid "Also installed"
239msgid "Also installed"
240−msgstr ""
240+msgstr "Também instalado"
241
241
242#: qml/Greeter/Greeter.qml:174
242#: qml/Greeter/Greeter.qml:174
243msgid "Unlock"
243msgid "Unlock"
@@ -351,38 +351,39 @@ msgstr ""
351
351
352#: qml/Wizard/Page.qml:89
352#: qml/Wizard/Page.qml:89
353msgid "Back"
353msgid "Back"
354−msgstr ""
354+msgstr "Anterior"
355
355
356#: qml/Wizard/Pages/10-welcome.qml:27
356#: qml/Wizard/Pages/10-welcome.qml:27
357msgid "Hi!"
357msgid "Hi!"
358−msgstr ""
358+msgstr "Olá!"
359
359
360#: qml/Wizard/Pages/10-welcome.qml:44
360#: qml/Wizard/Pages/10-welcome.qml:44
361msgid "Welcome to your Ubuntu phone."
361msgid "Welcome to your Ubuntu phone."
362−msgstr ""
362+msgstr "Bem-vindo ao seu telemóvel Ubuntu."
363
363
364#: qml/Wizard/Pages/10-welcome.qml:52
364#: qml/Wizard/Pages/10-welcome.qml:52
365msgid "Let’s get started."
365msgid "Let’s get started."
366−msgstr ""
366+msgstr "Vamos começar!"
367
367
368#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
368#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
369#: qml/Wizard/Pages/40-wifi.qml:197 qml/Wizard/Pages/50-location.qml:131
369#: qml/Wizard/Pages/40-wifi.qml:197 qml/Wizard/Pages/50-location.qml:131
370#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
370#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
371#: qml/Wizard/Pages/passwd-set.qml:90
371#: qml/Wizard/Pages/passwd-set.qml:90
372msgid "Continue"
372msgid "Continue"
373−msgstr ""
373+msgstr "Avançar"
374
374
375#: qml/Wizard/Pages/20-sim.qml:25
375#: qml/Wizard/Pages/20-sim.qml:25
376msgid "Add a SIM card and restart your device"
376msgid "Add a SIM card and restart your device"
377−msgstr ""
377+msgstr "Adicione o cartão SIM e reinicie o seu dispositivo"
378
378
379#: qml/Wizard/Pages/20-sim.qml:55
379#: qml/Wizard/Pages/20-sim.qml:55
380msgid "Without it, you won’t be able to make calls or use text messaging."
380msgid "Without it, you won’t be able to make calls or use text messaging."
381msgstr ""
381msgstr ""
382+"Sem o cartão SIM, não poderá fazer chamadas ou enviar mensagens de texto."
382
383
383#: qml/Wizard/Pages/20-sim.qml:69 qml/Wizard/Pages/40-wifi.qml:197
384#: qml/Wizard/Pages/20-sim.qml:69 qml/Wizard/Pages/40-wifi.qml:197
384msgid "Skip"
385msgid "Skip"
385−msgstr ""
386+msgstr "Ignorar"
386
387
387#: qml/Wizard/Pages/30-passwd-type.qml:39
388#: qml/Wizard/Pages/30-passwd-type.qml:39
388msgid "Lock security"
389msgid "Lock security"
@@ -390,7 +391,7 @@ msgstr ""
390
391
391#: qml/Wizard/Pages/30-passwd-type.qml:74
392#: qml/Wizard/Pages/30-passwd-type.qml:74
392msgid "Please select how you’d like to unlock your phone."
393msgid "Please select how you’d like to unlock your phone."
393−msgstr ""
394+msgstr "Por favor, escolha como pretende desbloquear o seu telemóvel."
394
395
395#: qml/Wizard/Pages/30-passwd-type.qml:97
396#: qml/Wizard/Pages/30-passwd-type.qml:97
396msgid "Swipe"
397msgid "Swipe"
@@ -398,7 +399,7 @@ msgstr ""
398
399
399#: qml/Wizard/Pages/30-passwd-type.qml:98
400#: qml/Wizard/Pages/30-passwd-type.qml:98
400msgid "No security"
401msgid "No security"
401−msgstr ""
402+msgstr "Sem segurança"
402
403
403#: qml/Wizard/Pages/30-passwd-type.qml:100
404#: qml/Wizard/Pages/30-passwd-type.qml:100
404msgid "Passcode"
405msgid "Passcode"
@@ -406,7 +407,7 @@ msgstr ""
406
407
407#: qml/Wizard/Pages/30-passwd-type.qml:101
408#: qml/Wizard/Pages/30-passwd-type.qml:101
408msgid "4 digits only"
409msgid "4 digits only"
409−msgstr ""
410+msgstr "4 dígitos"
410
411
411#: qml/Wizard/Pages/30-passwd-type.qml:103
412#: qml/Wizard/Pages/30-passwd-type.qml:103
412msgid "Passphrase"
413msgid "Passphrase"
@@ -414,31 +415,31 @@ msgstr ""
414
415
415#: qml/Wizard/Pages/30-passwd-type.qml:104
416#: qml/Wizard/Pages/30-passwd-type.qml:104
416msgid "Numbers and letters"
417msgid "Numbers and letters"
417−msgstr ""
418+msgstr "Números e letras"
418
419
419#: qml/Wizard/Pages/40-wifi.qml:28
420#: qml/Wizard/Pages/40-wifi.qml:28
420msgid "Connect to Wi‑Fi"
421msgid "Connect to Wi‑Fi"
421−msgstr ""
422+msgstr "Ligar ao Wi-Fi"
422
423
423#: qml/Wizard/Pages/40-wifi.qml:147
424#: qml/Wizard/Pages/40-wifi.qml:147
424msgid "Available networks…"
425msgid "Available networks…"
425−msgstr ""
426+msgstr "Redes disponíveis..."
426
427
427#: qml/Wizard/Pages/40-wifi.qml:148
428#: qml/Wizard/Pages/40-wifi.qml:148
428msgid "No available networks."
429msgid "No available networks."
429−msgstr ""
430+msgstr "Sem redes disponíveis."
430
431
431#: qml/Wizard/Pages/50-location.qml:27
432#: qml/Wizard/Pages/50-location.qml:27
432msgid "Location"
433msgid "Location"
433−msgstr ""
434+msgstr "Localização"
434
435
435#: qml/Wizard/Pages/50-location.qml:62
436#: qml/Wizard/Pages/50-location.qml:62
436msgid "Let the phone detect your location:"
437msgid "Let the phone detect your location:"
437−msgstr ""
438+msgstr "Deixe o telefone detectar a sua localização:"
438
439
439#: qml/Wizard/Pages/50-location.qml:69
440#: qml/Wizard/Pages/50-location.qml:69
440msgid "Using GPS only (less accurate)"
441msgid "Using GPS only (less accurate)"
441−msgstr ""
442+msgstr "Usar apenas GPS (menos preciso)"
442
443
443#: qml/Wizard/Pages/50-location.qml:86
444#: qml/Wizard/Pages/50-location.qml:86
444msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
445msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
@@ -461,7 +462,7 @@ msgstr ""
461
462
462#: qml/Wizard/Pages/60-reporting.qml:24
463#: qml/Wizard/Pages/60-reporting.qml:24
463msgid "Improving your experience"
464msgid "Improving your experience"
464−msgstr ""
465+msgstr "Melhore a sua experiência"
465
466
466#: qml/Wizard/Pages/60-reporting.qml:36
467#: qml/Wizard/Pages/60-reporting.qml:36
467msgid ""
468msgid ""
@@ -481,7 +482,7 @@ msgstr ""
481
482
482#: qml/Wizard/Pages/80-finished.qml:39
483#: qml/Wizard/Pages/80-finished.qml:39
483msgid "Nice work!"
484msgid "Nice work!"
484−msgstr ""
485+msgstr "Bom trabalho!"
485
486
486#: qml/Wizard/Pages/80-finished.qml:46
487#: qml/Wizard/Pages/80-finished.qml:46
487msgid "Your phone is now ready to use."
488msgid "Your phone is now ready to use."
@@ -489,7 +490,7 @@ msgstr ""
489
490
490#: qml/Wizard/Pages/80-finished.qml:53
491#: qml/Wizard/Pages/80-finished.qml:53
491msgid "Finish"
492msgid "Finish"
492−msgstr ""
493+msgstr "Concluir"
493
494
494#: qml/Wizard/Pages/here-terms.qml:27
495#: qml/Wizard/Pages/here-terms.qml:27
495msgid "Terms & Conditions"
496msgid "Terms & Conditions"
@@ -506,7 +507,7 @@ msgstr ""
506#: qml/Wizard/Pages/passwd-confirm.qml:53
507#: qml/Wizard/Pages/passwd-confirm.qml:53
507#: qml/Wizard/Pages/passwd-confirm.qml:54
508#: qml/Wizard/Pages/passwd-confirm.qml:54
508msgid "Please try again."
509msgid "Please try again."
509−msgstr ""
510+msgstr "Por favor, tente novamente."
510
511
511#: qml/Wizard/Pages/passwd-set.qml:61
512#: qml/Wizard/Pages/passwd-set.qml:61
512msgid "Choose your passcode"
513msgid "Choose your passcode"
@@ -519,7 +520,7 @@ msgstr ""
519#: qml/Wizard/StackButton.qml:39
520#: qml/Wizard/StackButton.qml:39
520#, qt-format
521#, qt-format
521msgid "〈 %1"
522msgid "〈 %1"
522−msgstr ""
523+msgstr "〈 %1"
523
524
524#: qml/Wizard/StackButton.qml:42
525#: qml/Wizard/StackButton.qml:42
525#, qt-format
526#, qt-format
qml/Dash/Previews/PreviewTable.qml+6
@@ -37,6 +37,7 @@ PreviewWidget {
37 id: column
37 id: column
38 objectName: "column"
38 objectName: "column"
39 spacing: units.gu(1)
39 spacing: units.gu(1)
40+ width: parent.width
40
41
41 Label {
42 Label {
42 id: titleLabel
43 id: titleLabel
@@ -51,6 +52,7 @@ PreviewWidget {
51 visible: text !== ""
52 visible: text !== ""
52 opacity: .8
53 opacity: .8
53 text: widgetData["title"] || ""
54 text: widgetData["title"] || ""
55+ elide: Text.ElideRight
54 }
56 }
55
57
56 GridLayout {
58 GridLayout {
@@ -72,6 +74,10 @@ PreviewWidget {
72 visible: root.expanded || rowIndex < maximumCollapsedRowCount
74 visible: root.expanded || rowIndex < maximumCollapsedRowCount
73 color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
75 color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
74 font.bold: index == 0
76 font.bold: index == 0
77+ verticalAlignment: Text.AlignTop
78+ wrapMode: Text.WordWrap
79+ Layout.fillHeight: true
80+ Layout.maximumWidth: column.width - x
75 }
81 }
76 }
82 }
77 }
83 }
qml/Shell.qml+15−3
@@ -180,8 +180,20 @@ Item {
180
180
181 WindowKeysFilter {
181 WindowKeysFilter {
182 Keys.onPressed: {
182 Keys.onPressed: {
183+ // Nokia earpieces give TogglePlayPause, while the iPhone's earpiece gives Play
184+ if (event.key == Qt.Key_MediaTogglePlayPause || event.key == Qt.Key_MediaPlay) {
185+ event.accepted = callManager.handleMediaKey(false);
183− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
186+ } else if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
187+ // FIXME: We only consider power key presses if the screen is
188+ // on because of bugs 1410830/1409003. The theory is that when
189+ // those bugs are encountered, there is a >2s delay between the
190+ // power press event and the power release event, which causes
191+ // the shutdown dialog to appear on resume. So to avoid that
192+ // symptom while we investigate the root cause, we simply won't
193+ // initiate any dialogs when the screen is off.
194+ if (Powerd.status === Powerd.On) {
184− dialogs.onPowerKeyPressed();
195+ dialogs.onPowerKeyPressed();
196+ }
185 event.accepted = true;
197 event.accepted = true;
186 } else {
198 } else {
187 volumeKeyFilter.onKeyPressed(event.key);
199 volumeKeyFilter.onKeyPressed(event.key);
@@ -652,7 +664,7 @@ Item {
652 target: callManager
664 target: callManager
653
665
654 onHasCallsChanged: {
666 onHasCallsChanged: {
655− if (shell.locked && callManager.hasCalls) {
667+ if (shell.locked && callManager.hasCalls && greeter.lockedApp !== "dialer-app") {
656 // We just received an incoming call while locked. The
668 // We just received an incoming call while locked. The
657 // indicator will have already launched dialer-app for us, but
669 // indicator will have already launched dialer-app for us, but
658 // there is a race between "hasCalls" changing and the dialer
670 // there is a race between "hasCalls" changing and the dialer
qml/Stages/DesktopStage.qml+8−44
@@ -94,6 +94,8 @@ Item {
94 width: units.gu(60)
94 width: units.gu(60)
95 height: units.gu(50)
95 height: units.gu(50)
96
96
97+ readonly property int minWidth: units.gu(10)
98+ readonly property int minHeight: units.gu(10)
97
99
98 states: [
100 states: [
99 State {
101 State {
@@ -114,51 +116,13 @@ Item {
114 }
116 }
115 ]
117 ]
116
118
117− MouseArea {
119+ WindowMoveResizeArea {
118− anchors.fill: parent
119− anchors.margins: -units.gu(0.5)
120−
121− property bool resizeWidth: false
122− property bool resizeHeight: false
123−
124− property int startX: 0
125− property int startWidth: 0
126− property int startY: 0
127− property int startHeight: 0
128−
129− onPressed: {
130− ApplicationManager.requestFocusApplication(model.appId)
131− if (mouseX > width - units.gu(1)) {
132− resizeWidth = true;
133− startX = mouseX;
134− startWidth = appDelegate.width;
135− }
136− if (mouseY > height - units.gu(1)) {
137− resizeHeight = true;
138− startY = mouseY;
139− startHeight = appDelegate.height;
140− }
141− if (!resizeHeight && !resizeWidth) {
142− drag.target = appDelegate;
120+ target: appDelegate
143− }
121+ minWidth: appDelegate.minWidth
144− }
122+ minHeight: appDelegate.minHeight
145−
123+ resizeHandleWidth: units.gu(0.5)
146− onMouseXChanged: {
147− if (resizeWidth) {
148− appDelegate.width = startWidth + (mouseX - startX)
149− }
150− }
151− onMouseYChanged: {
152− if (resizeHeight) {
153− appDelegate.height = startHeight + (mouseY - startY)
154− }
155− }
156
124
157− onReleased: {
125+ onPressed: ApplicationManager.requestFocusApplication(model.appId)
158− resizeWidth = false;
159− resizeHeight = false;
160− drag.target = undefined;
161− }
162 }
126 }
163
127
164 DecoratedWindow {
128 DecoratedWindow {
qml/Stages/WindowMoveResizeArea.qmlnew file+98
@@ -0,0 +1,98 @@
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+ * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17+ */
18+
19+import QtQuick 2.3
20+import Ubuntu.Components 1.1
21+
22+MouseArea {
23+ id: root
24+ anchors.fill: target
25+ anchors.margins: -resizeHandleWidth
26+
27+ // The target item managed by this. Must be a parent or a sibling
28+ // The area will anchor to it and manage move and resize events
29+ property var target: null
30+ property int resizeHandleWidth: 0
31+ property int minWidth: 0
32+ property int minHeight: 0
33+
34+ QtObject {
35+ id: priv
36+ readonly property int windowWidth: root.width - root.resizeHandleWidth * 2
37+ readonly property int windowHeight: root.height - resizeHandleWidth * 2
38+
39+ property var startPoint
40+ property int startWidth
41+ property int startHeight
42+
43+ property bool resizeTop: false
44+ property bool resizeBottom: false
45+ property bool resizeLeft: false
46+ property bool resizeRight: false
47+
48+ }
49+
50+ onPressed: {
51+ priv.startPoint = mapToItem(null, Qt.point(mouse.x, mouse.y)).x;
52+ priv.startWidth = root.width;
53+ priv.startHeight = root.height;
54+ priv.resizeTop = mouseY < root.resizeHandleWidth;
55+ priv.resizeBottom = mouseY > (root.height - root.resizeHandleWidth);
56+ priv.resizeLeft = mouseX < root.resizeHandleWidth;
57+ priv.resizeRight = mouseX > (root.width - root.resizeHandleWidth);
58+ }
59+
60+ onPositionChanged: {
61+ var currentPoint = mapToItem(null, Qt.point(mouse.x, mouse.y)).x;
62+ var mouseDiff = Qt.point(currentPoint.x - priv.startPoint.x, currentPoint.y - priv.startPoint.y);
63+ var moveDiff = Qt.point(0, 0);
64+ var sizeDiff = Qt.point(0, 0);
65+ if (priv.resizeTop || priv.resizeBottom || priv.resizeLeft || priv.resizeRight) {
66+ if (priv.resizeTop) {
67+ moveDiff.y += mouseDiff.y;
68+ sizeDiff.y += -mouseDiff.y;
69+ } else if (priv.resizeBottom) {
70+ sizeDiff.y += mouse.y - priv.startPoint.y;
71+ priv.startPoint.y = mouse.y
72+ }
73+ if (priv.resizeLeft) {
74+ moveDiff.x += mouseDiff.x;
75+ sizeDiff.x += -mouseDiff.x;
76+ } else if (priv.resizeRight) {
77+ sizeDiff.x += mouse.x - priv.startPoint.x;
78+ priv.startPoint.x = mouse.x
79+ }
80+ if (priv.windowWidth + sizeDiff.x < root.minWidth) {
81+ sizeDiff.x = root.minWidth - priv.windowWidth;
82+ moveDiff.x = moveDiff.x == 0 ? 0 : -sizeDiff.x;
83+ }
84+ if (priv.windowHeight + sizeDiff.y < root.minHeight) {
85+ sizeDiff.y = root.minHeight - priv.windowHeight;
86+ moveDiff.y = moveDiff.y == 0 ? 0 : -sizeDiff.y;
87+ }
88+
89+ target.x += moveDiff.x;
90+ target.y += moveDiff.y;
91+ target.width += sizeDiff.x;
92+ target.height += sizeDiff.y;
93+ } else {
94+ target.x += mouseDiff.x;
95+ target.y += mouseDiff.y;
96+ }
97+ }
98+}
tests/mocks/LightDM/CMakeLists.txt+1−2
@@ -36,8 +36,7 @@ add_library(MockLightDM-qml MODULE
36# LD_LIBRARY_PATH.
36# LD_LIBRARY_PATH.
37add_dependencies(MockLightDM-qml MockLightDM MockUserMetrics)
37add_dependencies(MockLightDM-qml MockLightDM MockUserMetrics)
38target_link_libraries(MockLightDM-qml
38target_link_libraries(MockLightDM-qml
39− -L${CMAKE_CURRENT_BINARY_DIR}/liblightdm
39+ MockLightDM
40− -llightdm-qt5-2
41 -L${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics
40 -L${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics
42 -lusermetricsoutput
41 -lusermetricsoutput
43 unity8-private
42 unity8-private
tests/plugins/LightDM/CMakeLists.txt+1−4
@@ -11,10 +11,7 @@ include_directories(
11 ${LIBLIGHTDM_INCLUDE_DIRS}
11 ${LIBLIGHTDM_INCLUDE_DIRS}
12 )
12 )
13
13
14−target_link_libraries(GreeterDBusTestExec
14+target_link_libraries(GreeterDBusTestExec MockLightDM)
15− -L${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm
16− -llightdm-qt5-2
17− )
18
15
19add_definitions(-DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
16add_definitions(-DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
20
17
tests/qmltests/CMakeLists.txt+1
@@ -88,5 +88,6 @@ add_qml_test(Stages PhoneStage ENVIRONMENT)
88add_qml_test(Stages SpreadDelegate ENVIRONMENT)
88add_qml_test(Stages SpreadDelegate ENVIRONMENT)
89add_qml_test(Stages SurfaceContainer ENVIRONMENT)
89add_qml_test(Stages SurfaceContainer ENVIRONMENT)
90add_qml_test(Stages SessionContainer ENVIRONMENT)
90add_qml_test(Stages SessionContainer ENVIRONMENT)
91+add_qml_test(Stages WindowMoveResizeArea)
91add_qml_test(Stages Splash)
92add_qml_test(Stages Splash)
92add_qml_test(Wizard Wizard)
93add_qml_test(Wizard Wizard)
tests/qmltests/Dash/Previews/tst_PreviewTable.qml+6−5
@@ -27,17 +27,18 @@ Rectangle {
27 color: Theme.palette.selected.background
27 color: Theme.palette.selected.background
28
28
29 property var widgetDataComplete: {
29 property var widgetDataComplete: {
30− "title": "Title here",
30+ "title": "Title here longa long long long long long long long long long long",
31− "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
31+ "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
32 }
32 }
33
33
34 property var widgetDataNoTitle: {
34 property var widgetDataNoTitle: {
35− "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
35+ "values": [ [ "Long Label 1", "Value 1"], [ "Label 2", "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2"], [ "Label 3", "Value 3"], [ "Label 4", "Value 4"], [ "Label 5", "Value 5"] ]
36 }
36 }
37
37
38− PreviewTable {
38+ PreviewWidgetFactory {
39 id: previewTable
39 id: previewTable
40 anchors { left: parent.left; right: parent.right }
40 anchors { left: parent.left; right: parent.right }
41+ widgetType: "table"
41 widgetData: widgetDataComplete
42 widgetData: widgetDataComplete
42
43
43 Rectangle {
44 Rectangle {
@@ -59,7 +60,7 @@ Rectangle {
59 compare(findChild(previewTable, "label00").text, "Long Label 1");
60 compare(findChild(previewTable, "label00").text, "Long Label 1");
60 compare(findChild(previewTable, "label01").text, "Value 1");
61 compare(findChild(previewTable, "label01").text, "Value 1");
61 compare(findChild(previewTable, "label10").text, "Label 2");
62 compare(findChild(previewTable, "label10").text, "Label 2");
62− compare(findChild(previewTable, "label11").text, "Long Value 2");
63+ compare(findChild(previewTable, "label11").text, "Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2 Long Value 2");
63 compare(findChild(previewTable, "label20").text, "Label 3");
64 compare(findChild(previewTable, "label20").text, "Label 3");
64 compare(findChild(previewTable, "label21").text, "Value 3");
65 compare(findChild(previewTable, "label21").text, "Value 3");
65 compare(findChild(previewTable, "label30").text, "Label 4");
66 compare(findChild(previewTable, "label30").text, "Label 4");
tests/qmltests/Stages/tst_WindowMoveResizeArea.qmlnew file+138
@@ -0,0 +1,138 @@
1+/*
2+ * Copyright 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.1
18+import QtQuick.Layouts 1.1
19+import QtTest 1.0
20+import Unity.Test 0.1 as UT
21+import ".."
22+import "../../../qml/Stages"
23+import Ubuntu.Components 0.1
24+import Ubuntu.Components.ListItems 1.0 as ListItem
25+import Unity.Application 0.1
26+
27+Item {
28+ id: root
29+ height: units.gu(60)
30+ width: units.gu(60)
31+
32+ Rectangle {
33+ id: fakeWindow
34+ height: units.gu(20)
35+ width: units.gu(20)
36+ color: "khaki"
37+ WindowMoveResizeArea {
38+ id: moveResizeArea
39+ target: fakeWindow
40+ resizeHandleWidth: units.gu(0.5)
41+ minWidth: units.gu(15)
42+ minHeight: units.gu(10)
43+ }
44+ }
45+
46+ UT.UnityTestCase {
47+ when: windowShown
48+
49+ function init() {
50+ fakeWindow.x = units.gu(20)
51+ fakeWindow.y = units.gu(20)
52+ fakeWindow.width = units.gu(20)
53+ fakeWindow.height = units.gu(20)
54+ }
55+
56+ function test_dragWindow_data() {
57+ return [
58+ { tag: "up", dx: 0, dy: units.gu(-10) },
59+ { tag: "down", dx: 0, dy: units.gu(10) },
60+ { tag: "left", dx: units.gu(-10), dy: 0 },
61+ { tag: "right", dx: units.gu(10), dy: 0 },
62+ { tag: "right/down", dx: units.gu(10), dy: units.gu(10) },
63+ { tag: "left/down", dx: units.gu(-10), dy: units.gu(10) }
64+ ]
65+ }
66+
67+ function test_dragWindow(data) {
68+ var initialWindowX = fakeWindow.x;
69+ var initialWindowY = fakeWindow.y;
70+ var initialWindowWidth = fakeWindow.width
71+ var initialWindowHeight = fakeWindow.height
72+
73+ var startDragX = initialWindowX + fakeWindow.width / 2;
74+ var startDragY = initialWindowY + fakeWindow.height / 2;
75+ mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, true, units.gu(.5), 10)
76+
77+ tryCompare(fakeWindow, "x", initialWindowX + data.dx)
78+ tryCompare(fakeWindow, "y", initialWindowX + data.dy)
79+
80+ compare(fakeWindow.height, initialWindowHeight);
81+ compare(fakeWindow.width, initialWindowWidth);
82+ }
83+
84+ function test_resizeWindowRightBottom_data() {
85+ return [
86+ { tag: "width", dx: units.gu(10), dy: 0 },
87+ { tag: "height", dx: 0, dy: units.gu(10) },
88+ { tag: "both", dx: units.gu(10), dy: units.gu(10) },
89+ { tag: "smaller than minimum size", dx: -units.gu(15), dy: -units.gu(15) }
90+ ]
91+ }
92+
93+ function test_resizeWindowRightBottom(data) {
94+ var initialWindowX = fakeWindow.x;
95+ var initialWindowY = fakeWindow.y;
96+ var initialWindowWidth = fakeWindow.width
97+ var initialWindowHeight = fakeWindow.height
98+
99+ var startDragX = initialWindowX + initialWindowWidth + 1
100+ var startDragY = initialWindowY + initialWindowHeight + 1
101+ mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, true, units.gu(.5), 10);
102+
103+ tryCompare(fakeWindow, "width", Math.max(initialWindowWidth + data.dx, moveResizeArea.minWidth));
104+ tryCompare(fakeWindow, "height", Math.max(initialWindowHeight + data.dy, moveResizeArea.minHeight));
105+
106+ compare(fakeWindow.x, initialWindowX);
107+ compare(fakeWindow.y, initialWindowY);
108+ }
109+
110+ function test_resizeWindowLeftTop_data() {
111+ return [
112+ { tag: "width", dx: -units.gu(10), dy: 0 },
113+ { tag: "height", dx: 0, dy: -units.gu(10) },
114+ { tag: "both", dx: -units.gu(10), dy: -units.gu(10) },
115+ { tag: "smaller than minimum size", dx: units.gu(15), dy: units.gu(15) }
116+ ]
117+ }
118+
119+ function test_resizeWindowLeftTop(data) {
120+ var initialWindowX = fakeWindow.x;
121+ var initialWindowY = fakeWindow.y;
122+ var initialWindowWidth = fakeWindow.width
123+ var initialWindowHeight = fakeWindow.height
124+
125+ var startDragX = initialWindowX - 1
126+ var startDragY = initialWindowY - 1
127+ mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, true, units.gu(.5), 10);
128+
129+ tryCompare(fakeWindow, "width", Math.max(initialWindowWidth - data.dx, moveResizeArea.minWidth));
130+ tryCompare(fakeWindow, "height", Math.max(initialWindowHeight - data.dy, moveResizeArea.minHeight));
131+
132+ var maxMoveX = initialWindowWidth - moveResizeArea.minWidth;
133+ var maxMoveY = initialWindowHeight - moveResizeArea.minHeight;
134+ compare(fakeWindow.x, Math.min(initialWindowX + data.dx, initialWindowX + maxMoveX));
135+ compare(fakeWindow.y, Math.min(initialWindowY + data.dy, initialWindowY + maxMoveY));
136+ }
137+ }
138+}