Merge lp:~timo-jyrinki/ubuntu-calendar-app/revert_213_that_reverted_212 into lp:ubuntu-calendar-app
- revert_213_that_reverted_212
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Timo Jyrinki |
Proposed branch: | lp:~timo-jyrinki/ubuntu-calendar-app/revert_213_that_reverted_212 |
Merge into: | lp:ubuntu-calendar-app |
Diff against target: |
741 lines (+266/-223) 8 files modified
DayView.qml (+3/-4) MonthView.qml (+12/-17) WeekView.qml (+74/-76) YearView.qml (+63/-61) calendar.qml (+100/-49) tests/autopilot/calendar_app/emulators.py (+0/-3) tests/autopilot/calendar_app/tests/__init__.py (+1/-4) tests/autopilot/calendar_app/tests/test_calendar.py (+13/-9) |
To merge this branch: | bzr merge lp:~timo-jyrinki/ubuntu-calendar-app/revert_213_that_reverted_212 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roman Shchekin (community) | Needs Fixing | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Needs Fixing | |
Ubuntu Calendar Developers | Pending | ||
Review via email: mp+212422@code.launchpad.net |
Commit message
Revert bzr213 that reverted bzr212, taking into account conflicts in calendar.qml and WeekView.qml.
Description of the change
The qtdeclarative upload https:/
Note that because of newer commits 217, 219 and 220 there were conflicts in WeekView.qml and calendar.qml which I tried to workaround.
The original commit that was temporarily reverted was this one:
http://
Timo Jyrinki (timo-jyrinki) wrote : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:221
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Roman Shchekin (mrqtros) wrote : | # |
Throws a lot of errors similar to
"ReferenceError: yearView is not defined".
Timo Jyrinki (timo-jyrinki) wrote : | # |
Right. It seems to conflict with current trunk again. I think it'd be best revisited by the original author of the LoaderPage branch.
Unmerged revisions
- 221. By Timo Jyrinki
-
Revert bzr213 that reverted bzr212, taking into accound conflicts in calendar.qml and WeekView.qml.
Preview Diff
1 | === modified file 'DayView.qml' |
2 | --- DayView.qml 2014-03-22 04:43:11 +0000 |
3 | +++ DayView.qml 2014-03-24 13:57:47 +0000 |
4 | @@ -4,7 +4,8 @@ |
5 | import "dateExt.js" as DateExt |
6 | import "ViewType.js" as ViewType |
7 | |
8 | -Item{ |
9 | + |
10 | +Page{ |
11 | id: root |
12 | objectName: "DayView" |
13 | |
14 | @@ -13,13 +14,11 @@ |
15 | |
16 | Column { |
17 | id: column |
18 | + anchors.fill: parent |
19 | anchors.top: parent.top |
20 | anchors.topMargin: units.gu(1.5) |
21 | - width: parent.width; height: parent.height |
22 | spacing: units.gu(1) |
23 | |
24 | - anchors.fill: parent |
25 | - |
26 | ViewHeader{ |
27 | id: viewHeader |
28 | date: currentDay |
29 | |
30 | === modified file 'MonthView.qml' |
31 | --- MonthView.qml 2014-03-19 19:46:58 +0000 |
32 | +++ MonthView.qml 2014-03-24 13:57:47 +0000 |
33 | @@ -3,23 +3,18 @@ |
34 | import "dateExt.js" as DateExt |
35 | import "colorUtils.js" as Color |
36 | |
37 | -Page { |
38 | - id: monthViewPage |
39 | - objectName: "MonthView" |
40 | +Page{ |
41 | + id: root |
42 | |
43 | property var currentMonth: DateExt.today(); |
44 | - |
45 | signal dateSelected(var date); |
46 | |
47 | + anchors.fill: parent |
48 | + |
49 | PathViewBase{ |
50 | id: monthViewPath |
51 | - |
52 | - property var startMonth: currentMonth; |
53 | - |
54 | - anchors.top:parent.top |
55 | - |
56 | - width:parent.width |
57 | - height: parent.height |
58 | + objectName: "MonthView" |
59 | + anchors.fill: parent |
60 | |
61 | onNextItemHighlighted: { |
62 | nextMonth(); |
63 | @@ -30,11 +25,11 @@ |
64 | } |
65 | |
66 | function nextMonth() { |
67 | - currentMonth = addMonth(currentMonth,1); |
68 | + currentMonth = addMonth(root.currentMonth,1); |
69 | } |
70 | |
71 | function previousMonth(){ |
72 | - currentMonth = addMonth(currentMonth,-1); |
73 | + currentMonth = addMonth(root.currentMonth,-1); |
74 | } |
75 | |
76 | function addMonth(date,month){ |
77 | @@ -54,16 +49,16 @@ |
78 | function getMonthDate() { |
79 | switch( monthViewPath.indexType(index)) { |
80 | case 0: |
81 | - return monthViewPath.startMonth; |
82 | + return monthViewPath.addMonth(root.currentMonth,0); |
83 | case -1: |
84 | - return monthViewPath.addMonth(monthViewPath.startMonth,-1); |
85 | + return monthViewPath.addMonth(root.currentMonth,-1); |
86 | case 1: |
87 | - return monthViewPath.addMonth(monthViewPath.startMonth,1); |
88 | + return monthViewPath.addMonth(root.currentMonth,1); |
89 | } |
90 | } |
91 | |
92 | onDateSelected: { |
93 | - monthViewPage.dateSelected(date); |
94 | + root.dateSelected(date); |
95 | } |
96 | } |
97 | } |
98 | |
99 | === modified file 'WeekView.qml' |
100 | --- WeekView.qml 2014-03-23 14:27:31 +0000 |
101 | +++ WeekView.qml 2014-03-24 13:57:47 +0000 |
102 | @@ -4,75 +4,87 @@ |
103 | import "dateExt.js" as DateExt |
104 | import "ViewType.js" as ViewType |
105 | |
106 | -Column { |
107 | +Page{ |
108 | id: root |
109 | - objectName: "WeekView" |
110 | - |
111 | property var dayStart: new Date(); |
112 | property var firstDay: dayStart.weekStart(Qt.locale().firstDayOfWeek); |
113 | property bool isCurrentPage: false |
114 | |
115 | - anchors.top: parent.top |
116 | - anchors.topMargin: units.gu(1.5) |
117 | - spacing: units.gu(1) |
118 | - |
119 | - anchors.fill: parent |
120 | - |
121 | - ViewHeader{ |
122 | - id: viewHeader |
123 | - date: dayStart |
124 | - } |
125 | - |
126 | - TimeLineHeader{ |
127 | - id: weekHeader |
128 | - objectName: "weekHeader" |
129 | - type: ViewType.ViewTypeWeek |
130 | - date: weekViewPath.weekStart |
131 | - } |
132 | - |
133 | - PathViewBase{ |
134 | - id: weekViewPath |
135 | - |
136 | - property var visibleWeek: dayStart.weekStart(Qt.locale().firstDayOfWeek); |
137 | - property var weekStart: weekViewPath.visibleWeek |
138 | - |
139 | - width: parent.width |
140 | - height: root.height - weekViewPath.y |
141 | - |
142 | - //This is used to scroll all view together when currentItem scrolls |
143 | - property var childContentY; |
144 | - |
145 | - onNextItemHighlighted: { |
146 | - nextWeek(); |
147 | - weekHeader.incrementCurrentIndex() |
148 | - } |
149 | - |
150 | - onPreviousItemHighlighted: { |
151 | - previousWeek(); |
152 | - weekHeader.decrementCurrentIndex() |
153 | - } |
154 | - |
155 | - function nextWeek() { |
156 | - var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek); |
157 | - dayStart = weekStartDay.addDays(7); |
158 | - } |
159 | - |
160 | - function previousWeek(){ |
161 | - var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek); |
162 | - dayStart = weekStartDay.addDays(-7); |
163 | - } |
164 | - |
165 | - delegate: TimeLineBaseComponent { |
166 | - id: timeLineView |
167 | - |
168 | - type: ViewType.ViewTypeWeek |
169 | + Column { |
170 | + objectName: "WeekView" |
171 | + |
172 | + anchors.fill: parent |
173 | + anchors.top: parent.top |
174 | + anchors.topMargin: units.gu(1.5) |
175 | + spacing: units.gu(1) |
176 | + |
177 | + ViewHeader{ |
178 | + id: viewHeader |
179 | + date: dayStart |
180 | + } |
181 | + |
182 | + TimeLineHeader{ |
183 | + id: weekHeader |
184 | + objectName: "weekHeader" |
185 | + type: typeWeek |
186 | + date: weekViewPath.weekStart |
187 | + } |
188 | + |
189 | + PathViewBase{ |
190 | + id: weekViewPath |
191 | + |
192 | + //This is used to scroll all view together when currentItem scrolls |
193 | + property var childContentY; |
194 | + |
195 | + property var visibleWeek: root.dayStart.weekStart(Qt.locale().firstDayOfWeek); |
196 | + property var weekStart: weekViewPath.visibleWeek |
197 | |
198 | width: parent.width |
199 | - height: parent.height |
200 | - |
201 | - startDay: getWeekStart(); |
202 | - |
203 | - Connections{ |
204 | + height: root.height - weekViewPath.y |
205 | + |
206 | + onNextItemHighlighted: { |
207 | + nextWeek(); |
208 | + weekHeader.incrementCurrentIndex() |
209 | + } |
210 | + |
211 | + onPreviousItemHighlighted: { |
212 | + previousWeek(); |
213 | + weekHeader.decrementCurrentIndex() |
214 | + } |
215 | + |
216 | + function nextWeek() { |
217 | + var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek); |
218 | + dayStart = weekStartDay.addDays(7); |
219 | + } |
220 | + |
221 | + function previousWeek(){ |
222 | + var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek); |
223 | + dayStart = weekStartDay.addDays(-7); |
224 | + } |
225 | + |
226 | + delegate: TimeLineBaseComponent { |
227 | + id: timeLineView |
228 | + |
229 | + type: typeWeek |
230 | + |
231 | + width: parent.width |
232 | + height: parent.height |
233 | + startDay: getWeekStart(); |
234 | + |
235 | + function getWeekStart() { |
236 | + switch( weekViewPath.indexType(index)) { |
237 | + case 0: |
238 | + return weekViewPath.weekStart; |
239 | + case -1: |
240 | + var weekStartDay= weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek); |
241 | + return weekStartDay.addDays(-7); |
242 | + case 1: |
243 | + var weekStartDay = weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek); |
244 | + return weekStartDay.addDays(7); |
245 | + } |
246 | + } |
247 | + } |
248 | + Connections{ |
249 | target: root |
250 | onIsCurrentPageChanged:{ |
251 | if(root.isCurrentPage){ |
252 | @@ -97,20 +109,6 @@ |
253 | when: timeLineView.PathView.isCurrentItem |
254 | } |
255 | |
256 | - function getWeekStart() { |
257 | - switch( weekViewPath.indexType(index)) { |
258 | - case 0: |
259 | - return weekViewPath.weekStart; |
260 | - case -1: |
261 | - var weekStartDay= weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek); |
262 | - return weekStartDay.addDays(-7); |
263 | - case 1: |
264 | - var weekStartDay = weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek); |
265 | - return weekStartDay.addDays(7); |
266 | - } |
267 | - } |
268 | } |
269 | } |
270 | } |
271 | - |
272 | - |
273 | |
274 | === modified file 'YearView.qml' |
275 | --- YearView.qml 2014-03-19 19:46:58 +0000 |
276 | +++ YearView.qml 2014-03-24 13:57:47 +0000 |
277 | @@ -3,76 +3,78 @@ |
278 | |
279 | import "dateExt.js" as DateExt |
280 | |
281 | -PathViewBase { |
282 | +Page { |
283 | id: root |
284 | objectName: "YearView" |
285 | - |
286 | property var currentYear: DateExt.today(); |
287 | - |
288 | signal monthSelected(var date); |
289 | |
290 | - anchors.fill: parent |
291 | - |
292 | - onNextItemHighlighted: { |
293 | - currentYear = getDateFromYear(currentYear.getFullYear() + 1); |
294 | - } |
295 | - |
296 | - onPreviousItemHighlighted: { |
297 | - currentYear = getDateFromYear(currentYear.getFullYear() - 1); |
298 | - } |
299 | - |
300 | - function getDateFromYear(year) { |
301 | - return new Date(year,0,1,0,0,0,0); |
302 | - } |
303 | - |
304 | - delegate: GridView{ |
305 | - id: yearView |
306 | - clip: true |
307 | - |
308 | - property bool isCurrentItem: index == root.currentIndex |
309 | - property var year: getYear(); |
310 | - |
311 | - function getYear() { |
312 | - switch( root.indexType(index)) { |
313 | - case 0: |
314 | - return currentYear; |
315 | - case -1: |
316 | - return getDateFromYear(currentYear.getFullYear() - 1); |
317 | - case 1: |
318 | - return getDateFromYear(currentYear.getFullYear() + 1); |
319 | + PathViewBase { |
320 | + id: pathView |
321 | + |
322 | + anchors.fill: parent |
323 | + |
324 | + onNextItemHighlighted: { |
325 | + root.currentYear = pathView.getDateFromYear(root.currentYear.getFullYear() + 1); |
326 | + } |
327 | + |
328 | + onPreviousItemHighlighted: { |
329 | + root.currentYear = pathView.getDateFromYear(root.currentYear.getFullYear() - 1); |
330 | + } |
331 | + |
332 | + function getDateFromYear(year) { |
333 | + return new Date(year,0,1,0,0,0,0); |
334 | + } |
335 | + |
336 | + delegate: GridView{ |
337 | + id: yearView |
338 | + clip: true |
339 | + |
340 | + property bool isCurrentItem: index == pathView.currentIndex |
341 | + property var year: getYear(); |
342 | + |
343 | + function getYear() { |
344 | + switch( pathView.indexType(index)) { |
345 | + case 0: |
346 | + return root.currentYear; |
347 | + case -1: |
348 | + return pathView.getDateFromYear(root.currentYear.getFullYear() - 1); |
349 | + case 1: |
350 | + return pathView.getDateFromYear(root.currentYear.getFullYear() + 1); |
351 | + } |
352 | } |
353 | - } |
354 | - |
355 | - width: parent.width |
356 | - height: parent.height |
357 | - anchors.top: parent.top |
358 | - |
359 | - readonly property int minCellWidth: units.gu(30) |
360 | - cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n) |
361 | + |
362 | + width: parent.width |
363 | + height: parent.height |
364 | + anchors.top: parent.top |
365 | + |
366 | + readonly property int minCellWidth: units.gu(30) |
367 | + cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n) |
368 | { return ((width / n >= minCellWidth) ? width / n : width / 2) }))) |
369 | |
370 | - cellHeight: cellWidth * 1.4 |
371 | - |
372 | - model: 12 /* months in a year */ |
373 | - delegate: Item { |
374 | - width: yearView.cellWidth |
375 | - height: yearView.cellHeight |
376 | - |
377 | - MonthComponent{ |
378 | - id: monthComponent |
379 | - monthDate: new Date(yearView.year.getFullYear(),index,1,0,0,0,0) |
380 | - anchors.fill: parent |
381 | - anchors.margins: units.gu(0.5) |
382 | - |
383 | - dayLabelFontSize:"x-small" |
384 | - dateLabelFontSize: "medium" |
385 | - monthLabelFontSize: "medium" |
386 | - yearLabelFontSize: "small" |
387 | - |
388 | - MouseArea{ |
389 | + cellHeight: cellWidth * 1.4 |
390 | + |
391 | + model: 12 /* months in a year */ |
392 | + delegate: Item { |
393 | + width: yearView.cellWidth |
394 | + height: yearView.cellHeight |
395 | + |
396 | + MonthComponent{ |
397 | + id: monthComponent |
398 | + monthDate: new Date(yearView.year.getFullYear(),index,1,0,0,0,0) |
399 | anchors.fill: parent |
400 | - onClicked: { |
401 | - root.monthSelected(monthComponent.monthDate); |
402 | + anchors.margins: units.gu(0.5) |
403 | + |
404 | + dayLabelFontSize:"x-small" |
405 | + dateLabelFontSize: "medium" |
406 | + monthLabelFontSize: "medium" |
407 | + yearLabelFontSize: "small" |
408 | + |
409 | + MouseArea{ |
410 | + anchors.fill: parent |
411 | + onClicked: { |
412 | + root.monthSelected(monthComponent.monthDate); |
413 | + } |
414 | } |
415 | } |
416 | } |
417 | |
418 | === modified file 'calendar.qml' |
419 | --- calendar.qml 2014-03-23 14:21:46 +0000 |
420 | +++ calendar.qml 2014-03-24 13:57:47 +0000 |
421 | @@ -81,14 +81,16 @@ |
422 | yearView.currentYear = tabPage.currentDay.midnight(); |
423 | } |
424 | |
425 | - if( monthView.currentMonth !== undefined && !monthView.currentMonth.isSameDay(currentDay)) |
426 | - monthView.currentMonth = currentDay.midnight(); |
427 | - |
428 | - if( !dayView.currentDay.isSameDay(currentDay)) |
429 | - dayView.currentDay = currentDay |
430 | - |
431 | - if( !weekView.dayStart.isSameDay(currentDay)) |
432 | - weekView.dayStart = currentDay |
433 | + if( monthPage.item |
434 | + && monthPage.item.currentMonth !== undefined |
435 | + && !monthPage.item.currentMonth.isSameDay(currentDay)) |
436 | + monthPage.item.currentMonth = currentDay.midnight(); |
437 | + |
438 | + if( dayPage.item && !dayPage.item.currentDay.isSameDay(currentDay)) |
439 | + dayPage.item.currentDay = currentDay |
440 | + |
441 | + if( weekPage.item && !weekPage.item.dayStart.isSameDay(currentDay)) |
442 | + weekPage.item.dayStart = currentDay |
443 | |
444 | setStartEndDateToModel(); |
445 | } |
446 | @@ -138,13 +140,13 @@ |
447 | var difference = endTime - startTime; |
448 | |
449 | if (difference > month) |
450 | - return 0; // Year view |
451 | + return yearTab.index; // Year view |
452 | else if (difference > 7 * day) |
453 | - return 1; // Month view} |
454 | + return monthTab.index; // Month view} |
455 | else if (difference > day) |
456 | - return 2; // Week view |
457 | + return weekTab.index; // Week view |
458 | else |
459 | - return 3; // Day view |
460 | + return dayTab.index; // Day view |
461 | } |
462 | |
463 | // This function parse the argument |
464 | @@ -183,17 +185,17 @@ |
465 | } |
466 | else { |
467 | // If no endtime has been setted, open the starttime date in day view |
468 | - tabs.selectedTabIndex = 3; |
469 | + tabs.selectedTabIndex = dayTab.index; |
470 | } |
471 | } // End of else if (starttime) |
472 | else { |
473 | // Due to bug #1231558 {if (args.defaultArgument.at(0))} is always true |
474 | // After the fix we can delete this else |
475 | - tabs.selectedTabIndex= 1; |
476 | + tabs.selectedTabIndex = monthTab.index; |
477 | } |
478 | } // End of if about args.values |
479 | else { |
480 | - tabs.selectedTabIndex= 1; |
481 | + tabs.selectedTabIndex = monthTab.index; |
482 | } |
483 | |
484 | globalModel = GlobalModel.globalModel(); |
485 | @@ -240,56 +242,95 @@ |
486 | id: tabs |
487 | |
488 | Tab{ |
489 | + id: yearTab |
490 | objectName: "yearTab" |
491 | title: i18n.tr("Year") |
492 | - page: Page{ |
493 | + page: Loader{ |
494 | + id: yearPage |
495 | objectName: "yearPage" |
496 | - anchors.fill: parent |
497 | - tools: commonToolBar |
498 | - YearView{ |
499 | - id: yearView |
500 | + anchors { |
501 | + top: parent.top |
502 | + left: parent.left |
503 | + right: parent.right |
504 | + bottom: parent.bottom |
505 | + } |
506 | + source: (tabs.selectedTab === yearTab) ? Qt.resolvedUrl("YearView.qml") : "" |
507 | + |
508 | + onLoaded:{ |
509 | + item.tools = commonToolBar |
510 | + } |
511 | + |
512 | + Connections{ |
513 | + target: yearPage.item |
514 | onMonthSelected: { |
515 | - tabs.selectedTabIndex = 1 |
516 | + tabs.selectedTabIndex = monthTab.index |
517 | var now = DateExt.today(); |
518 | if( date.getMonth() === now.getMonth() |
519 | && date.getFullYear() === now.getFullYear()) { |
520 | - monthView.currentMonth = now |
521 | + tabPage.currentDay = now; |
522 | } else { |
523 | - monthView.currentMonth = date.midnight(); |
524 | + tabPage.currentDay = date.midnight(); |
525 | } |
526 | } |
527 | } |
528 | } |
529 | } |
530 | + |
531 | Tab { |
532 | id: monthTab |
533 | objectName: "monthTab" |
534 | title: i18n.tr("Month") |
535 | - page: MonthView{ |
536 | - anchors.fill: parent |
537 | - tools: commonToolBar |
538 | - id: monthView |
539 | - |
540 | - onDateSelected: { |
541 | - tabs.selectedTabIndex = 3 |
542 | - tabPage.currentDay = date; |
543 | + |
544 | + page: Loader{ |
545 | + id: monthPage |
546 | + anchors { |
547 | + top: parent.top |
548 | + left: parent.left |
549 | + right: parent.right |
550 | + bottom: parent.bottom |
551 | + } |
552 | + |
553 | + source: (tabs.selectedTab === monthTab) ? Qt.resolvedUrl("MonthView.qml") : "" |
554 | + |
555 | + onLoaded: { |
556 | + item.currentMonth = tabPage.currentDay.midnight(); |
557 | + item.tools = commonToolBar |
558 | + } |
559 | + |
560 | + Connections{ |
561 | + target: monthPage.item |
562 | + onDateSelected: { |
563 | + tabs.selectedTabIndex = dayTab.index |
564 | + tabPage.currentDay = date; |
565 | + } |
566 | } |
567 | } |
568 | } |
569 | + |
570 | Tab{ |
571 | id: weekTab |
572 | objectName: "weekTab" |
573 | title: i18n.tr("Week") |
574 | - page: Page{ |
575 | - anchors.fill: parent |
576 | - tools: commonToolBar |
577 | - WeekView{ |
578 | - id: weekView |
579 | - anchors.fill: parent |
580 | - isCurrentPage: tabs.selectedTab == weekTab |
581 | - |
582 | + |
583 | + page: Loader{ |
584 | + id: weekPage |
585 | + anchors { |
586 | + top: parent.top |
587 | + left: parent.left |
588 | + right: parent.right |
589 | + bottom: parent.bottom |
590 | + } |
591 | + source: (tabs.selectedTab === weekTab) ? Qt.resolvedUrl("WeekView.qml") : "" |
592 | + |
593 | + onLoaded: { |
594 | + item.dayStart = tabPage.currentDay; |
595 | + item.tools = commonToolBar |
596 | + } |
597 | + |
598 | + Connections{ |
599 | + target: weekPage.item |
600 | onDayStartChanged: { |
601 | - tabPage.currentDay = dayStart; |
602 | + tabPage.currentDay = weekPage.item.dayStart; |
603 | } |
604 | } |
605 | } |
606 | @@ -299,16 +340,26 @@ |
607 | id: dayTab |
608 | objectName: "dayTab" |
609 | title: i18n.tr("Day") |
610 | - page: Page{ |
611 | - anchors.fill: parent |
612 | - tools: commonToolBar |
613 | - DayView{ |
614 | - id: dayView |
615 | - anchors.fill: parent |
616 | - isCurrentPage: tabs.selectedTab == dayTab |
617 | - |
618 | + |
619 | + page: Loader{ |
620 | + id: dayPage |
621 | + anchors { |
622 | + top: parent.top |
623 | + left: parent.left |
624 | + right: parent.right |
625 | + bottom: parent.bottom |
626 | + } |
627 | + source: (tabs.selectedTab === dayTab) ? Qt.resolvedUrl("DayView.qml") : "" |
628 | + |
629 | + onLoaded: { |
630 | + item.currentDay = tabPage.currentDay; |
631 | + item.tools = commonToolBar |
632 | + } |
633 | + |
634 | + Connections{ |
635 | + target: dayPage.item |
636 | onCurrentDayChanged: { |
637 | - tabPage.currentDay = currentDay; |
638 | + tabPage.currentDay = dayPage.item.currentDay; |
639 | } |
640 | } |
641 | } |
642 | |
643 | === modified file 'tests/autopilot/calendar_app/emulators.py' |
644 | --- tests/autopilot/calendar_app/emulators.py 2014-03-20 02:42:05 +0000 |
645 | +++ tests/autopilot/calendar_app/emulators.py 2014-03-24 13:57:47 +0000 |
646 | @@ -103,6 +103,3 @@ |
647 | def get_month_name(self, component): |
648 | return component.wait_select_single( |
649 | "Label", objectName="monthLabel").text |
650 | - |
651 | - def get_num_events(self): |
652 | - return len(self.select_many("EventBubble")) |
653 | |
654 | === modified file 'tests/autopilot/calendar_app/tests/__init__.py' |
655 | --- tests/autopilot/calendar_app/tests/__init__.py 2014-03-20 16:13:43 +0000 |
656 | +++ tests/autopilot/calendar_app/tests/__init__.py 2014-03-24 13:57:47 +0000 |
657 | @@ -73,7 +73,6 @@ |
658 | self.launch_test_click() |
659 | |
660 | def launch_test_local(self): |
661 | - logger.debug("Running via local installation") |
662 | self.app = self.launch_test_application( |
663 | "qmlscene", |
664 | self.local_location, |
665 | @@ -81,7 +80,6 @@ |
666 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
667 | |
668 | def launch_test_installed(self): |
669 | - logger.debug("Running via installed debian package") |
670 | self.app = self.launch_test_application( |
671 | "qmlscene", |
672 | self.installed_location, |
673 | @@ -89,7 +87,6 @@ |
674 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
675 | |
676 | def launch_test_click(self): |
677 | - logger.debug("Running via click package") |
678 | self.app = self.launch_click_package( |
679 | "com.ubuntu.calendar", |
680 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
681 | @@ -125,4 +122,4 @@ |
682 | |
683 | @property |
684 | def main_view(self): |
685 | - return self.app.wait_select_single(emulators.MainView) |
686 | + return self.app.select_single(emulators.MainView) |
687 | |
688 | === modified file 'tests/autopilot/calendar_app/tests/test_calendar.py' |
689 | --- tests/autopilot/calendar_app/tests/test_calendar.py 2014-03-20 03:02:48 +0000 |
690 | +++ tests/autopilot/calendar_app/tests/test_calendar.py 2014-03-24 13:57:47 +0000 |
691 | @@ -11,7 +11,7 @@ |
692 | |
693 | from autopilot.matchers import Eventually |
694 | |
695 | -from testtools.matchers import Equals, Not, Is, NotEquals |
696 | +from testtools.matchers import Equals, Not, Is |
697 | |
698 | import time |
699 | |
700 | @@ -46,10 +46,6 @@ |
701 | |
702 | def test_new_event(self): |
703 | """test add new event """ |
704 | - #go to today |
705 | - self.main_view.switch_to_tab("dayTab") |
706 | - self.main_view.open_toolbar().click_button("todaybutton") |
707 | - num_events = self.main_view.get_num_events() |
708 | |
709 | #click on new event button |
710 | self.main_view.open_toolbar().click_button("neweventbutton") |
711 | @@ -72,7 +68,7 @@ |
712 | ok = picker.select_single("Button", objectName="TimePickerOKButton") |
713 | self.pointing_device.click_object(ok) |
714 | |
715 | - ## Set the end time |
716 | + # Set the end time |
717 | end_time_field = self.main_view.get_event_end_time_field() |
718 | self.pointing_device.click_object(end_time_field) |
719 | picker = self.main_view.get_time_picker() |
720 | @@ -87,10 +83,18 @@ |
721 | self.keyboard.type("My location") |
722 | self.assertThat(location_field.text, Eventually(Equals("My location"))) |
723 | |
724 | + #input people |
725 | + people_field = self.main_view.get_event_people_field() |
726 | + self.pointing_device.click_object(people_field) |
727 | + self.assertThat(people_field.activeFocus, Eventually(Equals(True))) |
728 | + self.keyboard.type("Me") |
729 | + self.assertThat(people_field.text, Eventually(Equals("Me"))) |
730 | + |
731 | #click save button |
732 | self.main_view.open_toolbar().click_button("eventSaveButton") |
733 | |
734 | #verify that the event has been created in timeline |
735 | - self.main_view.open_toolbar().click_button("todaybutton") |
736 | - self.assertThat(self.main_view.get_num_events, |
737 | - Eventually(NotEquals(num_events))) |
738 | + self.main_view.switch_to_tab("dayTab") |
739 | + self.assertThat(lambda: self.main_view.get_label_with_text( |
740 | + eventTitle, root=self.main_view.get_day_view()), |
741 | + Eventually(Not(Is(None)))) |
I've just manually tested on desktop going through the views, which seem to now work (I needed to adjust the curly braces in WeekView.qml a bit from my initial conflict resolve).