Merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/ViewRedisign into lp:ubuntu-calendar-app

Proposed by Nekhelesh Ramananthan
Status: Rejected
Rejected by: Nekhelesh Ramananthan
Proposed branch: lp:~ubuntu-calendar-dev/ubuntu-calendar-app/ViewRedisign
Merge into: lp:ubuntu-calendar-app
Diff against target: 1334 lines (+414/-412)
21 files modified
AgendaView.qml (+20/-2)
AllDayEventComponent.qml (+2/-0)
DayView.qml (+90/-102)
EventActions.qml (+59/-0)
HeaderDateComponent.qml (+29/-25)
MonthComponent.qml (+63/-69)
MonthView.qml (+27/-3)
NewEvent.qml (+0/-21)
ScrollAnimation.qml (+0/-7)
TimeLineBackground.qml (+9/-10)
TimeLineBaseComponent.qml (+10/-12)
TimeLineHeader.qml (+6/-8)
TimeLineHeaderComponent.qml (+6/-6)
WeekView.qml (+30/-9)
YearView.qml (+41/-16)
calendar.qml (+4/-59)
debian/control (+1/-2)
tests/autopilot/calendar_app/__init__.py (+4/-0)
tests/autopilot/calendar_app/tests/__init__.py (+2/-2)
tests/autopilot/calendar_app/tests/test_dayview.py (+4/-50)
tests/autopilot/calendar_app/tests/test_weekview.py (+7/-9)
To merge this branch: bzr merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/ViewRedisign
Reviewer Review Type Date Requested Status
Mihir Soni Disapprove
Kunal Parmar Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan Needs Fixing
Review via email: mp+234680@code.launchpad.net

Commit message

Redesigned the Month, Day and Week views to use screen space more effectively and improving the user experience.

Description of the change

This Branch contains following changes in Calendar :

1. Redesigned Month View
2. Redesigned Day view
3. Redesigned Week view
4. Updated autopilots.

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

@Mihir, Week View needs fixing, as of rev 471, it looks like https://imgur.com/imB1lyd on the emulator. I am pretty sure on the phone, the week day names will collide with one other. Also the events seems shifted.

review: Needs Fixing
Revision history for this message
Mihir Soni (mihirsoni) wrote :

@Nik,

Yes, I guess now the only option left is , we might have to overlap hours.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
479. By Mihir Soni

Fixed weekview APs

480. By Mihir Soni

code indentation

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
481. By Nekhelesh Ramananthan

merged trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
482. By Nekhelesh Ramananthan

Fixed empty space at the bottom issue

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :
483. By Nekhelesh Ramananthan

Added missing layouts dependency and also removed redundant dependencies

484. By Nekhelesh Ramananthan

Reverted all day events being conditionally shown or hidden since it causes a regression in week view

485. By Nekhelesh Ramananthan

Reverted accidental change of manifest file

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

> Something goes wrong with Dayview , it is not visible ,
>
> http://91.189.93.70:8080/job/generic-mediumtests-utopic-python3/375/artifact/c
> alendar_app.tests.test_dayview.TestDayView.test_current_month_and_year_is_sele
> cted.ogv

I forgot to add qtdeclarative5-quicklayouts-plugin as a dependency in the debian/control file which caused the day view to not load in jenkins. I fixed it. Everything should be fine.

I reverted the All Day Event file change due to the regression in the week view we discussed.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

this MR is too large for me to review, Can we break down it more manageable and with only relevant code change applied.

There are higher chance of regression, as both testing and review is difficult.

Also added one minor comment

review: Needs Information
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Hi Kunal,

With respect to your comment , yes we have removed the partial views of next and previous day now as we moved days in header,so only one day will be visible in Dayview.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Hi Kunal,
>
> With respect to your comment , yes we have removed the partial views of next
> and previous day now as we moved days in header,so only one day will be
> visible in Dayview.

Changes are fine to me if others know about it and fine with it, please take popey's comment regarding same.

BTW, it does not seem to be a valid reason to remove those view's just because we moved day's to header. There are other alternative also.

What we are doing in weekview ? We can apply same comment here as well.

review: Needs Fixing
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Hey Kunal,

1. We are in the process of splitting this MR into several smaller ones for easier review and testing as you are right, big MPs can lead to regressions slipping in.

2. At every stage of the implementation of the redesign of the views, we made sure to get feedback from popey. And we believe that a day view should be a day view showing the events of only that day for several reasons,

- By showing only a single day, we provide more room to show events of that particular day which would otherwise be cramped. If a user wants to see the days in the other days then he/she can use the week view.

- On the phone the screen estate is really precious, by showing only that day's event in the day view, we are simplifying the view for the user and it has resulted in a much cleaner design in my honest opinion.

Again this was approved by popey.

I am not sure if you tried this on the phone, but it looks gorgeous so I hope you would agree to this change.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Hey Kunal,
>
> 1. We are in the process of splitting this MR into several smaller ones for
> easier review and testing as you are right, big MPs can lead to regressions
> slipping in.

Thanks, this really helps a lot.
>
> 2. At every stage of the implementation of the redesign of the views, we made
> sure to get feedback from popey. And we believe that a day view should be a
> day view showing the events of only that day for several reasons,
>
> - By showing only a single day, we provide more room to show events of that
> particular day which would otherwise be cramped. If a user wants to see the
> days in the other days then he/she can use the week view.
>
> - On the phone the screen estate is really precious, by showing only that
> day's event in the day view, we are simplifying the view for the user and it
> has resulted in a much cleaner design in my honest opinion.
>
> Again this was approved by popey.
>
> I am not sure if you tried this on the phone, but it looks gorgeous so I hope
> you would agree to this change.

I am fine with it, if popey agrees with the change.

I had one concern though (based on snapshot you posted), this change makes WeekView and DayView look different.In my personal opinion both should look and behave same, to me its part of same view, one is compressed and other is not.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

> I am fine with it, if popey agrees with the change.
>
> I had one concern though (based on snapshot you posted), this change makes
> WeekView and DayView look different.In my personal opinion both should look
> and behave same, to me its part of same view, one is compressed and other is
> not.

The weekview and dayview resemble each other quite a bit UI wise. The only differences we did are the following,

- Day view shows only its day events (expanded) while week view shows multiple day events (compressed)
- In day view we do not show the week days and date header since it is rather redundant to show only one day.

Otherwise everything remains the same. The All-Day events have not changed. The UI is very similar.

Revision history for this message
Mihir Soni (mihirsoni) wrote :
review: Disapprove

Unmerged revisions

485. By Nekhelesh Ramananthan

