Merge lp:~nick-dedekind/unity8/remove.overview into lp:unity8
- remove.overview
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | MichaĆ Sawicz |
Approved revision: | 117 |
Merged at revision: | 120 |
Proposed branch: | lp:~nick-dedekind/unity8/remove.overview |
Merge into: | lp:unity8 |
Diff against target: |
1420 lines (+74/-879) 15 files modified
Panel/IndicatorRow.qml (+1/-2) Panel/Indicators.qml (+21/-44) Panel/MenuContent.qml (+8/-67) Panel/Menus/IndicatorMenuWindow.qml (+0/-35) Panel/Menus/Overview.qml (+0/-70) Panel/Menus/Overview/FlightModeWidget.qml (+0/-60) Panel/Menus/Overview/OverviewGrid.qml (+0/-135) Panel/Menus/Overview/VolumeWidget.qml (+0/-88) tests/qmltests/CMakeLists.txt (+0/-2) tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml (+0/-68) tests/qmltests/Panel/tst_IndicatorRow.qml (+0/-14) tests/qmltests/Panel/tst_Indicators.qml (+1/-39) tests/qmltests/Panel/tst_MenuContent.qml (+10/-80) tests/qmltests/Panel/tst_Overview.qml (+0/-142) tests/qmltests/Panel/tst_Panel.qml (+33/-33) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/remove.overview |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Daniel d'Andrada (community) | Approve | ||
Review via email: mp+175294@code.launchpad.net |
Commit message
Removed overview from indicators.
Description of the change
Removed overview from indicators.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:117
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
Quite many changes are solely fixing coding style. It distracts from the relevant changes of this patch.
Daniel d'Andrada (dandrader) wrote : | # |
All seems to work and changes look fine, even though you're piggybacking a coding style cleanup.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:117
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Nick Dedekind (nick-dedekind) wrote : | # |
> All seems to work and changes look fine, even though you're piggybacking a
> coding style cleanup.
Didn't want Saviq coming at me with semi-colon changes ;)
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'Panel/IndicatorRow.qml' |
2 | --- Panel/IndicatorRow.qml 2013-06-17 09:02:14 +0000 |
3 | +++ Panel/IndicatorRow.qml 2013-07-17 16:45:32 +0000 |
4 | @@ -24,7 +24,6 @@ |
5 | readonly property int currentItemIndex: currentItem ? currentItem.ownIndex : -1 |
6 | property alias row: row |
7 | property QtObject indicatorsModel: null |
8 | - property bool overviewActive: false // "state of the menu" |
9 | |
10 | Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic} } |
11 | |
12 | @@ -76,7 +75,7 @@ |
13 | height: indicatorRow.height |
14 | y: { |
15 | //FIXME: all indicators will be initial for now. |
16 | - if (!highlighted && !overviewActive && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) { |
17 | + if (!highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) { |
18 | return -indicatorRow.height |
19 | } else { |
20 | return 0 |
21 | |
22 | === modified file 'Panel/Indicators.qml' |
23 | --- Panel/Indicators.qml 2013-07-03 16:33:58 +0000 |
24 | +++ Panel/Indicators.qml 2013-07-17 16:45:32 +0000 |
25 | @@ -56,36 +56,22 @@ |
26 | |
27 | onHeightChanged: { |
28 | // need to use handle.get_height(). As the handle height depends on indicators.height changes (but this is called first!) |
29 | - var contentProgress = indicators.height - handle.get_height() |
30 | + var contentProgress = indicators.height - handle.get_height(); |
31 | if (!showAnimation.running && !hideAnimation.running) { |
32 | if (contentProgress <= hintValue && indicators.state == "reveal") { |
33 | - indicators.state = "hint" |
34 | - menuContent.hideAll() |
35 | + indicators.state = "hint"; |
36 | } else if (contentProgress > hintValue && contentProgress < lockThreshold) { |
37 | - menuContent.showMenu() |
38 | - indicators.state = "reveal" |
39 | + indicators.state = "reveal"; |
40 | } else if (contentProgress >= lockThreshold && lockThreshold > 0) { |
41 | - // If we've shown the overview and are closing the view with progress changes (revealer handle), |
42 | - // we dont want to switch to a indicator menu until we hit reveal state. |
43 | - if (menuContent.overviewActive) { |
44 | - menuContent.showOverview() |
45 | - } else { |
46 | - menuContent.showMenu() |
47 | - } |
48 | - indicators.state = "locked" |
49 | + indicators.state = "locked"; |
50 | } |
51 | } |
52 | |
53 | if (contentProgress == 0) { |
54 | - menuContent.releaseContent() |
55 | + menuContent.releaseContent(); |
56 | } |
57 | } |
58 | |
59 | - function openOverview() { |
60 | - indicatorRow.currentItem = null |
61 | - menuContent.showOverview() |
62 | - } |
63 | - |
64 | function calculateCurrentItem(xValue, useBuffer) { |
65 | var rowCoordinates |
66 | var itemCoordinates |
67 | @@ -93,7 +79,7 @@ |
68 | var distanceFromRightEdge |
69 | var bufferExceeded = false |
70 | |
71 | - if (indicators.state == "commit" || indicators.state == "locked" || showAnimation.running || hideAnimation.running) return |
72 | + if (indicators.state == "commit" || indicators.state == "locked" || showAnimation.running || hideAnimation.running) return; |
73 | |
74 | /* |
75 | If user drags the indicator handle bar down a distance hintValue or less, this is 0. |
76 | @@ -102,14 +88,14 @@ |
77 | */ |
78 | var verticalProgress = |
79 | MathLocal.clamp((indicators.height - handle.height - hintValue) / |
80 | - (lockThreshold - hintValue), 0, 1) |
81 | + (lockThreshold - hintValue), 0, 1); |
82 | |
83 | /* |
84 | Percentage of an indicator icon's width the user's press can stray horizontally from the |
85 | focused icon before we change focus to another icon. E.g. a value of 0.5 means you must |
86 | go right a distance of half an icon's width before focus moves to the icon on the right |
87 | */ |
88 | - var maxBufferThreshold = 0.5 |
89 | + var maxBufferThreshold = 0.5; |
90 | |
91 | /* |
92 | To help users find the indicator of their choice while opening the indicators, we add logic to add a |
93 | @@ -126,12 +112,12 @@ |
94 | itemCoordinates = indicatorRow.row.mapToItem(currentItem, rowCoordinates.x, 0); |
95 | distanceFromRightEdge = (currentItem.width - itemCoordinates.x) / (currentItem.width) |
96 | if (Math.abs(currentItem.ownIndex - indicatorRow.currentItemIndex) > 1) { |
97 | - bufferExceeded = true |
98 | + bufferExceeded = true; |
99 | } else { |
100 | if (indicatorRow.currentItemIndex < currentItem.ownIndex && distanceFromRightEdge < (1 - effectiveBufferThreshold)) { |
101 | - bufferExceeded = true |
102 | + bufferExceeded = true; |
103 | } else if (indicatorRow.currentItemIndex > currentItem.ownIndex && distanceFromRightEdge > effectiveBufferThreshold) { |
104 | - bufferExceeded = true |
105 | + bufferExceeded = true; |
106 | } |
107 | } |
108 | if ((!useBuffer || (useBuffer && bufferExceeded)) || indicatorRow.currentItem < 0 || indicatorRow.currentItem == null) { |
109 | @@ -172,8 +158,7 @@ |
110 | bottom: parent.bottom |
111 | } |
112 | indicatorsModel: indicatorsModel |
113 | - animate: false |
114 | - clip: indicators.partiallyOpened |
115 | + clip: !indicators.fullyOpened |
116 | |
117 | onMenuSelected: { |
118 | indicatorRow.setItem(index) |
119 | @@ -209,7 +194,7 @@ |
120 | clip: height < handleImage.height |
121 | |
122 | function get_height() { |
123 | - return Math.max(Math.min(handleImage.height, indicators.height - handleImage.height), 0) |
124 | + return Math.max(Math.min(handleImage.height, indicators.height - handleImage.height), 0); |
125 | } |
126 | |
127 | BorderImage { |
128 | @@ -264,7 +249,6 @@ |
129 | height: indicators.panelHeight |
130 | indicatorsModel: indicatorsModel |
131 | state: indicators.state |
132 | - overviewActive: menuContent.overviewActive |
133 | |
134 | onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex |
135 | |
136 | @@ -279,9 +263,10 @@ |
137 | onRunningChanged: { |
138 | if (hideAnimation.running) { |
139 | indicators.state = "initial" |
140 | - menuContent.hideAll() |
141 | } else { |
142 | - if (state == "initial") indicatorRow.setDefaultItem() |
143 | + if (state == "initial") { |
144 | + indicatorRow.setDefaultItem() |
145 | + } |
146 | } |
147 | } |
148 | } |
149 | @@ -289,13 +274,8 @@ |
150 | target: showAnimation |
151 | onRunningChanged: { |
152 | if (showAnimation.running) { |
153 | - if (indicators.state == "initial") { |
154 | - openOverview() |
155 | - } else { |
156 | - indicators.calculateCurrentItem(dragHandle.touchX, false) |
157 | - menuContent.showMenu() |
158 | - } |
159 | - indicators.state = "commit" |
160 | + indicators.calculateCurrentItem(dragHandle.touchX, false); |
161 | + indicators.state = "commit"; |
162 | } |
163 | } |
164 | } |
165 | @@ -303,8 +283,8 @@ |
166 | Connections { |
167 | target: dragHandle |
168 | onTouchXChanged: { |
169 | - var buffer = dragHandle.dragging ? true : false |
170 | - indicators.calculateCurrentItem(dragHandle.touchX, buffer) |
171 | + var buffer = dragHandle.dragging ? true : false; |
172 | + indicators.calculateCurrentItem(dragHandle.touchX, buffer); |
173 | } |
174 | } |
175 | |
176 | @@ -339,8 +319,7 @@ |
177 | |
178 | onStatusChanged: { |
179 | if (status === DirectionalDragArea.Recognized) { |
180 | - menuContent.hideAll() |
181 | - menuContent.activateContent() |
182 | + menuContent.activateContent(); |
183 | } |
184 | } |
185 | } |
186 | @@ -368,7 +347,6 @@ |
187 | State { |
188 | name: "reveal" |
189 | extend: "hint" |
190 | - PropertyChanges { target: menuContent; animate: true } |
191 | StateChangeScript { script: calculateCurrentItem(dragHandle.touchX, false); } |
192 | }, |
193 | State { |
194 | @@ -390,7 +368,6 @@ |
195 | }, |
196 | State { |
197 | name: "reveal" |
198 | - PropertyChanges { target: menuContent; animate: true } |
199 | StateChangeScript { script: calculateCurrentItem(dragHandle.touchX, false); } |
200 | }, |
201 | State { |
202 | |
203 | === modified file 'Panel/MenuContent.qml' |
204 | --- Panel/MenuContent.qml 2013-07-17 11:03:15 +0000 |
205 | +++ Panel/MenuContent.qml 2013-07-17 16:45:32 +0000 |
206 | @@ -17,16 +17,12 @@ |
207 | import QtQuick 2.0 |
208 | import Ubuntu.Components 0.1 |
209 | import Unity.Indicators 0.1 as Indicators |
210 | -import "Menus" |
211 | import "../Components" |
212 | |
213 | Rectangle { |
214 | id: content |
215 | |
216 | property QtObject indicatorsModel: null |
217 | - property bool animate: true // FIXME: Remove. This doesnt seem to be being used and it's referenced in Indicators. |
218 | - property bool overviewActive: true // "state of the menu" |
219 | - property bool __shown: false |
220 | property bool __contentActive: false |
221 | property alias currentIndex : menus.currentIndex |
222 | property color backgroundColor: "#221e1c" // FIXME not in palette yet |
223 | @@ -35,32 +31,17 @@ |
224 | width: units.gu(40) |
225 | height: units.gu(42) |
226 | color: backgroundColor |
227 | - enabled: __shown |
228 | |
229 | signal menuSelected(int index) |
230 | |
231 | - function showMenu() { |
232 | - __shown = true |
233 | - overviewActive = false |
234 | - } |
235 | - |
236 | - function showOverview() { |
237 | - __shown = true |
238 | - overviewActive = true |
239 | - } |
240 | - |
241 | - function hideAll() { |
242 | - __shown = false |
243 | - } |
244 | - |
245 | function activateContent() { |
246 | - contentReleaseTimer.stop() |
247 | - __contentActive = true |
248 | + contentReleaseTimer.stop(); |
249 | + __contentActive = true; |
250 | } |
251 | |
252 | function releaseContent() { |
253 | if (__contentActive) |
254 | - contentReleaseTimer.restart() |
255 | + contentReleaseTimer.restart(); |
256 | } |
257 | |
258 | ListView { |
259 | @@ -72,7 +53,6 @@ |
260 | width: parent.width |
261 | |
262 | spacing: units.gu(0.5) |
263 | - opacity: !overviewActive && __shown ? 1 : 0 |
264 | enabled: opacity != 0 |
265 | orientation: ListView.Horizontal |
266 | model: indicatorsModel |
267 | @@ -87,20 +67,19 @@ |
268 | |
269 | onContentActiveChanged: { |
270 | if (contentActive && item) { |
271 | - item.start() |
272 | + item.start(); |
273 | } else if (!contentActive && item) { |
274 | - item.stop() |
275 | + item.stop(); |
276 | } |
277 | } |
278 | |
279 | width: menus.width |
280 | height: menus.height |
281 | source: pageSource |
282 | - visible: content.__shown |
283 | onVisibleChanged: { |
284 | // Reset the indicator states |
285 | if (!visible && item && item["reset"]) { |
286 | - item.reset() |
287 | + item.reset(); |
288 | } |
289 | } |
290 | asynchronous: true |
291 | @@ -108,11 +87,11 @@ |
292 | onLoaded: { |
293 | for(var pName in indicatorProperties) { |
294 | if (item.hasOwnProperty(pName)) { |
295 | - item[pName] = indicatorProperties[pName] |
296 | + item[pName] = indicatorProperties[pName]; |
297 | } |
298 | } |
299 | if (contentActive && menus.visible) { |
300 | - item.start() |
301 | + item.start(); |
302 | } |
303 | } |
304 | |
305 | @@ -124,40 +103,6 @@ |
306 | value: handle.height |
307 | } |
308 | } |
309 | - |
310 | - Behavior on opacity { NumberAnimation {duration: 200} } |
311 | - } |
312 | - |
313 | - Overview { |
314 | - id: overview |
315 | - objectName: "overview" |
316 | - |
317 | - anchors.top: header.bottom |
318 | - anchors.bottom: parent.bottom |
319 | - // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin |
320 | - anchors.bottomMargin: handle.height |
321 | - |
322 | - width: content.width |
323 | - indicatorsModel: content.indicatorsModel |
324 | - enabled: content.overviewActive && content.__shown |
325 | - opacity: content.overviewActive && content.__shown ? 1 : 0 |
326 | - Behavior on opacity {NumberAnimation{duration: 200}} |
327 | - visible: opacity != 0 |
328 | - |
329 | - onMenuSelected: { |
330 | - var storedDuration = menus.highlightMoveDuration |
331 | - var storedVelocity = menus.highlightMoveVelocity |
332 | - menus.highlightMoveDuration = 0 |
333 | - menus.highlightMoveVelocity = 100000 |
334 | - |
335 | - menus.currentIndex = modelIndex |
336 | - content.overviewActive = false |
337 | - |
338 | - menus.highlightMoveDuration = storedDuration |
339 | - menus.highlightMoveVelocity = storedVelocity |
340 | - |
341 | - content.menuSelected(modelIndex) |
342 | - } |
343 | } |
344 | |
345 | Rectangle { |
346 | @@ -181,14 +126,10 @@ |
347 | right: parent.right |
348 | } |
349 | text: { |
350 | - if (content.overviewActive) |
351 | - return i18n.tr("Device"); |
352 | if (indicatorsModel && menus.currentIndex >= 0 && menus.currentIndex < indicatorsModel.count) |
353 | return indicatorsModel.data(menus.currentIndex, Indicators.IndicatorsModelRole.Title); |
354 | return ""; |
355 | } |
356 | - opacity: __shown ? 1 : 0 |
357 | - Behavior on opacity {NumberAnimation{duration: 100}} |
358 | } |
359 | } |
360 | |
361 | |
362 | === removed directory 'Panel/Menus' |
363 | === removed file 'Panel/Menus/IndicatorMenuWindow.qml' |
364 | --- Panel/Menus/IndicatorMenuWindow.qml 2013-06-05 22:03:08 +0000 |
365 | +++ Panel/Menus/IndicatorMenuWindow.qml 1970-01-01 00:00:00 +0000 |
366 | @@ -1,35 +0,0 @@ |
367 | -/* |
368 | - * Copyright (C) 2013 Canonical, Ltd. |
369 | - * |
370 | - * This program is free software; you can redistribute it and/or modify |
371 | - * it under the terms of the GNU General Public License as published by |
372 | - * the Free Software Foundation; version 3. |
373 | - * |
374 | - * This program is distributed in the hope that it will be useful, |
375 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
376 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
377 | - * GNU General Public License for more details. |
378 | - * |
379 | - * You should have received a copy of the GNU General Public License |
380 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
381 | - */ |
382 | - |
383 | -import QtQuick 2.0 |
384 | - |
385 | -Item { |
386 | - id: menuWindow |
387 | - |
388 | - property bool shown: false |
389 | - property int contentHeight: height |
390 | - property string headingText: name |
391 | - property string name |
392 | - |
393 | - enabled: shown |
394 | - opacity: shown ? 1.0 : 0.0 |
395 | - Behavior on opacity { NumberAnimation {duration: shown ? 300 : 150 } } |
396 | - |
397 | - // don't pass any events under this screen |
398 | - MouseArea { |
399 | - anchors.fill: parent |
400 | - } |
401 | -} |
402 | |
403 | === removed directory 'Panel/Menus/Overview' |
404 | === removed file 'Panel/Menus/Overview.qml' |
405 | --- Panel/Menus/Overview.qml 2013-06-05 22:03:08 +0000 |
406 | +++ Panel/Menus/Overview.qml 1970-01-01 00:00:00 +0000 |
407 | @@ -1,70 +0,0 @@ |
408 | -/* |
409 | - * Copyright (C) 2013 Canonical, Ltd. |
410 | - * |
411 | - * This program is free software; you can redistribute it and/or modify |
412 | - * it under the terms of the GNU General Public License as published by |
413 | - * the Free Software Foundation; version 3. |
414 | - * |
415 | - * This program is distributed in the hope that it will be useful, |
416 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
417 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
418 | - * GNU General Public License for more details. |
419 | - * |
420 | - * You should have received a copy of the GNU General Public License |
421 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
422 | - */ |
423 | - |
424 | -import QtQuick 2.0 |
425 | -import Ubuntu.Components 0.1 |
426 | -import "../../Components/ListItems" as ListItems |
427 | -import "Overview" |
428 | - |
429 | -IndicatorMenuWindow { |
430 | - id: overview |
431 | - |
432 | - property QtObject indicatorsModel: null |
433 | - |
434 | - signal menuSelected(int modelIndex) |
435 | - |
436 | - VisualItemModel { |
437 | - id: itemModel |
438 | - |
439 | - FlightModeWidget { |
440 | - anchors { |
441 | - left: parent ? parent.left : undefined |
442 | - right: parent ? parent.right : undefined |
443 | - } |
444 | - height: units.gu(8) |
445 | - |
446 | - ListItems.ThinDivider { |
447 | - anchors { |
448 | - bottom: parent.bottom |
449 | - bottomMargin: -units.dp(1) |
450 | - } |
451 | - } |
452 | - } |
453 | - |
454 | - VolumeWidget { |
455 | - anchors { |
456 | - left: parent ? parent.left : undefined |
457 | - right: parent ? parent.right : undefined |
458 | - } |
459 | - height: units.gu(10) |
460 | - } |
461 | - |
462 | - OverviewGrid { |
463 | - model: indicatorsModel |
464 | - anchors { |
465 | - left: parent ? parent.left : undefined |
466 | - right: parent ? parent.right : undefined |
467 | - } |
468 | - } |
469 | - } |
470 | - |
471 | - ListView { |
472 | - id: listView |
473 | - anchors.fill: parent |
474 | - model: itemModel |
475 | - interactive: false |
476 | - } |
477 | -} |
478 | |
479 | === removed file 'Panel/Menus/Overview/FlightModeWidget.qml' |
480 | --- Panel/Menus/Overview/FlightModeWidget.qml 2013-07-17 10:34:41 +0000 |
481 | +++ Panel/Menus/Overview/FlightModeWidget.qml 1970-01-01 00:00:00 +0000 |
482 | @@ -1,60 +0,0 @@ |
483 | -/* |
484 | - * Copyright (C) 2013 Canonical, Ltd. |
485 | - * |
486 | - * This program is free software; you can redistribute it and/or modify |
487 | - * it under the terms of the GNU General Public License as published by |
488 | - * the Free Software Foundation; version 3. |
489 | - * |
490 | - * This program is distributed in the hope that it will be useful, |
491 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
492 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
493 | - * GNU General Public License for more details. |
494 | - * |
495 | - * You should have received a copy of the GNU General Public License |
496 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
497 | - */ |
498 | - |
499 | -import QtQuick 2.0 |
500 | -import Ubuntu.Components 0.1 |
501 | - |
502 | -Item { |
503 | - id: flightModeWidget |
504 | - |
505 | - Image { |
506 | - id: flightIcon |
507 | - source: "graphics/plane_icon.png" |
508 | - anchors { |
509 | - left: parent.left |
510 | - leftMargin: units.gu(2) |
511 | - verticalCenter: parent.verticalCenter |
512 | - } |
513 | - width: units.gu(4) |
514 | - height: units.gu(4) |
515 | - } |
516 | - |
517 | - Label { |
518 | - anchors { |
519 | - left: flightIcon.right |
520 | - right: flightModeSwitch.left |
521 | - margins: units.gu(2) |
522 | - verticalCenter: parent.verticalCenter |
523 | - } |
524 | - text: i18n.tr("Flight mode") |
525 | - color: Theme.palette.selected.backgroundText |
526 | - style: Text.Raised |
527 | - styleColor: "black" |
528 | - opacity: 0.6; |
529 | - fontSize: "medium" |
530 | - elide: Text.ElideRight |
531 | - horizontalAlignment: Text.AlignLeft |
532 | - } |
533 | - |
534 | - Switch { |
535 | - id: flightModeSwitch |
536 | - anchors { |
537 | - right: parent.right |
538 | - rightMargin: units.gu(2) |
539 | - verticalCenter: parent.verticalCenter |
540 | - } |
541 | - } |
542 | -} |
543 | |
544 | === removed file 'Panel/Menus/Overview/OverviewGrid.qml' |
545 | --- Panel/Menus/Overview/OverviewGrid.qml 2013-07-17 11:03:15 +0000 |
546 | +++ Panel/Menus/Overview/OverviewGrid.qml 1970-01-01 00:00:00 +0000 |
547 | @@ -1,135 +0,0 @@ |
548 | -/* |
549 | - * Copyright (C) 2013 Canonical, Ltd. |
550 | - * |
551 | - * This program is free software; you can redistribute it and/or modify |
552 | - * it under the terms of the GNU General Public License as published by |
553 | - * the Free Software Foundation; version 3. |
554 | - * |
555 | - * This program is distributed in the hope that it will be useful, |
556 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
557 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
558 | - * GNU General Public License for more details. |
559 | - * |
560 | - * You should have received a copy of the GNU General Public License |
561 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
562 | - */ |
563 | - |
564 | -import QtQuick 2.0 |
565 | -import Ubuntu.Components 0.1 |
566 | - |
567 | -import "../../../Components/ListItems" as ListItems |
568 | - |
569 | -Item { |
570 | - id: overviewGrid |
571 | - |
572 | - height: childrenRect.height |
573 | - |
574 | - property var model |
575 | - |
576 | - UbuntuShape { |
577 | - id: gridBackground |
578 | - anchors.fill: grid |
579 | - color: "#282421" // FIXME missing palette |
580 | - radius: "medium" |
581 | - } |
582 | - |
583 | - GridView { |
584 | - id: grid |
585 | - objectName: "overviewGrid" |
586 | - |
587 | - property int columnCount: 3 |
588 | - property int rowCount: Math.ceil(model.count / columnCount) |
589 | - |
590 | - anchors { |
591 | - top: parent.top |
592 | - left: parent.left |
593 | - right: parent.right |
594 | - topMargin: units.gu(3) |
595 | - leftMargin: units.gu(2) |
596 | - rightMargin: units.gu(2) |
597 | - } |
598 | - height: cellWidth * rowCount |
599 | - cellWidth: Math.floor((width) / columnCount) |
600 | - cellHeight: cellWidth |
601 | - model: overviewGrid.model |
602 | - visible: opacity != 0 |
603 | - interactive: false |
604 | - delegate: |
605 | - AbstractButton { |
606 | - objectName: "overviewGridButton" + index |
607 | - width: grid.cellWidth |
608 | - height: grid.cellHeight |
609 | - |
610 | - Loader { |
611 | - id: loader |
612 | - source: widgetSource |
613 | - |
614 | - width: units.gu(5) |
615 | - height: units.gu(5) |
616 | - anchors.centerIn: parent |
617 | - anchors.verticalCenterOffset: -units.gu(1) |
618 | - |
619 | - onLoaded: { |
620 | - for(var pName in indicatorProperties) { |
621 | - if (item.hasOwnProperty(pName)) { |
622 | - item[pName] = indicatorProperties[pName] |
623 | - } |
624 | - } |
625 | - } |
626 | - } |
627 | - |
628 | - Label { |
629 | - text: title |
630 | - color: Theme.palette.selected.backgroundText |
631 | - fontSize: "small" |
632 | - anchors { |
633 | - left: parent.left |
634 | - right: parent.right |
635 | - bottom: parent.bottom |
636 | - leftMargin: units.gu(0.5) |
637 | - rightMargin: units.gu(0.5) |
638 | - bottomMargin: units.gu(1.5) |
639 | - } |
640 | - elide: Text.ElideRight |
641 | - horizontalAlignment: Text.AlignHCenter |
642 | - |
643 | - } |
644 | - onClicked: overview.menuSelected(index) |
645 | - } |
646 | - } |
647 | - |
648 | - Item { |
649 | - id: gridOverlay |
650 | - anchors.fill: grid |
651 | - |
652 | - Column { |
653 | - anchors { |
654 | - left: parent.left |
655 | - right: parent.right |
656 | - } |
657 | - spacing: grid.cellHeight |
658 | - y: grid.cellHeight - units.dp(1) |
659 | - Repeater { |
660 | - model: grid.rowCount - 1 |
661 | - ListItems.ThinDivider { |
662 | - anchors.margins: units.dp(1) |
663 | - } |
664 | - } |
665 | - } |
666 | - |
667 | - Row { |
668 | - anchors { |
669 | - top: parent.top |
670 | - bottom: parent.bottom |
671 | - } |
672 | - spacing: grid.cellWidth - units.dp(1) |
673 | - x: grid.cellWidth - units.dp(1) |
674 | - Repeater { |
675 | - model: grid.columnCount - 1 |
676 | - ListItems.VerticalThinDivider { |
677 | - anchors.margins: units.dp(1) |
678 | - } |
679 | - } |
680 | - } |
681 | - } |
682 | -} |
683 | |
684 | === removed file 'Panel/Menus/Overview/VolumeWidget.qml' |
685 | --- Panel/Menus/Overview/VolumeWidget.qml 2013-06-05 22:03:08 +0000 |
686 | +++ Panel/Menus/Overview/VolumeWidget.qml 1970-01-01 00:00:00 +0000 |
687 | @@ -1,88 +0,0 @@ |
688 | -/* |
689 | - * Copyright (C) 2013 Canonical, Ltd. |
690 | - * |
691 | - * This program is free software; you can redistribute it and/or modify |
692 | - * it under the terms of the GNU General Public License as published by |
693 | - * the Free Software Foundation; version 3. |
694 | - * |
695 | - * This program is distributed in the hope that it will be useful, |
696 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
697 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
698 | - * GNU General Public License for more details. |
699 | - * |
700 | - * You should have received a copy of the GNU General Public License |
701 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
702 | - */ |
703 | - |
704 | -import QtQuick 2.0 |
705 | -import Ubuntu.Components 0.1 |
706 | -import "../../../Components/" |
707 | - |
708 | -Item { |
709 | - id: volumeWidget |
710 | - |
711 | - Image { |
712 | - id: minVolumeIcon |
713 | - objectName: "minVolumeIcon" |
714 | - source: "graphics/sound_off_icon.png" |
715 | - anchors { |
716 | - left: parent.left |
717 | - leftMargin: units.gu(2) |
718 | - verticalCenter: parent.verticalCenter |
719 | - } |
720 | - width: units.gu(4) |
721 | - height: units.gu(4) |
722 | - |
723 | - MouseArea { |
724 | - anchors.fill: parent |
725 | - onClicked: volumeControl.volumeDown(); |
726 | - } |
727 | - } |
728 | - |
729 | - Slider { |
730 | - id: slider |
731 | - objectName: "volumeSlider" |
732 | - anchors { |
733 | - left: minVolumeIcon.right |
734 | - right: maxVolumeIcon.left |
735 | - margins: units.gu(1) |
736 | - verticalCenter: parent.verticalCenter |
737 | - } |
738 | - live: false |
739 | - minimumValue: 0 |
740 | - maximumValue: 100 |
741 | - value: 50 |
742 | - |
743 | - onValueChanged: { |
744 | - volumeControl.volume = value; |
745 | - } |
746 | - |
747 | - Binding { |
748 | - target: slider |
749 | - property: "value" |
750 | - value: volumeControl.volume |
751 | - } |
752 | - |
753 | - function formatValue(v) { |
754 | - return "" |
755 | - } |
756 | - } |
757 | - |
758 | - Image { |
759 | - id: maxVolumeIcon |
760 | - objectName: "maxVolumeIcon" |
761 | - source: "graphics/sound_on_icon.png" |
762 | - anchors { |
763 | - right: parent.right |
764 | - rightMargin: units.gu(2) |
765 | - verticalCenter: parent.verticalCenter |
766 | - } |
767 | - width: units.gu(4) |
768 | - height: units.gu(4) |
769 | - |
770 | - MouseArea { |
771 | - anchors.fill: parent |
772 | - onClicked: volumeControl.volumeUp(); |
773 | - } |
774 | - } |
775 | -} |
776 | |
777 | === removed directory 'Panel/Menus/Overview/graphics' |
778 | === removed file 'Panel/Menus/Overview/graphics/plane_icon@18.png' |
779 | Binary files Panel/Menus/Overview/graphics/plane_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/plane_icon@18.png 1970-01-01 00:00:00 +0000 differ |
780 | === removed file 'Panel/Menus/Overview/graphics/sound_off_icon@18.png' |
781 | Binary files Panel/Menus/Overview/graphics/sound_off_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/sound_off_icon@18.png 1970-01-01 00:00:00 +0000 differ |
782 | === removed file 'Panel/Menus/Overview/graphics/sound_on_icon@18.png' |
783 | Binary files Panel/Menus/Overview/graphics/sound_on_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/sound_on_icon@18.png 1970-01-01 00:00:00 +0000 differ |
784 | === modified file 'tests/qmltests/CMakeLists.txt' |
785 | --- tests/qmltests/CMakeLists.txt 2013-07-11 09:09:20 +0000 |
786 | +++ tests/qmltests/CMakeLists.txt 2013-07-17 16:45:32 +0000 |
787 | @@ -61,10 +61,8 @@ |
788 | add_qml_test(Panel IndicatorRow) |
789 | add_qml_test(Panel Indicators IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
790 | add_qml_test(Panel MenuContent) |
791 | -add_qml_test(Panel Overview) |
792 | add_qml_test(Panel Panel IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
793 | add_qml_test(Panel SearchIndicator) |
794 | -add_qml_test(Panel/Menus IndicatorMenuWindow IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}) |
795 | add_qml_test(SideStage SideStage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} |
796 | ${CMAKE_BINARY_DIR}/tests/mocks |
797 | ${CMAKE_BINARY_DIR}/plugins) |
798 | |
799 | === removed directory 'tests/qmltests/Panel/Menus' |
800 | === removed file 'tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml' |
801 | --- tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml 2013-06-05 22:03:08 +0000 |
802 | +++ tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml 1970-01-01 00:00:00 +0000 |
803 | @@ -1,68 +0,0 @@ |
804 | -/* |
805 | - * Copyright 2013 Canonical Ltd. |
806 | - * |
807 | - * This program is free software; you can redistribute it and/or modify |
808 | - * it under the terms of the GNU General Public License as published by |
809 | - * the Free Software Foundation; version 3. |
810 | - * |
811 | - * This program is distributed in the hope that it will be useful, |
812 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
813 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
814 | - * GNU General Public License for more details. |
815 | - * |
816 | - * You should have received a copy of the GNU General Public License |
817 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
818 | - */ |
819 | - |
820 | -import QtQuick 2.0 |
821 | -import QtTest 1.0 |
822 | -import "../.." |
823 | -import "../../../../Panel/Menus" |
824 | -import Ubuntu.Components 0.1 |
825 | -import Unity.Test 0.1 as UT |
826 | - |
827 | -Item { |
828 | - id: testIndicatorMenuWindowItem |
829 | - width: units.gu(9) |
830 | - height: units.gu(3) |
831 | - |
832 | - MouseArea { |
833 | - id: mouseArea |
834 | - anchors.fill: parent |
835 | - } |
836 | - |
837 | - IndicatorMenuWindow { |
838 | - id: indicatorMenuWindow |
839 | - name: "TestIndicatorMenuWindow" |
840 | - anchors.fill: parent |
841 | - } |
842 | - |
843 | - UT.UnityTestCase { |
844 | - name: "IndicatorMenuWindow" |
845 | - when: windowShown |
846 | - |
847 | - function test_mouseEvent_data() { |
848 | - return [ |
849 | - {tag: "visible", shown: true, opacity: 1.0, mouseClicks: 0}, |
850 | - {tag: "invisible", shown: false, opacity: 0.0, mouseClicks: 1}, |
851 | - ] |
852 | - } |
853 | - |
854 | - function test_mouseEvent(data) { |
855 | - indicatorMenuWindow.shown = data.shown |
856 | - tryCompare(indicatorMenuWindow, "opacity", data.opacity) |
857 | - |
858 | - clickedSpy.clear() |
859 | - mouseClick(indicatorMenuWindow, indicatorMenuWindow.width / 2, |
860 | - indicatorMenuWindow.height / 2) |
861 | - compare(clickedSpy.count, data.mouseClicks, |
862 | - "Check for Mouse event eating by indicatorMenuWindow failed") |
863 | - } |
864 | - } |
865 | - |
866 | - SignalSpy { |
867 | - id: clickedSpy |
868 | - target: mouseArea |
869 | - signalName: "clicked" |
870 | - } |
871 | -} |
872 | |
873 | === modified file 'tests/qmltests/Panel/tst_IndicatorRow.qml' |
874 | --- tests/qmltests/Panel/tst_IndicatorRow.qml 2013-07-03 15:39:46 +0000 |
875 | +++ tests/qmltests/Panel/tst_IndicatorRow.qml 2013-07-17 16:45:32 +0000 |
876 | @@ -32,7 +32,6 @@ |
877 | |
878 | function init_test() |
879 | { |
880 | - indicatorRow.overviewActive = false; |
881 | indicatorRow.state = "initial"; |
882 | indicatorRow.currentItem = null; |
883 | } |
884 | @@ -241,18 +240,5 @@ |
885 | compare(get_indicator_item_at(3).dimmed, true, "Other indicators should dim when in locked state"); |
886 | compare(get_indicator_item_at(4).dimmed, true, "Other indicators should dim when in locked state"); |
887 | } |
888 | - |
889 | - function test_active_overview() { |
890 | - init_test(); |
891 | - |
892 | - indicatorRow.overviewActive = true; |
893 | - indicatorRow.state = "commit"; |
894 | - |
895 | - compare(get_indicator_item_at(0).dimmed, true, "Indicator should dim when in overview"); |
896 | - compare(get_indicator_item_at(1).dimmed, true, "Indicator should dim when in overview"); |
897 | - compare(get_indicator_item_at(2).dimmed, true, "Indicator should dim when in overview"); |
898 | - compare(get_indicator_item_at(3).dimmed, true, "Indicator should dim when in overview"); |
899 | - compare(get_indicator_item_at(4).dimmed, true, "Indicator should dim when in overview"); |
900 | - } |
901 | } |
902 | } |
903 | |
904 | === modified file 'tests/qmltests/Panel/tst_Indicators.qml' |
905 | --- tests/qmltests/Panel/tst_Indicators.qml 2013-07-03 16:33:58 +0000 |
906 | +++ tests/qmltests/Panel/tst_Indicators.qml 2013-07-17 16:45:32 +0000 |
907 | @@ -69,7 +69,6 @@ |
908 | |
909 | onClicked: { |
910 | if (!indicators.shown) { |
911 | - indicators.openOverview(); |
912 | indicators.show(); |
913 | } else { |
914 | indicators.hide(); |
915 | @@ -89,47 +88,10 @@ |
916 | tryCompare(indicators, "state", "initial"); |
917 | } |
918 | |
919 | - // Showing the indicators should fully open the indicator panel with the overview menu visible. |
920 | + // Showing the indicators should fully open the indicator panel. |
921 | function test_show() { |
922 | indicators.show() |
923 | tryCompare(indicators, "fullyOpened", true); |
924 | - |
925 | - // A show must open the indicators. |
926 | - compare(findChild(indicators, "indicatorRow").overviewActive, true, "Overview indicator should be active when opened overview.") |
927 | - } |
928 | - |
929 | - // Opening the overview menu will activate the overview panel. |
930 | - function test_open_overview() { |
931 | - indicators.openOverview(); |
932 | - compare(findChild(indicators, "indicatorRow").overviewActive, true, "Overview should be active when opened overview.") |
933 | - } |
934 | - |
935 | - // Showing the indicators, then changing the progress (simulating drag) should keep the overview panel open until |
936 | - // the reveal state is reached. |
937 | - function test_slow_close_open_overview() { |
938 | - |
939 | - var indicator_row = findChild(indicators, "indicatorRow"); |
940 | - verify(indicator_row != undefined); |
941 | - |
942 | - indicators.show() |
943 | - // wait for animation to end. (progress needs to be updated) |
944 | - tryCompare(indicators.showAnimation, "running", false); |
945 | - compare(indicator_row.overviewActive, true, "Overview should be active when opened overview.") |
946 | - |
947 | - // iteratively decrease the progress and ensure that it keeps the correct behaviour |
948 | - var current_progress = indicators.progress - shell.height/20; |
949 | - while (current_progress > 0) { |
950 | - indicators.progress = current_progress; |
951 | - |
952 | - if (indicators.state == "commit" || indicators.state == "locked") { |
953 | - compare(indicator_row.overviewActive, true, "Overview should be active when in locked or commit state after show.") |
954 | - } |
955 | - else if (indicators.state == "reveal" || indicators.state == "hint") { |
956 | - compare(indicator_row.overviewActive, false, "Overview should be not active when not in commit or locked state.") |
957 | - } |
958 | - |
959 | - current_progress = current_progress - shell.height/20; |
960 | - } |
961 | } |
962 | |
963 | // Test the change in the revealer lateral position changes the current panel menu to fit the position |
964 | |
965 | === modified file 'tests/qmltests/Panel/tst_MenuContent.qml' |
966 | --- tests/qmltests/Panel/tst_MenuContent.qml 2013-06-17 08:14:24 +0000 |
967 | +++ tests/qmltests/Panel/tst_MenuContent.qml 2013-07-17 16:45:32 +0000 |
968 | @@ -52,8 +52,8 @@ |
969 | height: parent.height - 50 |
970 | } |
971 | |
972 | - Item { |
973 | - id: click_me |
974 | + Rectangle { |
975 | + color: "#bbbbbb" |
976 | |
977 | height: 50 |
978 | anchors { |
979 | @@ -62,50 +62,16 @@ |
980 | right: parent.right |
981 | } |
982 | |
983 | - Rectangle { |
984 | - color: "#999999" |
985 | - |
986 | - anchors { |
987 | - top: parent.top |
988 | - left: parent.left |
989 | - right: parent.horizontalCenter |
990 | - bottom: parent.bottom |
991 | - } |
992 | - |
993 | - Text { |
994 | - text: "Devices" |
995 | - anchors.fill: parent |
996 | - horizontalAlignment: Text.AlignHCenter |
997 | - verticalAlignment: Text.AlignVCenter |
998 | - } |
999 | - |
1000 | - MouseArea { |
1001 | - anchors.fill: parent |
1002 | - onClicked: menuContent.showOverview() |
1003 | - } |
1004 | + Text { |
1005 | + text: "Next Indicator" |
1006 | + anchors.fill: parent |
1007 | + horizontalAlignment: Text.AlignHCenter |
1008 | + verticalAlignment: Text.AlignVCenter |
1009 | } |
1010 | |
1011 | - Rectangle { |
1012 | - color: "#bbbbbb" |
1013 | - |
1014 | - anchors { |
1015 | - top: parent.top |
1016 | - left: parent.horizontalCenter |
1017 | - right: parent.right |
1018 | - bottom: parent.bottom |
1019 | - } |
1020 | - |
1021 | - Text { |
1022 | - text: "Next Indicator" |
1023 | - anchors.fill: parent |
1024 | - horizontalAlignment: Text.AlignHCenter |
1025 | - verticalAlignment: Text.AlignVCenter |
1026 | - } |
1027 | - |
1028 | - MouseArea { |
1029 | - anchors.fill: parent |
1030 | - onClicked: activate_next_content() |
1031 | - } |
1032 | + MouseArea { |
1033 | + anchors.fill: parent |
1034 | + onClicked: activate_next_content() |
1035 | } |
1036 | } |
1037 | |
1038 | @@ -120,7 +86,6 @@ |
1039 | function activate_content(index) |
1040 | { |
1041 | menuContent.currentIndex = index |
1042 | - menuContent.showMenu(); |
1043 | } |
1044 | |
1045 | function get_test_menu_objecName(index) { |
1046 | @@ -151,7 +116,6 @@ |
1047 | when: windowShown |
1048 | |
1049 | function init() { |
1050 | - menuContent.hideAll(); |
1051 | if (menuContent.__contentActive) |
1052 | menuContent.releaseContent(); |
1053 | tryCompare(menuContent, "__contentActive", false); |
1054 | @@ -174,40 +138,6 @@ |
1055 | compare(menus.currentIndex, menu_index, "Current menu index does not match selected menu index"); |
1056 | tryCompareFunction(current_menu_equals_test_menu, true); |
1057 | } |
1058 | - // overview should not be visible. |
1059 | - tryCompare(findChild(menuContent, "overview"), "visible", false); |
1060 | - } |
1061 | - |
1062 | - function test_show_overview() { |
1063 | - menuContent.showOverview(); |
1064 | - |
1065 | - var overview = findChild(menuContent, "overview"); |
1066 | - tryCompare(overview, "visible", true); |
1067 | - tryCompare(overview, "enabled", true); |
1068 | - tryCompare(overview, "opacity", 1.0); |
1069 | - |
1070 | - // menus should not be enabled. |
1071 | - tryCompare(findChild(menuContent, "menus"), "opacity", 0); |
1072 | - tryCompare(findChild(menuContent, "menus"), "enabled", false); |
1073 | - } |
1074 | - |
1075 | - function test_overview_menuSelected_signal() { |
1076 | - menuContent.showOverview(); |
1077 | - |
1078 | - var overview = findChild(menuContent, "overview"); |
1079 | - var menus = menu_content_test.findChild(menuContent, "menus") |
1080 | - |
1081 | - var menu_count = indicatorsModel.count; |
1082 | - verify(menu_count > 0, "Menu count should be greater than zero"); |
1083 | - for (var i = 0; i < menu_count; i++) { |
1084 | - // manually emit signal from overview. |
1085 | - // we dont want to go with mouse events here, otherwise we're testing the overview and not the signal. |
1086 | - overview.menuSelected(i); |
1087 | - |
1088 | - test_menu_objectName = get_test_menu_objecName(i); |
1089 | - compare(menus.currentIndex, i, "Current menu index does not match selected menu index"); |
1090 | - tryCompareFunction(current_menu_equals_test_menu, true); |
1091 | - } |
1092 | } |
1093 | |
1094 | // Calling activateContent should call start on all menus |
1095 | |
1096 | === removed file 'tests/qmltests/Panel/tst_Overview.qml' |
1097 | --- tests/qmltests/Panel/tst_Overview.qml 2013-06-18 18:02:29 +0000 |
1098 | +++ tests/qmltests/Panel/tst_Overview.qml 1970-01-01 00:00:00 +0000 |
1099 | @@ -1,142 +0,0 @@ |
1100 | -/* |
1101 | - * Copyright 2013 Canonical Ltd. |
1102 | - * |
1103 | - * This program is free software; you can redistribute it and/or modify |
1104 | - * it under the terms of the GNU General Public License as published by |
1105 | - * the Free Software Foundation; version 3. |
1106 | - * |
1107 | - * This program is distributed in the hope that it will be useful, |
1108 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1109 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1110 | - * GNU General Public License for more details. |
1111 | - * |
1112 | - * You should have received a copy of the GNU General Public License |
1113 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1114 | - */ |
1115 | - |
1116 | -import QtQuick 2.0 |
1117 | -import QtTest 1.0 |
1118 | -import ".." |
1119 | -import "../../../Panel/Menus" |
1120 | -import "../../../Components" |
1121 | -import Unity.Test 0.1 as UT |
1122 | -import Unity.Indicators 0.1 as Indicators |
1123 | - |
1124 | -Rectangle { |
1125 | - id: shell |
1126 | - width: units.gu(40) |
1127 | - height: units.gu(80) |
1128 | - color: "black" |
1129 | - |
1130 | - Overview { |
1131 | - id: overview |
1132 | - anchors.fill: parent |
1133 | - indicatorsModel: mockModel |
1134 | - shown: true |
1135 | - } |
1136 | - |
1137 | - Item { |
1138 | - id: volumeControl |
1139 | - property int volume |
1140 | - function volumeUp() { |
1141 | - volume = Math.min(100, volume + 10); |
1142 | - } |
1143 | - function volumeDown() { |
1144 | - volume = Math.max(0, volume - 10); |
1145 | - } |
1146 | - } |
1147 | - |
1148 | - ListModel { |
1149 | - id: mockModel |
1150 | - ListElement {title: "fake1"; widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget1.qml"; indicatorProperties: ""} |
1151 | - ListElement {title: "fake2"; widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget2.qml"; indicatorProperties: ""} |
1152 | - ListElement {title: "fake3"; widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget3.qml"; indicatorProperties: ""} |
1153 | - } |
1154 | - |
1155 | - ListModel { |
1156 | - id: mockModel2 |
1157 | - } |
1158 | - |
1159 | - SignalSpy { |
1160 | - id: clickSpy |
1161 | - target: overview |
1162 | - signalName: "menuSelected" |
1163 | - } |
1164 | - |
1165 | - UT.UnityTestCase { |
1166 | - name: "Overview" |
1167 | - when: windowShown |
1168 | - |
1169 | - function initTestCase() { |
1170 | - // Spin the event loop once because the UI builds up delayed |
1171 | - wait(0); |
1172 | - } |
1173 | - |
1174 | - function test_menuSelected() { |
1175 | - overview.indicatorsModel = mockModel; |
1176 | - |
1177 | - for (var i = 0; i < mockModel.count; ++i) { |
1178 | - var button = findChild(overview, "overviewGridButton" + i); |
1179 | - clickSpy.clear(); |
1180 | - mouseClick(button, button.width / 2, button.height / 2); |
1181 | - compare(clickSpy.count, 1, "Clicking on grid didn't work"); |
1182 | - compare(clickSpy.signalArguments[0][0], i, "Clicking the grid returned a wrong index"); |
1183 | - } |
1184 | - } |
1185 | - |
1186 | - function test_dynamic_addition() { |
1187 | - var overviewGrid = findChild(overview, "overviewGrid"); |
1188 | - |
1189 | - for(var i = 0; i < mockModel.count; ++i) { |
1190 | - mockModel2.append(mockModel.get(i)); |
1191 | - } |
1192 | - overview.indicatorsModel = mockModel2; |
1193 | - overviewGrid.forceLayout(); |
1194 | - waitForRendering(overviewGrid); |
1195 | - |
1196 | - var button = findChild(overview, "overviewGridButton2"); |
1197 | - verify(button !== undefined, "button2 wasn't found"); |
1198 | - button = findChild(overview, "overviewGridButton3"); |
1199 | - compare(button, undefined, "There should only be 3 buttons... found at least 4..."); |
1200 | - |
1201 | - mockModel2.append({title: "humppa", widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget4.qml", indicatorProperties: ""}) |
1202 | - overviewGrid.forceLayout(); |
1203 | - waitForRendering(overviewGrid); |
1204 | - |
1205 | - button = findChild(overview, "overviewGridButton3"); |
1206 | - verify(button !== undefined, "button3 wasn't found"); |
1207 | - } |
1208 | - |
1209 | - function test_volume_slider_data() { |
1210 | - return [ |
1211 | - {tag: "0%", sliderPos:0}, |
1212 | - {tag: "100%", sliderPos: 100}, |
1213 | - {tag: "50%", sliderPos: 50} |
1214 | - ]; |
1215 | - } |
1216 | - |
1217 | - function test_volume_slider(data) { |
1218 | - var volumeSlider = findChild(overview, "volumeSlider"); |
1219 | - var startX = volumeSlider.width * volumeSlider.value / 100; |
1220 | - var startY = volumeSlider.y + volumeSlider.height / 2; |
1221 | - var stopX = (volumeSlider.width - units.gu(5)) * data.sliderPos / 100; |
1222 | - var stopY = volumeSlider.y + volumeSlider.height / 2; |
1223 | - mouseFlick(volumeSlider, startX, startY, stopX, stopY, true, true, 0.1); |
1224 | - } |
1225 | - |
1226 | - function test_volume_buttons(data) { |
1227 | - var volumeDownButton = findChild(overview, "minVolumeIcon"); |
1228 | - var volumeUpButton = findChild(overview, "maxVolumeIcon"); |
1229 | - |
1230 | - for (var i = 0; i < 10; ++i) { |
1231 | - mouseClick(volumeDownButton, volumeDownButton.width / 2, volumeDownButton.height / 2); |
1232 | - wait(0) |
1233 | - } |
1234 | - tryCompare(volumeControl, "volume", 0); |
1235 | - for (var i = 0; i < 10; ++i) { |
1236 | - mouseClick(volumeUpButton, 1, 1); |
1237 | - wait(0) |
1238 | - } |
1239 | - } |
1240 | - } |
1241 | -} |
1242 | |
1243 | === modified file 'tests/qmltests/Panel/tst_Panel.qml' |
1244 | --- tests/qmltests/Panel/tst_Panel.qml 2013-07-03 16:33:58 +0000 |
1245 | +++ tests/qmltests/Panel/tst_Panel.qml 2013-07-17 16:45:32 +0000 |
1246 | @@ -62,14 +62,14 @@ |
1247 | |
1248 | function get_indicator_item(index) { |
1249 | var row_repeater = findChild(panel.indicators, "rowRepeater"); |
1250 | - verify(row_repeater != undefined) |
1251 | + verify(row_repeater != undefined); |
1252 | return row_repeater.itemAt(index); |
1253 | } |
1254 | |
1255 | function get_indicator_item_position(index) { |
1256 | |
1257 | var indicator_row = findChild(panel.indicators, "indicatorRow"); |
1258 | - verify(indicator_row != undefined) |
1259 | + verify(indicator_row != undefined); |
1260 | |
1261 | var indicator_item = get_indicator_item(index); |
1262 | verify(indicator_item != undefined); |
1263 | @@ -83,11 +83,11 @@ |
1264 | panel.fullscreenMode = false; |
1265 | // Wait for the indicators to get into position. |
1266 | // (switches between normal and fullscreen modes are animated) |
1267 | - tryCompare(panel.indicators, "y", 0) |
1268 | + tryCompare(panel.indicators, "y", 0); |
1269 | |
1270 | var indicator_item_coord = get_indicator_item_position(0); |
1271 | |
1272 | - touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2) |
1273 | + touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2); |
1274 | |
1275 | // hint animation should be run, meaning that indicators will move downwards |
1276 | // by hintValue pixels without any drag taking place |
1277 | @@ -96,7 +96,7 @@ |
1278 | tryCompare(panel.indicators, "partiallyOpened", true); |
1279 | tryCompare(panel.indicators, "fullyOpened", false); |
1280 | |
1281 | - touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2) |
1282 | + touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2); |
1283 | } |
1284 | |
1285 | // Pressing on the top edge of the screen should have no effect if the panel |
1286 | @@ -105,31 +105,31 @@ |
1287 | panel.fullscreenMode = true; |
1288 | // Wait for the indicators to get into position. |
1289 | // (switches between normal and fullscreen modes are animated) |
1290 | - tryCompare(panel.indicators, "y", -panel.panelHeight) |
1291 | + tryCompare(panel.indicators, "y", -panel.panelHeight); |
1292 | |
1293 | var indicator_item_coord = get_indicator_item_position(0); |
1294 | |
1295 | - touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2) |
1296 | + touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2); |
1297 | |
1298 | // Give some time for a hint animation to change things, if any |
1299 | - wait(500) |
1300 | + wait(500); |
1301 | |
1302 | // no hint animation when fullscreen |
1303 | - compare(panel.indicators.y, -panel.panelHeight) |
1304 | + compare(panel.indicators.y, -panel.panelHeight); |
1305 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); |
1306 | - verify(indicatorRow != undefined) |
1307 | - compare(indicatorRow.y, 0) |
1308 | - compare(panel.indicators.height, panel.indicators.panelHeight) |
1309 | + verify(indicatorRow != undefined); |
1310 | + compare(indicatorRow.y, 0); |
1311 | + compare(panel.indicators.height, panel.indicators.panelHeight); |
1312 | compare(panel.indicators.partiallyOpened, false, |
1313 | "Indicator should not be partially opened when panel is pressed in" + |
1314 | - " fullscreenmode") |
1315 | + " fullscreenmode"); |
1316 | compare(panel.indicators.fullyOpened, false, "Indicator should not be partially" + |
1317 | - " opened when panel is pressed in fullscreenmode") |
1318 | + " opened when panel is pressed in fullscreenmode"); |
1319 | |
1320 | - touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2) |
1321 | + touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2); |
1322 | } |
1323 | |
1324 | - function test_drag_show_data() { return get_window_data() } |
1325 | + function test_drag_show_data() { return get_window_data(); } |
1326 | |
1327 | // Dragging from a indicator item in the panel will gradually expose the |
1328 | // indicators, first by running the hint animation, then after dragging down will |
1329 | @@ -138,50 +138,50 @@ |
1330 | panel.fullscreenMode = data.fullscreenFlag; |
1331 | |
1332 | var indicator_row = findChild(panel.indicators, "indicatorRow"); |
1333 | - verify(indicator_row != undefined) |
1334 | + verify(indicator_row != undefined); |
1335 | |
1336 | var row_repeater = findChild(panel.indicators, "rowRepeater"); |
1337 | - verify(indicator_row != undefined) |
1338 | + verify(indicator_row != undefined); |
1339 | |
1340 | var menu_content = findChild(panel.indicators, "menuContent"); |
1341 | - verify(indicator_row != undefined) |
1342 | + verify(indicator_row != undefined); |
1343 | |
1344 | // Wait for the indicators to get into position. |
1345 | // (switches between normal and fullscreen modes are animated) |
1346 | if (data.fullscreenFlag) { |
1347 | - tryCompare(panel.indicators, "y", -panel.panelHeight) |
1348 | + tryCompare(panel.indicators, "y", -panel.panelHeight); |
1349 | } else { |
1350 | - tryCompare(panel.indicators, "y", 0) |
1351 | + tryCompare(panel.indicators, "y", 0); |
1352 | } |
1353 | |
1354 | // do this for each indicator item |
1355 | for (var i = 0; i < row_repeater.count; i++) { |
1356 | |
1357 | var indicator_item = get_indicator_item(i); |
1358 | - verify(indicator_item != undefined) |
1359 | + verify(indicator_item != undefined); |
1360 | |
1361 | var indicator_item_coord = get_indicator_item_position(i); |
1362 | |
1363 | touchPress(panel, |
1364 | - indicator_item_coord.x, panel.panelHeight / 2) |
1365 | + indicator_item_coord.x, panel.panelHeight / 2); |
1366 | |
1367 | // 1) Drag the mouse down |
1368 | touchFlick(panel, |
1369 | indicator_item_coord.x, panel.panelHeight / 2, |
1370 | indicator_item_coord.x, panel.height * 0.8, |
1371 | - false /* beginTouch */, false /* endTouch */) |
1372 | + false /* beginTouch */, false /* endTouch */); |
1373 | |
1374 | // Indicators height should follow the drag, and therefore increase accordingly. |
1375 | // They should be at least half-way through the screen |
1376 | tryCompareFunction( |
1377 | function() {return panel.indicators.height >= panel.height * 0.5}, |
1378 | - true) |
1379 | + true); |
1380 | |
1381 | - touchRelease(panel, indicator_item_coord.x, panel.height * 0.8) |
1382 | + touchRelease(panel, indicator_item_coord.x, panel.height * 0.8); |
1383 | |
1384 | compare(indicator_row.currentItem, indicator_item, |
1385 | - "Incorrect item activated at position " + i) |
1386 | - compare(menu_content.__shown, true, "Menu conetent should be enabled for item at position " + i); |
1387 | + "Incorrect item activated at position " + i); |
1388 | + compare(menu_content.currentIndex, i, "Menu conetent should be enabled for item at position " + i); |
1389 | |
1390 | // init for next indicator_item |
1391 | init(); |
1392 | @@ -195,23 +195,23 @@ |
1393 | var search_indicator = findChild(panel, "search"); |
1394 | verify(search_indicator != undefined); |
1395 | |
1396 | - tap(search_indicator, 1, 1) |
1397 | + tap(search_indicator, 1, 1); |
1398 | |
1399 | compare(search_clicked, true, |
1400 | - "Tapping search indicator while it was enabled did not emit searchClicked signal") |
1401 | + "Tapping search indicator while it was enabled did not emit searchClicked signal"); |
1402 | } |
1403 | |
1404 | function test_search_click_when_not_visible() { |
1405 | panel.fullscreenMode = false; |
1406 | - panel.searchVisible = false |
1407 | + panel.searchVisible = false; |
1408 | |
1409 | var search_indicator = findChild(panel, "search"); |
1410 | verify(search_indicator != undefined); |
1411 | |
1412 | - tap(search_indicator, 1, 1) |
1413 | + tap(search_indicator, 1, 1); |
1414 | |
1415 | compare(search_clicked, false, |
1416 | - "Tapping search indicator while it was not visible emitted searchClicked signal") |
1417 | + "Tapping search indicator while it was not visible emitted searchClicked signal"); |
1418 | } |
1419 | } |
1420 | } |
FAILED: Continuous integration, rev:116 jenkins. qa.ubuntu. com/job/ unity8- ci/301/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/1205 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- saucy/656 jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/300/ console jenkins. qa.ubuntu. com/job/ unity8- saucy-i386- ci/301 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy/1209 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy/1209/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- saucy/1030
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ unity8- ci/301/ rebuild
http://