Reverted accidental change of manifest file

484. By Nekhelesh Ramananthan

Reverted all day events being conditionally shown or hidden since it causes a regression in week view

483. By Nekhelesh Ramananthan

Added missing layouts dependency and also removed redundant dependencies

482. By Nekhelesh Ramananthan

Fixed empty space at the bottom issue

481. By Nekhelesh Ramananthan

merged trunk

480. By Mihir Soni

code indentation

479. By Mihir Soni

Fixed weekview APs

478. By Nekhelesh Ramananthan

Fixed week view

477. By Mihir Soni

removing test_switch_day_by_tapping as we are not using multiple days in dayview

476. By Mihir Soni

Removing ap test_show_current_days as we are not showing multiple days in dayview

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AgendaView.qml'
2--- AgendaView.qml 2014-09-16 07:39:40 +0000
3+++ AgendaView.qml 2014-09-18 21:51:29 +0000
4@@ -15,8 +15,8 @@
5 * You should have received a copy of the GNU General Public License
6 * along with this program. If not, see <http://www.gnu.org/licenses/>.
7 */
8-import QtQuick 2.0
9-import Ubuntu.Components 0.1
10+import QtQuick 2.3
11+import Ubuntu.Components 1.1
12 import QtOrganizer 5.0
13
14 import "dateExt.js" as DateExt
15@@ -43,6 +43,24 @@
16 return !!enabled_calendars.length;
17 }
18
19+ Action {
20+ id: calendarTodayAction
21+ objectName:"todaybutton"
22+ iconName: "calendar-today"
23+ text: i18n.tr("Today")
24+ onTriggered: {
25+ currentDay = new Date()
26+ goToBeginning()
27+ }
28+ }
29+
30+ head.actions: [
31+ calendarTodayAction,
32+ commonHeaderActions.newEventAction,
33+ commonHeaderActions.showCalendarAction,
34+ commonHeaderActions.reloadAction
35+ ]
36+
37 EventListModel {
38 id: eventListModel
39 startPeriod: currentDay.midnight();
40
41=== modified file 'AllDayEventComponent.qml'
42--- AllDayEventComponent.qml 2014-09-02 00:02:38 +0000
43+++ AllDayEventComponent.qml 2014-09-18 21:51:29 +0000
44@@ -35,6 +35,7 @@
45 width: parent.width
46 color: "#C8C8C8"
47
48+
49 function getAllDayEvents(startDate, endDate) {
50 var map = {};
51 var items = model.getItems(startDate,endDate);
52@@ -60,6 +61,7 @@
53 allDayEvents = getAllDayEvents(sd,ed);
54 }
55
56+
57 Row {
58 width: parent.width
59 anchors.verticalCenter: parent.verticalCenter
60
61=== modified file 'DayView.qml'
62--- DayView.qml 2014-09-02 00:02:38 +0000
63+++ DayView.qml 2014-09-18 21:51:29 +0000
64@@ -15,9 +15,9 @@
65 * You should have received a copy of the GNU General Public License
66 * along with this program. If not, see <http://www.gnu.org/licenses/>.
67 */
68-import QtQuick 2.0
69+
70+import QtQuick 2.3
71 import Ubuntu.Components 1.1
72-
73 import "dateExt.js" as DateExt
74 import "ViewType.js" as ViewType
75
76@@ -31,114 +31,102 @@
77 Keys.forwardTo: [dayViewPath]
78 flickable: null
79
80- Column {
81- id: column
82- anchors.top: parent.top
83- anchors.topMargin: units.gu(1.5)
84- width: parent.width; height: parent.height
85- spacing: units.gu(1)
86+ Action {
87+ id: calendarTodayAction
88+ objectName:"todaybutton"
89+ iconName: "calendar-today"
90+ text: i18n.tr("Today")
91+ onTriggered: {
92+ currentDay = new Date()
93+ }
94+ }
95+
96+ head {
97+ actions: [
98+ calendarTodayAction,
99+ commonHeaderActions.newEventAction,
100+ commonHeaderActions.showCalendarAction,
101+ commonHeaderActions.reloadAction
102+ ]
103+
104+ contents: Column{
105+ width: parent ? parent.width - units.gu(2) : undefined
106+
107+ Label {
108+ fontSize: "medium"
109+ text: i18n.tr(currentDay.toLocaleString(Qt.locale(),i18n.tr("dddd")))
110+ }
111+
112+ Label {
113+ id:cuurentDay
114+ objectName:"monthYearLabel"
115+ fontSize: "large"
116+ text:i18n.tr(currentDay.toLocaleString(Qt.locale(),i18n.tr("MMMM dd, yyyy")))
117+ }
118+ }
119+ }
120+
121+ PathViewBase{
122+ id: dayViewPath
123+ objectName: "dayViewPath"
124+
125+ property var startDay: currentDay
126+ //This is used to scroll all view together when currentItem scrolls
127+ property var childContentY
128
129 anchors.fill: parent
130
131- ViewHeader{
132- id: viewHeader
133- month: currentDay.getMonth()
134- year: currentDay.getFullYear()
135- }
136-
137- TimeLineHeader{
138- id: dayHeader
139+
140+ onNextItemHighlighted: {
141+ //next day
142+ currentDay = currentDay.addDays(1)
143+ }
144+
145+ onPreviousItemHighlighted: {
146+ //previous day
147+ currentDay = currentDay.addDays(-1)
148+ }
149+
150+ delegate: TimeLineBaseComponent {
151+ id: timeLineView
152+ objectName: "DayComponent-"+index
153+
154 type: ViewType.ViewTypeDay
155- date: currentDay
156- preferredHighlightBegin: 0.5
157- preferredHighlightEnd: 0.5
158- path: Path {
159- startX: -(dayHeader.width/7); startY: dayHeader.height/2
160- PathLine { x: (dayHeader.width/7) * 8 ; relativeY: 0; }
161- }
162- onDateSelected: {
163- if(date < currentDay){
164- currentDay = currentDay.addDays(-1);
165- dayHeader.decrementCurrentIndex()
166- }
167- else if( date > currentDay){
168- currentDay = currentDay.addDays(1);
169- dayHeader.incrementCurrentIndex();
170- }
171- }
172- }
173-
174- PathViewBase{
175- id: dayViewPath
176- objectName: "dayViewPath"
177-
178- property var startDay: currentDay
179- //This is used to scroll all view together when currentItem scrolls
180- property var childContentY;
181-
182- preferredHighlightBegin: 0.5
183- preferredHighlightEnd: 0.5
184
185 width: parent.width
186- height: column.height - dayViewPath.y
187-
188- path: Path {
189- startX: -(dayViewPath.width/1.75); startY: dayViewPath.height/2
190- PathLine { x: (dayViewPath.width/7) * 11 ; relativeY: 0; }
191- }
192-
193- onNextItemHighlighted: {
194- //next day
195- currentDay = currentDay.addDays(1);
196- dayHeader.incrementCurrentIndex()
197- }
198-
199- onPreviousItemHighlighted: {
200- //previous day
201- currentDay = currentDay.addDays(-1);
202- dayHeader.decrementCurrentIndex()
203- }
204-
205- delegate: TimeLineBaseComponent {
206- id: timeLineView
207- objectName: "DayComponent-"+index
208-
209- type: ViewType.ViewTypeDay
210-
211- width: parent.width/7 * 5
212- height: parent.height
213- z: index == dayViewPath.currentIndex ? 2 : 1
214- isActive: true
215-
216- Connections{
217- target: dayViewPage
218- onIsCurrentPageChanged:{
219- if(dayViewPage.isCurrentPage){
220- timeLineView.scrollToCurrentTime();
221- }
222+ height: parent.height
223+ z: index == dayViewPath.currentIndex ? 2 : 1
224+ isActive: true
225+
226+ Connections{
227+ target: dayViewPage
228+ onIsCurrentPageChanged:{
229+ if(dayViewPage.isCurrentPage){
230+ timeLineView.scrollToCurrentTime()
231 }
232 }
233-
234- //get contentY value from PathView, if its not current Item
235- Binding{
236- target: timeLineView
237- property: "contentY"
238- value: dayViewPath.childContentY;
239- when: !timeLineView.PathView.isCurrentItem
240- }
241-
242- //set PathView's contentY property, if its current item
243- Binding{
244- target: dayViewPath
245- property: "childContentY"
246- value: contentY
247- when: timeLineView.PathView.isCurrentItem
248- }
249-
250- contentInteractive: timeLineView.PathView.isCurrentItem
251-
252- startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
253- }
254+ }
255+
256+ //get contentY value from PathView, if its not current Item
257+ Binding{
258+ target: timeLineView
259+ property: "contentY"
260+ value: dayViewPath.childContentY;
261+ when: !timeLineView.PathView.isCurrentItem
262+ }
263+
264+ //set PathView's contentY property, if its current item
265+ Binding{
266+ target: dayViewPath
267+ property: "childContentY"
268+ value: contentY
269+ when: timeLineView.PathView.isCurrentItem
270+ }
271+
272+ contentInteractive: timeLineView.PathView.isCurrentItem
273+
274+ startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
275 }
276 }
277 }
278+
279
280=== added file 'EventActions.qml'
281--- EventActions.qml 1970-01-01 00:00:00 +0000
282+++ EventActions.qml 2014-09-18 21:51:29 +0000
283@@ -0,0 +1,59 @@
284+/*
285+ * Copyright (C) 2014 Canonical Ltd
286+ *
287+ * This file is part of Ubuntu Calendar App
288+ *
289+ * Ubuntu Calendar App is free software: you can redistribute it and/or modify
290+ * it under the terms of the GNU General Public License version 3 as
291+ * published by the Free Software Foundation.
292+ *
293+ * Ubuntu Calendar App is distributed in the hope that it will be useful,
294+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
295+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
296+ * GNU General Public License for more details.
297+ *
298+ * You should have received a copy of the GNU General Public License
299+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
300+ */
301+
302+import QtQuick 2.3
303+import Ubuntu.Components 1.1
304+
305+Item {
306+ id: actionPool
307+
308+ property alias newEventAction: _newEventAction
309+ property alias showCalendarAction: _showCalendarAction
310+ property alias reloadAction: _reloadAction
311+
312+ Action {
313+ id: _newEventAction
314+ objectName: "neweventbutton"
315+ iconName: "new-event"
316+ text: i18n.tr("New Event")
317+ onTriggered: {
318+ pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"date":tabs.currentDay,"model":eventModel});
319+ }
320+ }
321+
322+ Action{
323+ id: _showCalendarAction
324+ iconName: "new-event"
325+ text: i18n.tr("Calendars")
326+ onTriggered: {
327+ pageStack.push(Qt.resolvedUrl("CalendarChoicePopup.qml"),{"model":eventModel});
328+ pageStack.currentPage.collectionUpdated.connect(eventModel.delayedApplyFilter);
329+ }
330+ }
331+
332+ // #FIXME: This action doesn't seem to be visible!
333+ Action {
334+ id: _reloadAction
335+ objectName: "syncbutton"
336+ iconName: "reload"
337+ text: enabled ? i18n.tr("Sync") : i18n.tr("Syncing")
338+ onTriggered: syncMonitor.sync(["calendar"])
339+ enabled: (syncMonitor.state !== "syncing")
340+ visible: syncMonitor.enabledServices ? syncMonitor.serviceIsEnabled("calendar") : false
341+ }
342+}
343
344=== modified file 'HeaderDateComponent.qml'
345--- HeaderDateComponent.qml 2014-09-02 00:02:38 +0000
346+++ HeaderDateComponent.qml 2014-09-18 21:51:29 +0000
347@@ -15,53 +15,57 @@
348 * You should have received a copy of the GNU General Public License
349 * along with this program. If not, see <http://www.gnu.org/licenses/>.
350 */
351-import QtQuick 2.0
352+
353+import QtQuick 2.3
354 import Ubuntu.Components 1.1
355
356 Item {
357- id: root
358-
359- property var date;
360-
361- property alias dateColor: dateLabel.color
362+ id: headerDateComponent
363+
364+ // Property to set the day and date
365+ property var date
366+
367+ // Property to set the font color of the day label
368 property alias dayColor: dayLabel.color
369
370- property int dayFormat: Locale.ShortFormat;
371-
372- signal dateSelected(var date);
373-
374- width: parent.width
375- height: innerColumn.height
376+ // Property to set the time format of the day label
377+ property int dayFormat: Locale.ShortFormat
378+
379+ // Signal which is fired when pressing on the date
380+ signal dateSelected(var date)
381+
382+ width: dayLabel.paintedWidth
383+ height: dateContainer.height
384
385 Column {
386- id: innerColumn
387- width: parent.width
388- spacing: units.gu(2)
389+ id: dateContainer
390+
391+ width: dayLabel.paintedWidth
392+ spacing: units.gu(0.2)
393+
394+ anchors.centerIn: parent
395
396 Label{
397 id: dayLabel
398- property var day: Qt.locale().standaloneDayName(date.getDay(), dayFormat)
399- text: day.toUpperCase();
400- fontSize: "medium"
401- horizontalAlignment: Text.AlignHCenter
402+ objectName: "dayLabel"
403 color: "white"
404- width: parent.width
405+ horizontalAlignment: Text.horizontalCenter
406+ text: Qt.locale().standaloneDayName(date.getDay(), dayFormat)
407 }
408
409- Label{
410+ Label {
411 id: dateLabel
412 objectName: "dateLabel"
413 text: date.getDate();
414- fontSize: "large"
415- horizontalAlignment: Text.AlignHCenter
416- width: parent.width
417+ color: dayLabel.color
418+ anchors.horizontalCenter: dayLabel.horizontalCenter
419 }
420 }
421
422 MouseArea {
423 anchors.fill: parent
424 onClicked: {
425- root.dateSelected(date);
426+ headerDateComponent.dateSelected(date);
427 }
428 }
429 }
430
431=== modified file 'MonthComponent.qml'
432--- MonthComponent.qml 2014-09-08 10:21:19 +0000
433+++ MonthComponent.qml 2014-09-18 21:51:29 +0000
434@@ -40,8 +40,6 @@
435 signal monthSelected(var date);
436 signal dateSelected(var date)
437
438- height: ubuntuShape.height
439-
440 Loader{
441 id: modelLoader
442 sourceComponent: showEvents ? modelComponent: undefined
443@@ -85,8 +83,8 @@
444
445 //check if current month is start month
446 property bool isCurMonthStartMonth: curMonthDate === monthStartDate
447- && curMonth === monthStartMonth
448- && curMonthYear === monthStartYear
449+ && curMonth === monthStartMonth
450+ && curMonthYear === monthStartYear
451
452 //check current month is same as today's month
453 property bool isCurMonthTodayMonth: todayYear === curMonthYear && todayMonth == curMonth
454@@ -94,72 +92,68 @@
455 property int offset: isCurMonthStartMonth ? -1 : (daysInStartMonth - monthStartDate)
456 }
457
458- UbuntuShape {
459- id: ubuntuShape
460-
461- anchors.fill: parent
462- radius: "medium"
463-
464- Column{
465- id: column
466-
467- anchors.top: parent.top
468- anchors.topMargin: units.gu(1.5)
469- anchors.bottomMargin: units.gu(1)
470- anchors.fill: parent
471- spacing: units.gu(1.5)
472-
473- ViewHeader{
474- id: monthHeader
475- month: intern.curMonth
476- year: intern.curMonthYear
477-
478- monthLabelFontSize: root.monthLabelFontSize
479- yearLabelFontSize: root.yearLabelFontSize
480- }
481-
482- Item {
483- width: parent.width
484- height: dayLabelRow.height + units.gu(1)
485-
486- DayHeaderBackground{}
487-
488- Row{
489- id: dayLabelRow
490- width: parent.width
491- anchors.horizontalCenter: parent.horizontalCenter
492- anchors.verticalCenter: parent.verticalCenter
493-
494- Repeater{
495- id: dayLabelRepeater
496- model:7
497- delegate: dafaultDayLabelComponent
498- }
499- }
500- }
501-
502- Grid{
503- id: monthGrid
504- objectName: "monthGrid"
505-
506- property int weekCount : 6
507-
508- width: parent.width
509- height: parent.height - monthGrid.y
510-
511- property int dayWidth: width / 7;
512- property int dayHeight: height / weekCount
513-
514- rows: weekCount
515- columns: 7
516+ Column{
517+ id: column
518+
519+ anchors {
520+ fill: parent
521+ topMargin: units.gu(1.5)
522+ bottomMargin: units.gu(1)
523+ }
524+
525+ spacing: units.gu(1.5)
526+
527+ ViewHeader{
528+ id: monthHeader
529+ month: intern.curMonth
530+ year: intern.curMonthYear
531+
532+ monthLabelFontSize: root.monthLabelFontSize
533+ yearLabelFontSize: root.yearLabelFontSize
534+ visible: isYearView === true
535+ }
536+
537+ Item {
538+ width: parent.width
539+ height: dayLabelRow.height + units.gu(1)
540+
541+ DayHeaderBackground{}
542+
543+ Row{
544+ id: dayLabelRow
545+ width: parent.width
546+ anchors.horizontalCenter: parent.horizontalCenter
547+ anchors.verticalCenter: parent.verticalCenter
548
549 Repeater{
550- id: dateLabelRepeater
551- model: monthGrid.rows * monthGrid.columns
552- delegate: defaultDateLabelComponent
553+ id: dayLabelRepeater
554+ model:7
555+ delegate: dafaultDayLabelComponent
556 }
557 }
558 }
559+
560+ Grid{
561+ id: monthGrid
562+ objectName: "monthGrid"
563+
564+ property int weekCount : 6
565+
566+ width: parent.width
567+ height: parent.height - monthGrid.y
568+
569+ property int dayWidth: width / 7;
570+ property int dayHeight: height / weekCount
571+
572+ rows: weekCount
573+ columns: 7
574+
575+ Repeater{
576+ id: dateLabelRepeater
577+ model: monthGrid.rows * monthGrid.columns
578+ delegate: defaultDateLabelComponent
579+ }
580+ }
581 }
582
583 Component{
584@@ -228,9 +222,9 @@
585
586 Loader{
587 property bool shouldLoad: showEvents
588- && intern.eventStatus !== undefined
589- && intern.eventStatus[index] !== undefined
590- &&intern.eventStatus[index]
591+ && intern.eventStatus !== undefined
592+ && intern.eventStatus[index] !== undefined
593+ &&intern.eventStatus[index]
594 sourceComponent: shouldLoad ? eventIndicatorComp : undefined
595 anchors.top: dateLabel.bottom
596 anchors.horizontalCenter: dateLabel.horizontalCenter
597@@ -280,7 +274,7 @@
598 id: weekDay
599 width: parent.width / 7
600 property var day :Qt.locale().standaloneDayName(( Qt.locale().firstDayOfWeek + index), Locale.ShortFormat)
601- text: day.toUpperCase();
602+ text: day;
603 horizontalAlignment: Text.AlignHCenter
604 fontSize: root.dayLabelFontSize
605 color: "white"
606
607=== modified file 'MonthView.qml'
608--- MonthView.qml 2014-09-02 00:02:38 +0000
609+++ MonthView.qml 2014-09-18 21:51:29 +0000
610@@ -15,7 +15,7 @@
611 * You should have received a copy of the GNU General Public License
612 * along with this program. If not, see <http://www.gnu.org/licenses/>.
613 */
614-import QtQuick 2.0
615+import QtQuick 2.3
616 import Ubuntu.Components 1.1
617 import "dateExt.js" as DateExt
618 import "colorUtils.js" as Color
619@@ -30,6 +30,30 @@
620
621 Keys.forwardTo: [monthViewPath]
622
623+ Action {
624+ id: calendarTodayAction
625+ objectName:"todaybutton"
626+ iconName: "calendar-today"
627+ text: i18n.tr("Today")
628+ onTriggered: {
629+ currentMonth = new Date().midnight()
630+ }
631+ }
632+
633+ head {
634+ actions: [
635+ calendarTodayAction,
636+ commonHeaderActions.newEventAction,
637+ commonHeaderActions.showCalendarAction,
638+ commonHeaderActions.reloadAction
639+ ]
640+
641+ contents: Label {
642+ fontSize: "x-large"
643+ text: i18n.tr(currentMonth.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
644+ }
645+ }
646+
647 PathViewBase{
648 id: monthViewPath
649 objectName: "monthViewPath"
650@@ -66,8 +90,8 @@
651
652 showEvents: true
653
654- width: parent.width - units.gu(5)
655- height: parent.height - units.gu(5)
656+ width: parent.width - units.gu(4)
657+ height: parent.height
658
659 currentMonth: monthViewPath.addMonth(monthViewPath.startMonth,
660 monthViewPath.indexType(index));
661
662=== modified file 'NewEvent.qml'
663--- NewEvent.qml 2014-09-16 17:11:32 +0000
664+++ NewEvent.qml 2014-09-18 21:51:29 +0000
665@@ -249,27 +249,6 @@
666 endDate = new Date( startDate.getTime() + time_forward );
667 }
668
669- ScrollAnimation{id:scrollAnimation}
670-
671- function scrollOnExpand(Self,Container,Target,Margin,Visible)
672- {
673- // Self is needed for "onXxxxxChange" triggers. OnExpansionCompleted however can just write "true".
674- // Container is the item which encapsulates everything, such as a column.
675- // Target is the Flickable id you wish to scroll
676- // Margin is the space between the bottom of the screen and the bottom of the item you are scrolling to.
677- // Visible is needed if there is anything that appears under the item you are scrolling to.
678- if (Self === false){return}
679- var v = units.gu(Margin)
680- for (var i in Visible){if(Visible[i].visible === true){v+=Visible[i].height};}
681-
682- scrollAnimation.target = Target
683- scrollAnimation.to = Container.height-height - v
684- scrollAnimation.start()
685- }
686-
687- width: parent.width
688- height: parent.height
689-
690 title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")
691
692 Keys.onEscapePressed: {
693
694=== removed file 'ScrollAnimation.qml'
695--- ScrollAnimation.qml 2014-08-28 23:10:33 +0000
696+++ ScrollAnimation.qml 1970-01-01 00:00:00 +0000
697@@ -1,7 +0,0 @@
698-import QtQuick 2.0
699-
700-PropertyAnimation {
701- duration: 500
702- easing.type: Easing.OutQuad
703- property: "contentY"
704-}
705
706=== modified file 'TimeLineBackground.qml'
707--- TimeLineBackground.qml 2014-09-08 10:21:19 +0000
708+++ TimeLineBackground.qml 2014-09-18 21:51:29 +0000
709@@ -15,11 +15,13 @@
710 * You should have received a copy of the GNU General Public License
711 * along with this program. If not, see <http://www.gnu.org/licenses/>.
712 */
713-import QtQuick 2.0
714+
715+import QtQuick 2.3
716 import Ubuntu.Components 1.1
717
718 Column {
719 width: parent.width
720+
721 Repeater {
722 model: 24 // hour in a day
723
724@@ -31,19 +33,16 @@
725 Label {
726 id: timeLabel
727
728- // TRANSLATORS: this is a time formatting string,
729- // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
730 text: {
731 var locale = Qt.locale();
732-
733- return new Date( 0, 0, 0, index )
734- .toLocaleTimeString( locale, locale.timeFormat( Locale.NarrowFormat ) );
735+ return new Date(0, 0, 0, index).toLocaleTimeString
736+ (locale, locale.timeFormat(Locale.NarrowFormat))
737 }
738- color: "#5D5D5D"
739- anchors.horizontalCenter: parent.horizontalCenter
740+ color: UbuntuColors.lightGrey
741+ anchors.left: parent.left
742+ anchors.leftMargin: units.gu(2)
743 anchors.verticalCenter: parent.verticalCenter
744- fontSize: "x-large"
745- opacity: 0.3
746+ fontSize: "small"
747 }
748 }
749 }
750
751=== modified file 'TimeLineBaseComponent.qml'
752--- TimeLineBaseComponent.qml 2014-09-02 00:02:38 +0000
753+++ TimeLineBaseComponent.qml 2014-09-18 21:51:29 +0000
754@@ -16,6 +16,7 @@
755 * along with this program. If not, see <http://www.gnu.org/licenses/>.
756 */
757 import QtQuick 2.0
758+import QtQuick.Layouts 1.1
759 import Ubuntu.Components 1.1
760 import Ubuntu.Components.Popups 1.0
761 import QtOrganizer 5.0
762@@ -88,11 +89,8 @@
763 z:2
764 }
765
766- Column {
767- anchors.top: parent.top
768-
769- width: parent.width
770- height: parent.height
771+ ColumnLayout {
772+ anchors.fill: parent
773
774 AllDayEventComponent {
775 id: allDayContainer
776@@ -111,21 +109,20 @@
777 id: timeLineView
778
779 width: parent.width
780- height: parent.height - allDayContainer.height
781+ Layout.fillHeight: true
782
783 contentHeight: units.gu(10) * 24
784 contentWidth: width
785
786 clip: true
787
788- TimeLineBackground {
789- }
790+ TimeLineBackground {}
791
792 Row {
793 id: week
794- width: parent.width
795- height: parent.height
796- anchors.top: parent.top
797+ anchors.fill: parent
798+ anchors.leftMargin: type == ViewType.ViewTypeWeek ? units.gu(0) : units.gu(10)
799+ anchors.rightMargin: type == ViewType.ViewTypeWeek ? units.gu(0) : units.gu(4)
800
801 Repeater {
802 model: type == ViewType.ViewTypeWeek ? 7 : 1
803@@ -133,9 +130,10 @@
804 delegate: TimeLineBase {
805 property int idx: index
806 anchors.top: parent.top
807+
808 width: {
809 if( type == ViewType.ViewTypeWeek ) {
810- parent.width / 7
811+ (parent.width / 7)
812 } else {
813 (parent.width)
814 }
815
816=== modified file 'TimeLineHeader.qml'
817--- TimeLineHeader.qml 2014-09-02 00:02:38 +0000
818+++ TimeLineHeader.qml 2014-09-18 21:51:29 +0000
819@@ -15,7 +15,8 @@
820 * You should have received a copy of the GNU General Public License
821 * along with this program. If not, see <http://www.gnu.org/licenses/>.
822 */
823-import QtQuick 2.0
824+
825+import QtQuick 2.3
826 import Ubuntu.Components 1.1
827
828 import "dateExt.js" as DateExt
829@@ -29,16 +30,13 @@
830 interactive: false
831 model:3
832
833- height: units.gu(8)
834+ height: units.gu(4)
835 width: parent.width
836
837 property var date;
838
839 signal dateSelected(var date);
840
841- DayHeaderBackground{
842- height: FontUtils.sizeToPixels("medium") + units.gu(1.5)
843- }
844
845 delegate: TimeLineHeaderComponent{
846 type: header.type
847@@ -47,7 +45,7 @@
848
849 width: {
850 if( type == ViewType.ViewTypeWeek ) {
851- parent.width
852+ parent.width
853 } else if( type == ViewType.ViewTypeDay && isCurrentItem ){
854 (header.width/7) * 5
855 } else {
856@@ -57,8 +55,8 @@
857
858 startDay: {
859 (type == ViewType.ViewTypeWeek) ?
860- date.addDays(7*header.indexType(index)) :
861- date.addDays(1*header.indexType(index));
862+ date.addDays(7*header.indexType(index)) :
863+ date.addDays(1*header.indexType(index));
864 }
865
866 onDateSelected: {
867
868=== modified file 'TimeLineHeaderComponent.qml'
869--- TimeLineHeaderComponent.qml 2014-09-02 00:02:38 +0000
870+++ TimeLineHeaderComponent.qml 2014-09-18 21:51:29 +0000
871@@ -15,7 +15,8 @@
872 * You should have received a copy of the GNU General Public License
873 * along with this program. If not, see <http://www.gnu.org/licenses/>.
874 */
875-import QtQuick 2.0
876+
877+import QtQuick 2.3
878 import Ubuntu.Components 1.1
879
880 import "dateExt.js" as DateExt
881@@ -33,7 +34,6 @@
882 signal dateSelected(var date);
883
884 width: parent.width
885-
886 Repeater{
887 model: type == ViewType.ViewTypeWeek ? 7 : 1
888
889@@ -47,13 +47,13 @@
890 }
891 }
892
893- dateColor: {
894+ dayColor: {
895 if( type == ViewType.ViewTypeWeek && date.isSameDay(DateExt.today())){
896- "#5D5D5D"
897+ UbuntuColors.orange
898 } else if( type == ViewType.ViewTypeDay && header.isCurrentItem ) {
899- "#5D5D5D"
900+ UbuntuColors.orange
901 } else {
902- "#AEA79F"
903+ UbuntuColors.darkGrey
904 }
905 }
906
907
908=== modified file 'WeekView.qml'
909--- WeekView.qml 2014-09-02 00:02:38 +0000
910+++ WeekView.qml 2014-09-18 21:51:29 +0000
911@@ -15,7 +15,8 @@
912 * You should have received a copy of the GNU General Public License
913 * along with this program. If not, see <http://www.gnu.org/licenses/>.
914 */
915-import QtQuick 2.0
916+
917+import QtQuick 2.3
918 import Ubuntu.Components 1.1
919
920 import "dateExt.js" as DateExt
921@@ -35,24 +36,44 @@
922
923 flickable: null
924
925+ Action {
926+ id: calendarTodayAction
927+ objectName:"todaybutton"
928+ iconName: "calendar-today"
929+ text: i18n.tr("Today")
930+ onTriggered: {
931+ dayStart = new Date()
932+ }
933+ }
934+
935+ head {
936+ actions: [
937+ calendarTodayAction,
938+ commonHeaderActions.newEventAction,
939+ commonHeaderActions.showCalendarAction,
940+ commonHeaderActions.reloadAction
941+ ]
942+
943+ contents: Label {
944+ id:monthYear
945+ objectName:"monthYearLabel"
946+ fontSize: "x-large"
947+ text: i18n.tr(dayStart.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
948+ }
949+ }
950+
951 Column {
952 anchors.fill: parent
953- anchors.top: parent.top
954- anchors.topMargin: units.gu(1.5)
955+ anchors.topMargin: units.gu(1)
956 spacing: units.gu(1)
957
958- ViewHeader{
959- id: viewHeader
960- month: dayStart.getMonth()
961- year: dayStart.getFullYear()
962- }
963-
964 TimeLineHeader{
965 id: weekHeader
966 objectName: "weekHeader"
967 type: ViewType.ViewTypeWeek
968 date: firstDay
969
970+
971 onDateSelected: {
972 weekViewPage.dateSelected(date);
973 }
974
975=== modified file 'YearView.qml'
976--- YearView.qml 2014-09-08 10:21:19 +0000
977+++ YearView.qml 2014-09-18 21:51:29 +0000
978@@ -15,7 +15,8 @@
979 * You should have received a copy of the GNU General Public License
980 * along with this program. If not, see <http://www.gnu.org/licenses/>.
981 */
982-import QtQuick 2.0
983+
984+import QtQuick 2.3
985 import Ubuntu.Components 1.1
986
987 import "dateExt.js" as DateExt
988@@ -28,6 +29,25 @@
989
990 Keys.forwardTo: [yearPathView]
991
992+ Action {
993+ id: calendarTodayAction
994+ objectName:"todaybutton"
995+ iconName: "calendar-today"
996+ text: i18n.tr("Today")
997+ onTriggered: {
998+ currentYear = new Date().getFullYear()
999+ }
1000+ }
1001+
1002+ head {
1003+ actions: [
1004+ calendarTodayAction,
1005+ commonHeaderActions.newEventAction,
1006+ commonHeaderActions.showCalendarAction,
1007+ commonHeaderActions.reloadAction
1008+ ]
1009+ }
1010+
1011 PathViewBase {
1012 id: yearPathView
1013 objectName: "yearPathView"
1014@@ -98,23 +118,28 @@
1015 width: yearView.cellWidth
1016 height: yearView.cellHeight
1017
1018- MonthComponent {
1019- id: monthComponent
1020- objectName: "monthComponent" + index
1021- showEvents: false
1022- currentMonth: new Date(yearView.year, index, 1, 0, 0, 0, 0)
1023-
1024- isYearView: true
1025+ UbuntuShape {
1026 anchors.fill: parent
1027 anchors.margins: units.gu(0.5)
1028-
1029- dayLabelFontSize:"x-small"
1030- dateLabelFontSize: "medium"
1031- monthLabelFontSize: "medium"
1032- yearLabelFontSize: "small"
1033-
1034- onMonthSelected: {
1035- yearViewPage.monthSelected(date);
1036+ radius: "medium"
1037+
1038+ MonthComponent {
1039+ id: monthComponent
1040+ objectName: "monthComponent" + index
1041+ showEvents: false
1042+ currentMonth: new Date(yearView.year, index, 1, 0, 0, 0, 0)
1043+
1044+ isYearView: true
1045+ anchors.fill: parent
1046+
1047+ dayLabelFontSize:"x-small"
1048+ dateLabelFontSize: "medium"
1049+ monthLabelFontSize: "medium"
1050+ yearLabelFontSize: "small"
1051+
1052+ onMonthSelected: {
1053+ yearViewPage.monthSelected(date);
1054+ }
1055 }
1056 }
1057 }
1058
1059=== modified file 'calendar.qml'
1060--- calendar.qml 2014-09-09 10:46:02 +0000
1061+++ calendar.qml 2014-09-18 21:51:29 +0000
1062@@ -15,7 +15,7 @@
1063 * You should have received a copy of the GNU General Public License
1064 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1065 */
1066-import QtQuick 2.0
1067+import QtQuick 2.3
1068 import Ubuntu.Components 1.1
1069 import Ubuntu.Components.Popups 1.0
1070 import QtOrganizer 5.0
1071@@ -28,7 +28,7 @@
1072 useDeprecatedToolbar: false
1073
1074 // Work-around until this branch lands:
1075- // https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/212496
1076+ // https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/212496
1077 //property bool windowActive: typeof window != 'undefined'
1078 //onWindowActiveChanged: window.title = i18n.tr("Calendar")
1079
1080@@ -294,58 +294,8 @@
1081 }
1082 } // End of Component.onCompleted:
1083
1084- ToolbarItems {
1085- id: commonToolBar
1086-
1087- ToolbarButton {
1088- action: Action {
1089- iconName: "calendar-today"
1090-
1091- text: i18n.tr("Today");
1092- objectName: "todaybutton"
1093- onTriggered: {
1094- tabs.currentDay = (new Date()).midnight();
1095- if(yearViewLoader.item ) yearViewLoader.item.currentYear = tabs.currentDay.getFullYear();
1096- if(monthViewLoader.item ) monthViewLoader.item.currentMonth = tabs.currentDay.midnight();
1097- if(weekViewLoader.item ) weekViewLoader.item.dayStart = tabs.currentDay;
1098- if(dayViewLoader.item ) dayViewLoader.item.currentDay = tabs.currentDay;
1099- if(agendaViewLoader.item ) {
1100- agendaViewLoader.item.currentDay = tabs.currentDay;
1101- agendaViewLoader.item.goToBeginning();
1102- }
1103- }
1104- }
1105- }
1106- ToolbarButton {
1107- action: Action {
1108- objectName: "neweventbutton"
1109- iconName: "new-event"
1110- text: i18n.tr("New Event");
1111- onTriggered: {
1112- pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"date":tabs.currentDay,"model":eventModel});
1113- }
1114- }
1115- }
1116- ToolbarButton{
1117- action:Action{
1118- iconName: "new-event"
1119- text: i18n.tr("Calendars");
1120- onTriggered: {
1121- pageStack.push(Qt.resolvedUrl("CalendarChoicePopup.qml"),{"model":eventModel});
1122- pageStack.currentPage.collectionUpdated.connect(eventModel.delayedApplyFilter);
1123- }
1124- }
1125- }
1126- ToolbarButton {
1127- objectName: "syncbutton"
1128- visible: syncMonitor.enabledServices ? syncMonitor.serviceIsEnabled("calendar") : false
1129- action: Action {
1130- text: enabled ? i18n.tr("Sync") : i18n.tr("Syncing")
1131- iconName: "reload"
1132- onTriggered: syncMonitor.sync(["calendar"])
1133- enabled: (syncMonitor.state !== "syncing")
1134- }
1135- }
1136+ EventActions {
1137+ id: commonHeaderActions
1138 }
1139
1140 Keys.onTabPressed: {
1141@@ -379,7 +329,6 @@
1142 objectName: "yearViewLoader"
1143 source: tabs.selectedTab == yearTab ? Qt.resolvedUrl("YearView.qml"):""
1144 onLoaded: {
1145- item.tools = Qt.binding(function() { return commonToolBar })
1146 item.currentYear = tabs.currentDay.getFullYear();
1147 }
1148
1149@@ -414,7 +363,6 @@
1150 objectName: "monthViewLoader"
1151 source: tabs.selectedTab == monthTab ? Qt.resolvedUrl("MonthView.qml"):""
1152 onLoaded: {
1153- item.tools = Qt.binding(function() { return commonToolBar })
1154 item.currentMonth = tabs.currentDay.midnight();
1155 }
1156
1157@@ -443,7 +391,6 @@
1158 objectName: "weekViewLoader"
1159 source: tabs.selectedTab == weekTab ? Qt.resolvedUrl("WeekView.qml"):""
1160 onLoaded: {
1161- item.tools = Qt.binding(function() { return commonToolBar })
1162 item.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == weekTab })
1163 item.dayStart = tabs.currentDay;
1164 }
1165@@ -477,7 +424,6 @@
1166 objectName: "dayViewLoader"
1167 source: tabs.selectedTab == dayTab ? Qt.resolvedUrl("DayView.qml"):""
1168 onLoaded: {
1169- item.tools = Qt.binding(function() { return commonToolBar })
1170 item.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == dayTab })
1171 item.currentDay = tabs.currentDay;
1172 }
1173@@ -507,7 +453,6 @@
1174 source: tabs.selectedTab == agendaTab ? Qt.resolvedUrl("AgendaView.qml"):""
1175
1176 onLoaded: {
1177- item.tools = Qt.binding(function() { return commonToolBar })
1178 item.currentDay = tabs.currentDay;
1179 }
1180
1181
1182=== modified file 'debian/control'
1183--- debian/control 2014-09-05 15:24:20 +0000
1184+++ debian/control 2014-09-18 21:51:29 +0000
1185@@ -18,8 +18,6 @@
1186 Architecture: all
1187 Depends: ${misc:Depends},
1188 qmlscene,
1189- qtdeclarative5-localstorage-plugin,
1190- qtdeclarative5-qtquick2-plugin,
1191 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
1192 ${misc:Depends},
1193 libqt5organizer5,
1194@@ -27,6 +25,7 @@
1195 qtorganizer5-eds,
1196 qtdeclarative5-ubuntu-syncmonitor0.1,
1197 ubuntu-mobile-icons | suru-icon-theme,
1198+ qtdeclarative5-quicklayouts-plugin,
1199 libqt5contacts5,
1200 qtdeclarative5-qtcontacts-plugin,
1201 qtcontact5-galera,
1202
1203=== modified file 'tests/autopilot/calendar_app/__init__.py'
1204--- tests/autopilot/calendar_app/__init__.py 2014-09-15 18:02:26 +0000
1205+++ tests/autopilot/calendar_app/__init__.py 2014-09-18 21:51:29 +0000
1206@@ -183,6 +183,10 @@
1207 else:
1208 return None
1209
1210+ def get_month_year(self, component):
1211+ return self.wait_select_single(
1212+ "Label", objectName="monthYearLabel").text
1213+
1214 def get_year(self, component):
1215 return int(component.wait_select_single(
1216 "Label", objectName="yearLabel").text)
1217
1218=== modified file 'tests/autopilot/calendar_app/tests/__init__.py'
1219--- tests/autopilot/calendar_app/tests/__init__.py 2014-09-04 22:15:47 +0000
1220+++ tests/autopilot/calendar_app/tests/__init__.py 2014-09-18 21:51:29 +0000
1221@@ -100,12 +100,12 @@
1222 # make sure we copy it to our temp home directory
1223
1224 xauth = os.path.expanduser(os.path.join(os.environ.get('HOME'),
1225- '.Xauthority'))
1226+ '.Xauthority'))
1227 if os.path.isfile(xauth):
1228 logger.debug("Copying .Xauthority to %s" % directory)
1229 shutil.copyfile(
1230 os.path.expanduser(os.path.join(os.environ.get('HOME'),
1231- '.Xauthority')),
1232+ '.Xauthority')),
1233 os.path.join(directory, '.Xauthority'))
1234
1235 def _patch_home(self):
1236
1237=== modified file 'tests/autopilot/calendar_app/tests/test_dayview.py'
1238--- tests/autopilot/calendar_app/tests/test_dayview.py 2014-09-04 16:04:37 +0000
1239+++ tests/autopilot/calendar_app/tests/test_dayview.py 2014-09-18 21:51:29 +0000
1240@@ -43,56 +43,10 @@
1241
1242 now = datetime.datetime.now()
1243
1244- expected_year = now.year
1245- expected_month_name = now.strftime("%B")
1246-
1247- self.assertThat(self.app.main_view.get_year(self.day_view),
1248- Equals(expected_year))
1249-
1250- self.assertThat(self.app.main_view.get_month_name(self.day_view),
1251- Equals(expected_month_name))
1252-
1253- def test_show_current_days(self):
1254- """By default, the day view show the last day, the current
1255-
1256- and the next day.
1257-
1258- """
1259-
1260- days = self.day_view.select_many(objectName='dateLabel')
1261- days = [int(day.text) for day in days]
1262-
1263- now = datetime.datetime.now()
1264-
1265- today = now.day
1266- tomorrow = (now + datetime.timedelta(days=1)).day
1267- yesterday = (now - datetime.timedelta(days=1)).day
1268-
1269- self.assertIn(today, days)
1270- self.assertIn(tomorrow, days)
1271- self.assertIn(yesterday, days)
1272-
1273- def test_switch_day_by_tapping(self):
1274- """Selecting a day by touching the screen should also switch the day"""
1275- today = self.day_view.get_day_header().startDay.datetime
1276-
1277- # click yesterday
1278- yesterday = (today - datetime.timedelta(days=1))
1279- yesterday_header = self.day_view.get_day_header(yesterday)
1280-
1281- self.assertThat(yesterday_header.isCurrentItem, Equals(False))
1282- self.app.pointing_device.click_object(yesterday_header)
1283- self.assertThat(yesterday_header.isCurrentItem,
1284- Eventually(Equals(True)))
1285-
1286- # click tomorrow
1287- tomorrow = (yesterday + datetime.timedelta(days=1))
1288- tomorrow_header = self.day_view.get_day_header(tomorrow)
1289-
1290- self.assertThat(tomorrow_header.isCurrentItem, Equals(False))
1291- self.app.pointing_device.click_object(tomorrow_header)
1292- self.assertThat(tomorrow_header.isCurrentItem,
1293- Eventually(Equals(True)))
1294+ expected_month_name_year = now.strftime("%B %d, %Y")
1295+
1296+ self.assertThat(self.app.main_view.get_month_year(self.day_view),
1297+ Equals(expected_month_name_year))
1298
1299 def test_show_next_days(self):
1300 """It must be possible to show next days by swiping the view."""
1301
1302=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
1303--- tests/autopilot/calendar_app/tests/test_weekview.py 2014-09-04 16:36:09 +0000
1304+++ tests/autopilot/calendar_app/tests/test_weekview.py 2014-09-18 21:51:29 +0000
1305@@ -123,14 +123,10 @@
1306
1307 now = datetime.datetime.now()
1308
1309- expected_year = now.year
1310- expected_month_name = now.strftime("%B")
1311-
1312- self.assertThat(self.app.main_view.get_year(self.week_view),
1313- Equals(expected_year))
1314-
1315- self.assertThat(self.app.main_view.get_month_name(self.week_view),
1316- Equals(expected_month_name))
1317+ expected_month_name_year = now.strftime("%B %Y")
1318+
1319+ self.assertThat(self.app.main_view.get_month_year(self.week_view),
1320+ Equals(expected_month_name_year))
1321
1322 def test_current_week_is_selected(self):
1323 """By default, the week view shows the current week."""
1324@@ -181,7 +177,9 @@
1325 self.assertThat(day_view.visible, Eventually(Equals(True)))
1326
1327 # Check that the 'Day' view is on the correct/selected day.
1328- selected_date = day_view.select_single("TimeLineHeader").date
1329+ selected_date = datetime.datetime.strptime(
1330+ self.app.main_view.get_month_year(day_view),
1331+ '%B %d, %Y')
1332 self.assertThat(expected_day, Equals(selected_date.day))
1333 self.assertThat(expected_month, Equals(selected_date.month))
1334 self.assertThat(expected_year, Equals(selected_date.year))

Subscribers

People subscribed via source and target branches

to status/vote changes: