Merge lp:~renatofilho/ubuntu-calendar-app/optimize into lp:ubuntu-calendar-app

Proposed by Renato Araujo Oliveira Filho
Status: Superseded
Proposed branch: lp:~renatofilho/ubuntu-calendar-app/optimize
Merge into: lp:ubuntu-calendar-app
Diff against target: 1973 lines (+478/-636)
41 files modified
AgendaView.qml (+2/-2)
AllDayEventComponent.qml (+2/-2)
CalendarChoicePopup.qml (+2/-2)
CalendarListButtonDelegate.qml (+2/-2)
ColorPickerDialog.qml (+2/-2)
ContactChoicePopup.qml (+2/-2)
DayView.qml (+47/-67)
Defines.js (+2/-2)
DeleteConfirmationDialog.qml (+2/-2)
EditEventConfirmationDialog.qml (+2/-2)
EventActions.qml (+2/-2)
EventBubble.qml (+2/-2)
EventDetails.qml (+3/-3)
EventReminder.qml (+2/-2)
EventRepetition.qml (+2/-2)
EventUtils.qml (+2/-2)
HeaderDateComponent.qml (+2/-2)
MonthComponent.qml (+94/-120)
MonthComponentDateDelegate.qml (+16/-59)
MonthView.qml (+28/-63)
NewEvent.qml (+2/-2)
NewEventEntryField.qml (+2/-2)
NewEventTimePicker.qml (+1/-1)
OnlineAccountsHelper.qml (+2/-2)
PathViewBase.qml (+12/-4)
RecurrenceLabelDefines.qml (+2/-2)
Scroller.qml (+2/-2)
Settings.qml (+2/-2)
TimeLineBackground.qml (+2/-2)
TimeLineBase.qml (+2/-2)
TimeLineBaseComponent.qml (+23/-18)
TimeLineHeader.qml (+3/-3)
TimeLineHeaderComponent.qml (+2/-2)
TimeLineTimeScale.qml (+2/-2)
ViewHeader.qml (+2/-2)
WeekView.qml (+10/-24)
YearView.qml (+20/-40)
YearViewDelegate.qml (+45/-68)
calendar.qml (+119/-109)
calendarTests.qml (+2/-2)
po/com.ubuntu.calendar.pot (+3/-3)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-calendar-app/optimize
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Needs Fixing
Kunal Parmar Needs Information
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+254398@code.launchpad.net

This proposal has been superseded by a proposal from 2016-01-25.

Commit message

Optimize MonthComponent

To post a comment you must log in.
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
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

added inline comment

review: Needs Information
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
624. By Renato Araujo Oliveira Filho

Use only one UbuntuShape on MonComponent.

Move the UbuntuShape component based on today/selected items.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
625. By Renato Araujo Oliveira Filho

Update to SDK 1.3 and Quick 2.4

626. By Renato Araujo Oliveira Filho

Optimize views.

627. By Renato Araujo Oliveira Filho

Trunk merged.

628. By Renato Araujo Oliveira Filho

Parent merged.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
629. By Renato Araujo Oliveira Filho

Parent merged.

630. By Renato Araujo Oliveira Filho

Fixed wrong merge.

631. By Renato Araujo Oliveira Filho

Make year view delegates async.

632. By Renato Araujo Oliveira Filho

Use only one mouse area for the month view, instead of an individual mouse area for each day delegate.
Split MonthDay delegate in two different classes to be used on year view and month view.

633. By Renato Araujo Oliveira Filho

Fixed WeekView start date.

634. By Renato Araujo Oliveira Filho

Make sure that new events are created in the last selected date.

635. By Renato Araujo Oliveira Filho

Make sure the page on week view scroll to correct position while swiping it.

636. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/week-press-and-hold-create-event

637. By Renato Araujo Oliveira Filho

Create a binding for main event filter to avoid problems with the filter changes.

638. By Renato Araujo Oliveira Filho

Update changes on parent branch.

639. By Renato Araujo Oliveira Filho

Fixed "today" action on week view.

640. By Renato Araujo Oliveira Filho

Merged: lp:~renatofilho/ubuntu-calendar-app/week-press-and-hold-create-event

641. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/fix-add-guest-search-field

642. By Renato Araujo Oliveira Filho

merged: ~renatofilho/ubuntu-calendar-app/week-press-and-hold-create-event

643. By Renato Araujo Oliveira Filho

merged: ~renatofilho/ubuntu-calendar-app/fix-add-guest-search-field

644. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/fix-add-guest-search-field

645. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/optimize-page-load

646. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/bottom-edge

647. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/week-press-and-hold-create-event

648. By Renato Araujo Oliveira Filho

Does not change main date if the current date change on views.

649. By Renato Araujo Oliveira Filho

Trunk merged

650. By Renato Araujo Oliveira Filho

Make sure that new event is created on highlighted date if selected.

651. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/bottom-edge

652. By Renato Araujo Oliveira Filho

Make sure tha the today event get highlight on month and year view.

653. By Renato Araujo Oliveira Filho

lp:~renatofilho/ubuntu-calendar-app/bottom-edge

654. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/bottom-edge

655. By Renato Araujo Oliveira Filho

Revert changes on KeyboardRectangle.qml

656. By Renato Araujo Oliveira Filho

Improve animation when keyboard appears.

657. By Renato Araujo Oliveira Filho

Avoid crash when application closes with bottom edge open.

658. By Renato Araujo Oliveira Filho

Avoid contact list to stole focus from text field on ContactChoicePopup.

659. By Renato Araujo Oliveira Filho

Show a activity indicator while rebuild events.
Make sure only bubble events are destroyed while rebuild events.

660. By Renato Araujo Oliveira Filho

Allow create all day events by pressing and hold at all day header.

661. By Renato Araujo Oliveira Filho

Make sure the timeline events are recreated when model changes.

662. By Renato Araujo Oliveira Filho

Only create all days events after release the mouse button.

663. By Renato Araujo Oliveira Filho

Use bottom edge element to create new events, intead of pushing new pages.
Avoid update unactive pages when model changes.

664. By Renato Araujo Oliveira Filho

Disabled predictive text for event title and location.

665. By Renato Araujo Oliveira Filho

Avoid warning messages if startDate/endDate is unset.

666. By Renato Araujo Oliveira Filho

Fixed event drawing.

667. By Renato Araujo Oliveira Filho

Remove debug message.

668. By Renato Araujo Oliveira Filho

Fix endDate set on new event page.

669. By Renato Araujo Oliveira Filho

Keep new event page visible until the event is saved on database.

670. By Renato Araujo Oliveira Filho

Wek view bottom edge always create event with today date.

671. By Renato Araujo Oliveira Filho

Create new event based on scrolled view.

672. By Renato Araujo Oliveira Filho

Does not create new event on all day click.

You need to press and hold.

673. By Renato Araujo Oliveira Filho

Avoid run several events re-layout at the same time.

674. By Renato Araujo Oliveira Filho

Emit 'bottomEdgeCommit' when opening bottom edge.

675. By Renato Araujo Oliveira Filho

Make sure that week view is scrolled to current time when app is opened.
Fix 'today' action to correct scroll to current date on week view.

676. By Renato Araujo Oliveira Filho

Allow to edit single events on all day header.

677. By Renato Araujo Oliveira Filho

Wait 1sec before do the model query in week view and day view.

678. By Renato Araujo Oliveira Filho

Always create today event on week view bottom edge.
Create current day and now time event in day view bottom edge.

679. By Renato Araujo Oliveira Filho

Make sure that all day views scroll to the same position.

680. By Renato Araujo Oliveira Filho

Only update model events when PathView stop to move.

681. By Renato Araujo Oliveira Filho

Remove debug message.

682. By Renato Araujo Oliveira Filho

Update month view to run query only after scrolls stops.

683. By Renato Araujo Oliveira Filho

Keep dates in sync btw panels.

684. By Renato Araujo Oliveira Filho

Optimize day/week/month view.

685. By Renato Araujo Oliveira Filho

After create a new event scroll view to new event position.

686. By Renato Araujo Oliveira Filho

Show a spinner while saving an item after move it.

687. By Renato Araujo Oliveira Filho

Fixed scroll to today for week view and day view.

688. By Renato Araujo Oliveira Filho

Fixed event drawing.

Make sure that the incubator object is created before continue creating events.

689. By Renato Araujo Oliveira Filho

Write better code.

690. By Renato Araujo Oliveira Filho

Use QOrganizerItemModel instead of EventListModel in TimeLine component.

691. By Renato Araujo Oliveira Filho

Does not try to scroll to created event date if the event is already visible.

692. By Renato Araujo Oliveira Filho

Remove debug messages.

693. By Renato Araujo Oliveira Filho

Vertical centralize view after scroll to a date.

694. By Renato Araujo Oliveira Filho

Does not scroll back to today page after go back from contact details.

695. By Renato Araujo Oliveira Filho

Rewrite events layout and drawing;

Events will be drawed without overlap eachother;
Events will be resized to fit in the day column;

696. By Renato Araujo Oliveira Filho

Use async function to calculate event layout.

697. By Renato Araujo Oliveira Filho

Created unit test for new calentar layout function

698. By Renato Araujo Oliveira Filho

Remove unecessary code.

699. By Renato Araujo Oliveira Filho

Added comments.

700. By Renato Araujo Oliveira Filho

Make the now time separator always visible.

701. By Renato Araujo Oliveira Filho

Avoid to draw events too small and make impossible to read events title.

702. By Renato Araujo Oliveira Filho

Update current time separator line every 5 minutes.

703. By Renato Araujo Oliveira Filho

Use EleventListModel because of helper functions necessary on NewEvent page.
Avoid re-draw events while the worker script still running.

704. By Renato Araujo Oliveira Filho

Centralize event after creation.

705. By Renato Araujo Oliveira Filho

Fixed event date used for bottom edge on day view.

706. By Renato Araujo Oliveira Filho

Year view always create event on today date when using bottom edge.

707. By Renato Araujo Oliveira Filho

Switching from week to day view will show the first day of the week or the last event start date clicked.

708. By Renato Araujo Oliveira Filho

Conflict solved.

709. By Renato Araujo Oliveira Filho

Make sure that year view shows the application global date year when opening.

710. By Renato Araujo Oliveira Filho

Optimize event layout function.

711. By Renato Araujo Oliveira Filho

Fix event drawing.

712. By Renato Araujo Oliveira Filho

Make sur that the week view is opened on the tabs.Day.

713. By Renato Araujo Oliveira Filho

Fixed event edit with contacts.

714. By Renato Araujo Oliveira Filho

Make sure that event bubble is correct drawed if event data changes after bubble creation.

715. By Renato Araujo Oliveira Filho

Does not draw too small events.

716. By Renato Araujo Oliveira Filho

Redraw events if it get update while the worker script was running.

717. By Renato Araujo Oliveira Filho

Does not redraw DayView if the global date only changes the time.

718. By Renato Araujo Oliveira Filho

Fixed floating event size.

719. By Renato Araujo Oliveira Filho

Use the default collection to create events if it is enabled ortherwise return the first enabled collection.
Fix all day events creation.

720. By Renato Araujo Oliveira Filho

If week start and end in different month show both month names in the week view title.

721. By Renato Araujo Oliveira Filho

Fix today scroll in day view.

722. By Renato Araujo Oliveira Filho

Make sure that Day/Week view scroll to correct date while alternating btw views.

723. By Renato Araujo Oliveira Filho

Update application click framework.

724. By Renato Araujo Oliveira Filho

Avoid time scroll after create a all day event.

725. By Renato Araujo Oliveira Filho

Show event full title on all day header if the space is bigger than units.gu(15)

726. By Renato Araujo Oliveira Filho

Fix all day events edit.

727. By Renato Araujo Oliveira Filho

Do not scroll vertically for all day events.

728. By Renato Araujo Oliveira Filho

Parent merged.

729. By Renato Araujo Oliveira Filho

Use events word instead of 'ev.' for all day events.

730. By Renato Araujo Oliveira Filho

Update events filter if the collections changed.

731. By Renato Araujo Oliveira Filho

Update apparmor policy version.

732. By Renato Araujo Oliveira Filho

Disable model update while sync is in progress to avoid several updates.

733. By Renato Araujo Oliveira Filho

Keep event bubble color in sync with calendar event color.

734. By Renato Araujo Oliveira Filho

Fixed day view title.

735. By Renato Araujo Oliveira Filho

Fixed uri handler for eventId.

736. By Renato Araujo Oliveira Filho

Fix new event reminders and repeater.

Unmerged revisions

736. By Renato Araujo Oliveira Filho

Fix new event reminders and repeater.

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 2015-07-11 02:18:03 +0000
3+++ AgendaView.qml 2016-01-25 17:43:39 +0000
4@@ -16,9 +16,9 @@
5 * along with this program. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8-import QtQuick 2.3
9+import QtQuick 2.4
10 import QtOrganizer 5.0
11-import Ubuntu.Components 1.1
12+import Ubuntu.Components 1.3
13 import Ubuntu.Components.ListItems 1.0 as ListItem
14 import "dateExt.js" as DateExt
15
16
17=== modified file 'AllDayEventComponent.qml'
18--- AllDayEventComponent.qml 2015-08-07 06:20:23 +0000
19+++ AllDayEventComponent.qml 2016-01-25 17:43:39 +0000
20@@ -15,8 +15,8 @@
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 */
24-import QtQuick 2.3
25-import Ubuntu.Components 1.1
26+import QtQuick 2.4
27+import Ubuntu.Components 1.3
28 import Ubuntu.Components.Popups 1.0
29 import QtOrganizer 5.0
30
31
32=== modified file 'CalendarChoicePopup.qml'
33--- CalendarChoicePopup.qml 2015-05-28 13:56:12 +0000
34+++ CalendarChoicePopup.qml 2016-01-25 17:43:39 +0000
35@@ -15,8 +15,8 @@
36 * You should have received a copy of the GNU General Public License
37 * along with this program. If not, see <http://www.gnu.org/licenses/>.
38 */
39-import QtQuick 2.3
40-import Ubuntu.Components 1.1
41+import QtQuick 2.4
42+import Ubuntu.Components 1.3
43 import Ubuntu.Components.Popups 1.0
44 import Ubuntu.Components.ListItems 1.0 as ListItem
45 import QtOrganizer 5.0
46
47=== modified file 'CalendarListButtonDelegate.qml'
48--- CalendarListButtonDelegate.qml 2015-05-28 13:58:30 +0000
49+++ CalendarListButtonDelegate.qml 2016-01-25 17:43:39 +0000
50@@ -14,8 +14,8 @@
51 * along with this program. If not, see <http://www.gnu.org/licenses/>.
52 */
53
54-import QtQuick 2.0
55-import Ubuntu.Components 1.1
56+import QtQuick 2.4
57+import Ubuntu.Components 1.3
58 import Ubuntu.Components.ListItems 1.0 as ListItem
59
60 ListItem.Standard {
61
62=== modified file 'ColorPickerDialog.qml'
63--- ColorPickerDialog.qml 2015-04-14 19:52:04 +0000
64+++ ColorPickerDialog.qml 2016-01-25 17:43:39 +0000
65@@ -15,8 +15,8 @@
66 * You should have received a copy of the GNU General Public License
67 * along with this program. If not, see <http://www.gnu.org/licenses/>.
68 */
69-import QtQuick 2.3
70-import Ubuntu.Components 1.1
71+import QtQuick 2.4
72+import Ubuntu.Components 1.3
73 import Ubuntu.Components.Popups 1.0
74
75 Dialog {
76
77=== modified file 'ContactChoicePopup.qml'
78--- ContactChoicePopup.qml 2015-05-14 03:36:22 +0000
79+++ ContactChoicePopup.qml 2016-01-25 17:43:39 +0000
80@@ -15,8 +15,8 @@
81 * You should have received a copy of the GNU General Public License
82 * along with this program. If not, see <http://www.gnu.org/licenses/>.
83 */
84-import QtQuick 2.3
85-import Ubuntu.Components 1.1
86+import QtQuick 2.4
87+import Ubuntu.Components 1.3
88 import Ubuntu.Components.Popups 1.0
89 import Ubuntu.Components.ListItems 1.0
90 import Ubuntu.Components.Themes.Ambiance 1.0
91
92=== modified file 'DayView.qml'
93--- DayView.qml 2015-11-23 07:15:20 +0000
94+++ DayView.qml 2016-01-25 17:43:39 +0000
95@@ -16,8 +16,8 @@
96 * along with this program. If not, see <http://www.gnu.org/licenses/>.
97 */
98
99-import QtQuick 2.3
100-import Ubuntu.Components 1.1
101+import QtQuick 2.4
102+import Ubuntu.Components 1.3
103 import "dateExt.js" as DateExt
104 import "ViewType.js" as ViewType
105
106@@ -25,8 +25,8 @@
107 id: dayViewPage
108 objectName: "dayViewPage"
109
110- property var currentDay: new Date()
111- property bool isCurrentPage: false
112+ property var anchorDate: new Date()
113+ readonly property var currentDate: dayViewPath.currentItem.startDay
114
115 signal dateSelected(var date);
116
117@@ -39,7 +39,8 @@
118 iconName: "calendar-today"
119 text: i18n.tr("Today")
120 onTriggered: {
121- currentDay = new Date()
122+ dayViewPath.scrollToBegginer()
123+ anchorDate = new Date()
124 }
125 }
126
127@@ -57,7 +58,7 @@
128 id:monthYear
129 objectName:"monthYearLabel"
130 fontSize: "x-large"
131- text: currentDay.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
132+ text: currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
133 font.capitalization: Font.Capitalize
134 }
135 }
136@@ -66,74 +67,53 @@
137 id: dayViewPath
138 objectName: "dayViewPath"
139
140- property var startDay: currentDay
141 //This is used to scroll all view together when currentItem scrolls
142 property var childContentY;
143
144 anchors.fill: parent
145
146- onNextItemHighlighted: {
147- //next day
148- currentDay = currentDay.addDays(1);
149- }
150-
151- onPreviousItemHighlighted: {
152- //previous day
153- currentDay = currentDay.addDays(-1);
154- }
155-
156- delegate: Loader {
157+ delegate: TimeLineBaseComponent {
158+ id: timeLineView
159+ objectName: "DayComponent-"+index
160+
161 width: parent.width
162 height: parent.height
163- asynchronous: !dayViewPath.isCurrentItem
164- sourceComponent: delegateComponent
165-
166- Component {
167- id: delegateComponent
168-
169- TimeLineBaseComponent {
170- id: timeLineView
171- objectName: "DayComponent-"+index
172-
173- type: ViewType.ViewTypeDay
174- anchors.fill: parent
175-
176- isActive: parent.PathView.isCurrentItem
177- contentInteractive: parent.PathView.isCurrentItem
178- startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
179- keyboardEventProvider: dayViewPath
180-
181- Component.onCompleted: {
182- if(dayViewPage.isCurrentPage){
183- timeLineView.scrollToCurrentTime();
184- }
185- }
186-
187- Connections{
188- target: dayViewPage
189- onIsCurrentPageChanged:{
190- if(dayViewPage.isCurrentPage){
191- timeLineView.scrollToCurrentTime();
192- }
193- }
194- }
195-
196- //get contentY value from PathView, if its not current Item
197- Binding{
198- target: timeLineView
199- property: "contentY"
200- value: dayViewPath.childContentY;
201- when: !parent.PathView.isCurrentItem
202- }
203-
204- //set PathView's contentY property, if its current item
205- Binding{
206- target: dayViewPath
207- property: "childContentY"
208- value: contentY
209- when: parent.PathView.isCurrentItem
210- }
211- }
212+
213+ type: ViewType.ViewTypeDay
214+ isActive: PathView.isCurrentItem
215+ contentInteractive: PathView.isCurrentItem
216+ startDay: anchorDate.addDays(dayViewPath.loopCurrentIndex + dayViewPath.indexType(index))
217+ keyboardEventProvider: dayViewPath
218+
219+ Component.onCompleted: {
220+ if(dayViewPage.active){
221+ timeLineView.scrollToCurrentTime();
222+ }
223+ }
224+
225+ Connections{
226+ target: dayViewPage
227+ onActiveChanged: {
228+ if(dayViewPage.active){
229+ timeLineView.scrollToCurrentTime();
230+ }
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: !parent.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: parent.PathView.isCurrentItem
248 }
249 }
250 }
251
252=== modified file 'Defines.js'
253--- Defines.js 2014-10-22 14:03:01 +0000
254+++ Defines.js 2016-01-25 17:43:39 +0000
255@@ -43,8 +43,8 @@
256
257 function getWeekLabels(){
258 var object = Qt.createQmlObject('\
259- import QtQuick 2.3;\
260- import Ubuntu.Components 1.1;\
261+ import QtQuick 2.4;\
262+ import Ubuntu.Components 1.3;\
263 QtObject {\
264 property var weekLabel:[Qt.locale().dayName(7,Locale.NarrowFormat),\
265 Qt.locale().dayName(1,Locale.NarrowFormat),\
266
267=== modified file 'DeleteConfirmationDialog.qml'
268--- DeleteConfirmationDialog.qml 2014-10-14 17:20:13 +0000
269+++ DeleteConfirmationDialog.qml 2016-01-25 17:43:39 +0000
270@@ -15,8 +15,8 @@
271 * You should have received a copy of the GNU General Public License
272 * along with this program. If not, see <http://www.gnu.org/licenses/>.
273 */
274-import QtQuick 2.3
275-import Ubuntu.Components 1.1
276+import QtQuick 2.4
277+import Ubuntu.Components 1.3
278 import Ubuntu.Components.Popups 1.0
279
280 Dialog {
281
282=== modified file 'EditEventConfirmationDialog.qml'
283--- EditEventConfirmationDialog.qml 2014-10-14 17:20:13 +0000
284+++ EditEventConfirmationDialog.qml 2016-01-25 17:43:39 +0000
285@@ -15,8 +15,8 @@
286 * You should have received a copy of the GNU General Public License
287 * along with this program. If not, see <http://www.gnu.org/licenses/>.
288 */
289-import QtQuick 2.3
290-import Ubuntu.Components 1.1
291+import QtQuick 2.4
292+import Ubuntu.Components 1.3
293 import Ubuntu.Components.Popups 1.0
294
295 Dialog {
296
297=== modified file 'EventActions.qml'
298--- EventActions.qml 2015-07-11 02:18:03 +0000
299+++ EventActions.qml 2016-01-25 17:43:39 +0000
300@@ -16,8 +16,8 @@
301 * along with this program. If not, see <http://www.gnu.org/licenses/>.
302 */
303
304-import QtQuick 2.3
305-import Ubuntu.Components 1.1
306+import QtQuick 2.4
307+import Ubuntu.Components 1.3
308 import Ubuntu.SyncMonitor 0.1
309
310 Item {
311
312=== modified file 'EventBubble.qml'
313--- EventBubble.qml 2015-11-29 03:17:30 +0000
314+++ EventBubble.qml 2016-01-25 17:43:39 +0000
315@@ -16,8 +16,8 @@
316 * along with this program. If not, see <http://www.gnu.org/licenses/>.
317 */
318
319-import QtQuick 2.3
320-import Ubuntu.Components 1.1
321+import QtQuick 2.4
322+import Ubuntu.Components 1.3
323 import QtOrganizer 5.0
324
325 Item{
326
327=== modified file 'EventDetails.qml'
328--- EventDetails.qml 2015-08-03 04:47:59 +0000
329+++ EventDetails.qml 2016-01-25 17:43:39 +0000
330@@ -15,8 +15,8 @@
331 * You should have received a copy of the GNU General Public License
332 * along with this program. If not, see <http://www.gnu.org/licenses/>.
333 */
334-import QtQuick 2.3
335-import Ubuntu.Components 1.1
336+import QtQuick 2.4
337+import Ubuntu.Components 1.3
338 import Ubuntu.Components.ListItems 1.0 as ListItem
339 import Ubuntu.Components.Themes.Ambiance 1.0
340 import Ubuntu.Components.Popups 1.0
341@@ -209,7 +209,7 @@
342 dialog.editEvent.connect( function(eventId){
343 if( eventId === event.parentId ) {
344 showEditEventPage(internal.parentEvent, model)
345- } else {
346+ } else {
347 showEditEventPage(event, model)
348 }
349 });
350
351=== modified file 'EventReminder.qml'
352--- EventReminder.qml 2015-07-12 03:39:07 +0000
353+++ EventReminder.qml 2016-01-25 17:43:39 +0000
354@@ -16,8 +16,8 @@
355 * along with this program. If not, see <http://www.gnu.org/licenses/>.
356 */
357
358-import QtQuick 2.3
359-import Ubuntu.Components 1.1
360+import QtQuick 2.4
361+import Ubuntu.Components 1.3
362 import Ubuntu.Components.ListItems 1.0 as ListItem
363
364 Page{
365
366=== modified file 'EventRepetition.qml'
367--- EventRepetition.qml 2015-07-11 11:33:00 +0000
368+++ EventRepetition.qml 2016-01-25 17:43:39 +0000
369@@ -16,9 +16,9 @@
370 * along with this program. If not, see <http://www.gnu.org/licenses/>.
371 */
372
373-import QtQuick 2.3
374+import QtQuick 2.4
375 import QtOrganizer 5.0
376-import Ubuntu.Components 1.1
377+import Ubuntu.Components 1.3
378 import Ubuntu.Components.ListItems 1.0 as ListItem
379 import Ubuntu.Components.Pickers 1.0
380 import QtOrganizer 5.0
381
382=== modified file 'EventUtils.qml'
383--- EventUtils.qml 2014-10-04 04:37:34 +0000
384+++ EventUtils.qml 2016-01-25 17:43:39 +0000
385@@ -16,8 +16,8 @@
386 * along with this program. If not, see <http://www.gnu.org/licenses/>.
387 */
388
389-import QtQuick 2.3
390-import Ubuntu.Components 1.1
391+import QtQuick 2.4
392+import Ubuntu.Components 1.3
393 import QtOrganizer 5.0
394 import "Defines.js" as Defines
395 import "Recurrence.js" as Recurrence
396
397=== modified file 'HeaderDateComponent.qml'
398--- HeaderDateComponent.qml 2015-05-14 13:03:02 +0000
399+++ HeaderDateComponent.qml 2016-01-25 17:43:39 +0000
400@@ -16,8 +16,8 @@
401 * along with this program. If not, see <http://www.gnu.org/licenses/>.
402 */
403
404-import QtQuick 2.3
405-import Ubuntu.Components 1.1
406+import QtQuick 2.4
407+import Ubuntu.Components 1.3
408
409 Item {
410 id: root
411
412=== modified file 'MonthComponent.qml'
413--- MonthComponent.qml 2015-11-23 07:15:20 +0000
414+++ MonthComponent.qml 2016-01-25 17:43:39 +0000
415@@ -15,8 +15,10 @@
416 * You should have received a copy of the GNU General Public License
417 * along with this program. If not, see <http://www.gnu.org/licenses/>.
418 */
419-import QtQuick 2.3
420-import Ubuntu.Components 1.1
421+import QtQuick 2.4
422+import Ubuntu.Components 1.3
423+import QtQuick.Layouts 1.1
424+
425 import "dateExt.js" as DateExt
426 import "colorUtils.js" as Color
427
428@@ -25,12 +27,11 @@
429 objectName: "MonthComponent"
430
431 property bool isCurrentItem;
432-
433- property bool showEvents: false
434-
435- property var currentMonth;
436+ property int currentYear;
437+ property int currentMonth;
438+
439 property var isYearView;
440- property var selectedDay;
441+ property var highlightedDate;
442 property bool displayWeekNumber:false;
443
444 property string dayLabelFontSize: "medium"
445@@ -40,91 +41,59 @@
446
447 property alias dayLabelDelegate : dayLabelRepeater.delegate
448 property alias dateLabelDelegate : dateLabelRepeater.delegate
449+ readonly property alias monthStartDate: intern.monthStart
450
451 signal monthSelected(var date);
452 signal dateSelected(var date);
453 signal dateHighlighted(var date);
454
455- //creatng timer only if we need to show events in month
456- Loader {
457- id: timerLoader
458- sourceComponent: showEvents ? timerComp : undefined
459- }
460-
461- // Timer to delay creation of Model, There seems some problem fetching events if we create Model immediatly
462- Component {
463- id: timerComp
464- Timer{
465- interval: 200; running: true; repeat: false
466- onTriggered: {
467- modelLoader.sourceComponent = modelComponent
468- }
469- }
470- }
471-
472- Loader{
473- id: modelLoader
474- }
475-
476- Component{
477- id: modelComponent
478- EventListModel {
479- id: mainModel
480- startPeriod: intern.monthStart.midnight();
481- endPeriod: intern.monthStart.addDays((/*monthGrid.rows * cols */ 42 )-1).endOfDay()
482- filter: eventModel.filter
483- onModelChanged: {
484- intern.eventStatus = Qt.binding(function() { return mainModel.containsItems(startPeriod, endPeriod, 86400/*24*60*60*/)});
485- }
486- }
487+ function updateEvents(events) {
488+ intern.eventStatus = events
489 }
490
491 QtObject{
492 id: intern
493
494- property var eventStatus;
495-
496- property int curMonthDate: currentMonth.getDate()
497- property int curMonth: currentMonth.getMonth()
498- property int curMonthYear: currentMonth.getFullYear()
499+ property var eventStatus: new Array(42)
500
501 property var today: DateExt.today()
502 property int todayDate: today.getDate()
503 property int todayMonth: today.getMonth()
504 property int todayYear: today.getFullYear()
505
506-
507 //date from month will start, this date might be from previous month
508- property var monthStart: currentMonth.weekStart( Qt.locale().firstDayOfWeek )
509+ property var currentDate: new Date(root.currentYear, root.currentMonth, 1, 0, 0, 0, 0)
510+ property var monthStart: currentDate.weekStart( Qt.locale().firstDayOfWeek )
511 property int monthStartDate: monthStart.getDate()
512 property int monthStartMonth: monthStart.getMonth()
513 property int monthStartYear: monthStart.getFullYear()
514-
515 property int daysInStartMonth: Date.daysInMonth(monthStartYear, monthStartMonth)
516- property int daysInCurMonth: Date.daysInMonth(curMonthYear,curMonth)
517
518 //check if current month is start month
519- property bool isCurMonthStartMonth: curMonthDate === monthStartDate
520- && curMonth === monthStartMonth
521- && curMonthYear === monthStartYear
522+ property bool isCurMonthStartMonth: root.currentMonth === monthStartMonth &&
523+ root.currentYear === monthStartYear
524
525 //check current month is same as today's month
526- property bool isCurMonthTodayMonth: todayYear === curMonthYear && todayMonth == curMonth
527+ property bool isCurMonthTodayMonth: todayYear === root.currentYear &&
528+ todayMonth == root.currentMonth
529 //offset from current month's first date to start date of current month
530 property int offset: isCurMonthStartMonth ? -1 : (daysInStartMonth - monthStartDate)
531
532 property int dateFontSize: FontUtils.sizeToPixels(root.dateLabelFontSize)
533 property int dayFontSize: FontUtils.sizeToPixels(root.dayLabelFontSize)
534
535- property int selectedIndex: -1
536-
537- function findSelectedDayIndex(){
538- if(!selectedDay) {
539+ property int highlightedIndex: root.isCurrentItem &&
540+ root.highlightedDate ?
541+ intern.indexByDate(root.highlightedDate) : -1
542+ function indexByDate(date){
543+ if (!date) {
544 return -1;
545 }
546
547- if( todayMonth === selectedDay.getMonth() && selectedDay.getFullYear() === todayYear){
548- return selectedDay.getDate() +
549+ if ((root.currentMonth === date.getMonth()) &&
550+ (root.currentYear === date.getFullYear())) {
551+
552+ return date.getDate() +
553 (Date.daysInMonth(monthStartYear, monthStartMonth) - monthStartDate);
554 } else {
555 return -1;
556@@ -132,14 +101,40 @@
557 }
558 }
559
560- onSelectedDayChanged: {
561- if( isCurrentItem ) {
562- intern.selectedIndex = intern.findSelectedDayIndex();
563+ UbuntuShape{
564+ id: todayShape
565+
566+ visible: root.isCurrentItem && intern.isCurMonthTodayMonth && monthGrid.todayItem != null
567+ color: (monthGrid.highlightedItem === monthGrid.todayItem) ? UbuntuColors.darkGrey : UbuntuColors.orange
568+ width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
569+ height: width
570+ parent: monthGrid.todayItem
571+ anchors.centerIn: parent
572+ z: -1
573+ Rectangle {
574+ anchors.fill: parent
575+ anchors.margins: units.gu(0.5)
576+ color: UbuntuColors.orange
577+ radius: 5
578 }
579 }
580
581- onCurrentMonthChanged: {
582- intern.selectedIndex = -1;
583+ UbuntuShape{
584+ id: highlightedShape
585+
586+ visible: monthGrid.highlightedItem && (monthGrid.highlightedItem != monthGrid.todayItem)
587+ color: UbuntuColors.darkGrey
588+ width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
589+ height: width
590+ parent: monthGrid.highlightedItem
591+ anchors.centerIn: parent
592+ z: -1
593+ Rectangle {
594+ anchors.fill: parent
595+ anchors.margins: units.gu(0.5)
596+ color: UbuntuColors.lightGrey
597+ radius: 5
598+ }
599 }
600
601 Column{
602@@ -165,8 +160,8 @@
603 ViewHeader{
604 id: monthHeader
605 anchors.fill: parent
606- month: intern.curMonth
607- year: intern.curMonthYear
608+ month: root.currentMonth
609+ year: root.currentYear
610
611 monthLabelFontSize: root.monthLabelFontSize
612 yearLabelFontSize: root.yearLabelFontSize
613@@ -184,9 +179,11 @@
614
615 property int dayWidth: width / 7;
616
617- width: parent.width
618- anchors.horizontalCenter: parent.horizontalCenter
619- anchors.verticalCenter: parent.verticalCenter
620+ anchors{
621+ left: parent.left
622+ right: parent.right
623+ verticalCenter: parent.verticalCenter
624+ }
625
626 Repeater{
627 id: dayLabelRepeater
628@@ -196,23 +193,43 @@
629 }
630 }
631
632- Grid{
633+ Grid {
634 id: monthGrid
635 objectName: "monthGrid"
636
637- width: parent.width
638- height: parent.height - monthGrid.y
639-
640 property int dayWidth: width / 7 /*cols*/;
641 property int dayHeight: height / 6/*rows*/;
642-
643- rows: 6
644+ property var todayItem: null
645+ readonly property var highlightedItem: intern.highlightedIndex != -1 ?
646+ dateLabelRepeater.itemAt(intern.highlightedIndex) : null
647+ anchors {
648+ left: parent.left
649+ right: parent.right
650+ }
651+ height: parent.height - monthGrid.y
652 columns: 7
653
654 Repeater{
655 id: dateLabelRepeater
656- model: 42 //monthGrid.rows * monthGrid.columns
657- delegate: defaultDateLabelComponent
658+ model: 42
659+ delegate: MonthComponentDateDelegate {
660+ property var delegateDate: intern.monthStart.addDays(index)
661+
662+ date: delegateDate.getDate()
663+ isCurrentMonth: delegateDate.getMonth() === root.currentMonth
664+ showEvent: intern.eventStatus[index] === true
665+
666+ isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
667+ isSelected: intern.highlightedIndex == index
668+ width: monthGrid.dayWidth
669+ height: monthGrid.dayHeight
670+
671+ onIsTodayChanged: {
672+ if (isToday) {
673+ monthGrid.todayItem = this
674+ }
675+ }
676+ }
677 }
678 }
679 }
680@@ -299,52 +316,9 @@
681 }
682
683 Component{
684- id: defaultDateLabelComponent
685- MonthComponentDateDelegate{
686- date: {
687- //try to find date from index and month's first week's first date
688- var temp = intern.daysInStartMonth - intern.offset + index
689- //date exceeds days in startMonth,
690- //this means previous month is over and we are now in current month
691- //to get actual date we need to remove number of days in startMonth
692- if( temp > intern.daysInStartMonth ) {
693- temp = temp - intern.daysInStartMonth
694- //date exceeds days in current month
695- // this means date is from next month
696- //to get actual date we need to remove number of days in current month
697- if( temp > intern.daysInCurMonth ) {
698- temp = temp - intern.daysInCurMonth
699- }
700- }
701- return temp;
702- }
703-
704- isCurrentMonth: {
705- //remove offset from index
706- //if index falls in 1 to no of days in current month
707- //then date is inside current month
708- var temp = index - intern.offset
709- return (temp >= 1 && temp <= intern.daysInCurMonth)
710- }
711-
712- isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
713-
714- isSelected: showEvents && intern.selectedIndex == index
715-
716- width: parent.dayWidth
717- height: parent.dayHeight
718- fontSize: intern.dateFontSize
719- showEvent: showEvents
720- && intern.eventStatus !== undefined
721- && intern.eventStatus[index] !== undefined
722- && intern.eventStatus[index]
723- }
724- }
725-
726- Component{
727 id: dafaultDayLabelComponent
728
729- Label{
730+ Text {
731 id: weekDay
732 objectName: "weekDay" + index
733 width: parent.dayWidth
734
735=== modified file 'MonthComponentDateDelegate.qml'
736--- MonthComponentDateDelegate.qml 2015-09-05 05:30:23 +0000
737+++ MonthComponentDateDelegate.qml 2016-01-25 17:43:39 +0000
738@@ -1,5 +1,5 @@
739-import QtQuick 2.0
740-import Ubuntu.Components 1.1
741+import QtQuick 2.4
742+import Ubuntu.Components 1.3
743
744 Item{
745 id: dateRootItem
746@@ -9,27 +9,12 @@
747 property bool isToday;
748 property bool showEvent;
749 property alias fontSize: dateLabel.font.pixelSize
750-
751 property bool isSelected: false
752
753- Loader {
754- sourceComponent: (isToday && isCurrentMonth) || isSelected ? highLightComp : undefined
755-
756- onSourceComponentChanged: {
757- width = Qt.binding( function() {
758- var width = dateRootItem.height > dateRootItem.width ? dateRootItem.width :dateRootItem.height
759- return ( width / 1.3 );
760- });
761- height = Qt.binding ( function() { return width} );
762- anchors.centerIn = Qt.binding( function() { return dateLabel});
763- }
764- }
765-
766- Label {
767+ Text {
768 id: dateLabel
769 anchors.centerIn: parent
770 text: date
771- fontSize: root.dateLabelFontSize
772 color: {
773 if( isCurrentMonth ) {
774 if( isToday || isSelected ) {
775@@ -47,46 +32,19 @@
776 }
777 }
778
779- Loader{
780- sourceComponent: showEvent ? eventIndicatorComp : undefined
781- onSourceComponentChanged: {
782- width = Qt.binding( function() { return units.gu(0.8)})
783- height = Qt.binding( function() { return width })
784- anchors.horizontalCenter = Qt.binding( function() { return parent.horizontalCenter })
785- anchors.top = Qt.binding( function() { return parent.verticalCenter })
786- anchors.topMargin = Qt.binding( function() {
787- var w = (dateRootItem.height > dateRootItem.width ? dateRootItem.width :dateRootItem.height)/1.3
788- return (w/2) + units.gu(0.1)
789- });
790- }
791- }
792-
793- Component{
794- id: eventIndicatorComp
795- Rectangle {
796- anchors.fill: parent
797- radius: height/2
798- color: "black"
799- }
800- }
801-
802- Component{
803- id: highLightComp
804- UbuntuShape{
805- color: {
806- if( isToday && !isSelected ) {
807- "#DD4814"
808- } else {
809- "gray"
810- }
811- }
812-
813- Rectangle{
814- anchors.fill: parent
815- anchors.margins: units.gu(0.5)
816- color: isToday ? "#DD4814" : "darkgray"
817- }
818- }
819+ Rectangle {
820+ id: eventIndicator
821+
822+ width: units.gu(0.8)
823+ height: width
824+ anchors {
825+ horizontalCenter: parent.horizontalCenter
826+ top: parent.verticalCenter
827+ topMargin: ((Math.min(parent.height, dateRootItem.width) / 1.3) / 2) + units.gu(0.1)
828+ }
829+ radius: height/2
830+ color:"black"
831+ visible: showEvent
832 }
833
834 MouseArea {
835@@ -113,7 +71,6 @@
836 //If monthView is clicked then open selected DayView
837 root.dateSelected(selectedDate);
838 } else {
839- intern.selectedIndex = index
840 root.dateHighlighted(selectedDate)
841 }
842 }
843
844=== modified file 'MonthView.qml'
845--- MonthView.qml 2015-11-23 07:15:20 +0000
846+++ MonthView.qml 2016-01-25 17:43:39 +0000
847@@ -15,8 +15,8 @@
848 * You should have received a copy of the GNU General Public License
849 * along with this program. If not, see <http://www.gnu.org/licenses/>.
850 */
851-import QtQuick 2.3
852-import Ubuntu.Components 1.1
853+import QtQuick 2.4
854+import Ubuntu.Components 1.3
855 import "dateExt.js" as DateExt
856 import "colorUtils.js" as Color
857
858@@ -24,8 +24,10 @@
859 id: monthViewPage
860 objectName: "monthViewPage"
861
862- property var currentMonth: DateExt.today();
863+ property var anchorDate: DateExt.today();
864+ readonly property var currentDate: monthViewPath.currentItem.indexDate
865 property var selectedDay;
866+ property var highlightedDate;
867
868 signal dateSelected(var date);
869 signal dateHighlighted(var date);
870@@ -38,7 +40,8 @@
871 iconName: "calendar-today"
872 text: i18n.tr("Today")
873 onTriggered: {
874- currentMonth = new Date().midnight()
875+ monthViewPath.scrollToBegginer()
876+ anchorDate = new Date().midnight()
877 }
878 }
879
880@@ -58,7 +61,7 @@
881 // TRANSLATORS: this is a time formatting string,
882 // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
883 // It's used in the header of the month and week views
884- text: currentMonth.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
885+ text: currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
886 font.capitalization: Font.Capitalize
887 }
888 }
889@@ -67,66 +70,28 @@
890 id: monthViewPath
891 objectName: "monthViewPath"
892
893- property var startMonth: currentMonth;
894-
895- anchors.top:parent.top
896-
897- width:parent.width
898- height: parent.height
899-
900- onNextItemHighlighted: {
901- nextMonth();
902- }
903-
904- onPreviousItemHighlighted: {
905- previousMonth();
906- }
907-
908- function nextMonth() {
909- currentMonth = addMonth(currentMonth, 1);
910- }
911-
912- function previousMonth() {
913- currentMonth = addMonth(currentMonth, -1);
914- }
915-
916- function addMonth(date,month) {
917- return new Date(date.getFullYear(), date.getMonth() + month, 1, 0, 0, 0);
918- }
919-
920- delegate: Loader {
921+ anchors.fill: parent
922+
923+ delegate: MonthWithEventsComponent {
924+ property var indexDate: monthViewPath.loopCurrentIndex === 0 ?
925+ anchorDate : anchorDate.addMonths(monthViewPath.loopCurrentIndex + monthViewPath.indexType(index))
926+
927+ currentMonth: indexDate.getMonth()
928+ currentYear: indexDate.getFullYear()
929+
930 width: parent.width - units.gu(4)
931 height: parent.height
932-
933- sourceComponent: delegateComponent
934- asynchronous: index !== monthViewPath.currentIndex
935-
936- Component {
937- id: delegateComponent
938-
939- MonthComponent {
940- isCurrentItem: index === monthViewPath.currentIndex
941-
942- showEvents: true
943-
944- displayWeekNumber: mainView.displayWeekNumber;
945-
946- anchors.fill: parent
947-
948- currentMonth: monthViewPath.addMonth(monthViewPath.startMonth,
949- monthViewPath.indexType(index));
950-
951- selectedDay: monthViewPage.selectedDay
952- isYearView: false
953-
954- onDateSelected: {
955- monthViewPage.dateSelected(date);
956- }
957-
958- onDateHighlighted: {
959- monthViewPage.dateHighlighted(date);
960- }
961- }
962+ isCurrentItem: (index === monthViewPath.currentIndex)
963+ displayWeekNumber: mainView.displayWeekNumber
964+ highlightedDate: monthViewPage.highlightedDate
965+ isYearView: false
966+
967+ onDateSelected: {
968+ monthViewPage.dateSelected(date);
969+ }
970+ onDateHighlighted: {
971+ monthViewPage.highlightedDate = date
972+ monthViewPage.dateHighlighted(date);
973 }
974 }
975 }
976
977=== modified file 'NewEvent.qml'
978--- NewEvent.qml 2015-08-24 05:08:46 +0000
979+++ NewEvent.qml 2016-01-25 17:43:39 +0000
980@@ -16,9 +16,9 @@
981 * along with this program. If not, see <http://www.gnu.org/licenses/>.
982 */
983
984-import QtQuick 2.3
985+import QtQuick 2.4
986 import QtOrganizer 5.0
987-import Ubuntu.Components 1.1
988+import Ubuntu.Components 1.3
989 import Ubuntu.Components.Popups 1.0
990 import Ubuntu.Components.ListItems 1.0 as ListItem
991 import Ubuntu.Components.Themes.Ambiance 1.0
992
993=== modified file 'NewEventEntryField.qml'
994--- NewEventEntryField.qml 2015-02-17 05:53:42 +0000
995+++ NewEventEntryField.qml 2016-01-25 17:43:39 +0000
996@@ -16,8 +16,8 @@
997 * along with this program. If not, see <http://www.gnu.org/licenses/>.
998 */
999
1000-import QtQuick 2.3
1001-import Ubuntu.Components 1.1
1002+import QtQuick 2.4
1003+import Ubuntu.Components 1.3
1004
1005 Label {
1006 id: root
1007
1008=== modified file 'NewEventTimePicker.qml'
1009--- NewEventTimePicker.qml 2014-10-21 18:58:31 +0000
1010+++ NewEventTimePicker.qml 2016-01-25 17:43:39 +0000
1011@@ -1,4 +1,4 @@
1012-import QtQuick 2.3
1013+import QtQuick 2.4
1014 import Ubuntu.Components.ListItems 1.0 as ListItem
1015 import Ubuntu.Components.Themes.Ambiance 1.0
1016 import Ubuntu.Components.Pickers 1.0
1017
1018=== modified file 'OnlineAccountsHelper.qml'
1019--- OnlineAccountsHelper.qml 2015-03-28 11:31:47 +0000
1020+++ OnlineAccountsHelper.qml 2016-01-25 17:43:39 +0000
1021@@ -14,8 +14,8 @@
1022 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1023 */
1024
1025-import QtQuick 2.2
1026-import Ubuntu.Components 1.1
1027+import QtQuick 2.4
1028+import Ubuntu.Components 1.3
1029 import Ubuntu.OnlineAccounts 0.1
1030 import Ubuntu.OnlineAccounts.Client 0.1
1031
1032
1033=== modified file 'PathViewBase.qml'
1034--- PathViewBase.qml 2015-08-29 08:59:47 +0000
1035+++ PathViewBase.qml 2016-01-25 17:43:39 +0000
1036@@ -20,8 +20,7 @@
1037 PathView {
1038 id: root
1039
1040- model: 3
1041- snapMode: PathView.SnapOneItem
1042+ readonly property alias loopCurrentIndex: intern.loopCurrentIndex
1043
1044 signal nextItemHighlighted();
1045 signal previousItemHighlighted();
1046@@ -29,6 +28,8 @@
1047 signal scrollUp();
1048 signal scrollDown();
1049
1050+ model: 3
1051+ snapMode: PathView.SnapOneItem
1052 preferredHighlightBegin: 0.5
1053 preferredHighlightEnd: 0.5
1054
1055@@ -68,6 +69,11 @@
1056 }
1057 }
1058
1059+ function scrollToBegginer()
1060+ {
1061+ intern.loopCurrentIndex = intern.previousIndex = currentIndex = 0
1062+ }
1063+
1064 Keys.onLeftPressed:{
1065 root.decrementCurrentIndex();
1066 }
1067@@ -98,15 +104,17 @@
1068 intern.previousIndex = currentIndex
1069
1070 if ( diff > 0 ) {
1071- root.nextItemHighlighted();
1072+ intern.loopCurrentIndex++
1073 }
1074 else {
1075- root.previousItemHighlighted();
1076+ intern.loopCurrentIndex--
1077 }
1078 }
1079
1080 QtObject{
1081 id: intern
1082+
1083+ property int loopCurrentIndex: 0
1084 property int previousIndex: root.currentIndex
1085 }
1086 }
1087
1088=== modified file 'RecurrenceLabelDefines.qml'
1089--- RecurrenceLabelDefines.qml 2014-10-17 05:42:34 +0000
1090+++ RecurrenceLabelDefines.qml 2016-01-25 17:43:39 +0000
1091@@ -16,8 +16,8 @@
1092 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1093 */
1094
1095-import QtQuick 2.3
1096-import Ubuntu.Components 1.1
1097+import QtQuick 2.4
1098+import Ubuntu.Components 1.3
1099
1100 QtObject {
1101 property var recurrenceLabel:[i18n.tr("Once"),
1102
1103=== modified file 'Scroller.qml'
1104--- Scroller.qml 2014-09-20 10:45:35 +0000
1105+++ Scroller.qml 2016-01-25 17:43:39 +0000
1106@@ -16,8 +16,8 @@
1107 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1108 */
1109
1110-import QtQuick 2.3
1111-import Ubuntu.Components 1.1
1112+import QtQuick 2.4
1113+import Ubuntu.Components 1.3
1114 import Ubuntu.Components.ListItems 1.0 as ListItems
1115
1116 Item {
1117
1118=== modified file 'Settings.qml'
1119--- Settings.qml 2015-11-23 07:15:20 +0000
1120+++ Settings.qml 2016-01-25 17:43:39 +0000
1121@@ -15,8 +15,8 @@
1122 * You should have received a copy of the GNU General Public License
1123 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1124 */
1125-import QtQuick 2.3
1126-import Ubuntu.Components 1.1
1127+import QtQuick 2.4
1128+import Ubuntu.Components 1.3
1129 import Ubuntu.Components.Popups 1.0
1130 import Ubuntu.Components.ListItems 1.0 as ListItem
1131
1132
1133=== modified file 'TimeLineBackground.qml'
1134--- TimeLineBackground.qml 2014-11-29 05:15:13 +0000
1135+++ TimeLineBackground.qml 2016-01-25 17:43:39 +0000
1136@@ -16,8 +16,8 @@
1137 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1138 */
1139
1140-import QtQuick 2.3
1141-import Ubuntu.Components 1.1
1142+import QtQuick 2.4
1143+import Ubuntu.Components 1.3
1144
1145 Column {
1146 width: parent.width
1147
1148=== modified file 'TimeLineBase.qml'
1149--- TimeLineBase.qml 2015-08-20 12:27:59 +0000
1150+++ TimeLineBase.qml 2016-01-25 17:43:39 +0000
1151@@ -15,8 +15,8 @@
1152 * You should have received a copy of the GNU General Public License
1153 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1154 */
1155-import QtQuick 2.3
1156-import Ubuntu.Components 1.1
1157+import QtQuick 2.4
1158+import Ubuntu.Components 1.3
1159 import QtOrganizer 5.0
1160
1161 import "dateExt.js" as DateExt
1162
1163=== modified file 'TimeLineBaseComponent.qml'
1164--- TimeLineBaseComponent.qml 2015-10-31 18:47:23 +0000
1165+++ TimeLineBaseComponent.qml 2016-01-25 17:43:39 +0000
1166@@ -16,9 +16,9 @@
1167 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1168 */
1169
1170-import QtQuick 2.3
1171+import QtQuick 2.4
1172 import QtQuick.Layouts 1.1
1173-import Ubuntu.Components 1.1
1174+import Ubuntu.Components 1.3
1175 import Ubuntu.Components.Popups 1.0
1176 import QtOrganizer 5.0
1177
1178@@ -112,28 +112,33 @@
1179 }
1180
1181 Timer{
1182- interval: 200; running: true; repeat: false
1183- onTriggered: {
1184- mainModel = modelComponent.createObject();
1185- activityLoader.running = Qt.binding( function (){ return mainModel.isLoading;});
1186- }
1187- }
1188-
1189- Component {
1190- id: modelComponent
1191- EventListModel {
1192- id: mainModel
1193- startPeriod: startDay.midnight();
1194- endPeriod: type == ViewType.ViewTypeWeek ? startPeriod.addDays(7).endOfDay(): startPeriod.endOfDay()
1195- filter: eventModel.filter
1196+ interval: 200
1197+ running: true
1198+ repeat: false
1199+ onTriggered: {
1200+ mainModel.filter = eventModel.filter
1201 }
1202 }
1203
1204+ InvalidFilter {
1205+ id: invalidFilter
1206+ }
1207+
1208+ EventListModel {
1209+ id: mainModel
1210+
1211+ filter: invalidFilter // delay event filter in case the user is scrolling too fast
1212+ startPeriod: startDay.midnight();
1213+ endPeriod: type == ViewType.ViewTypeWeek ? startPeriod.addDays(7).endOfDay(): startPeriod.endOfDay()
1214+ }
1215+
1216 ActivityIndicator {
1217 id: activityLoader
1218+ objectName : "activityIndicator"
1219+
1220 visible: running
1221- objectName : "activityIndicator"
1222 anchors.centerIn: parent
1223+ running: mainModel.isLoading
1224 z:2
1225 }
1226
1227@@ -184,7 +189,7 @@
1228
1229 property int delegateWidth: {
1230 if( type == ViewType.ViewTypeWeek ) {
1231- width/3 - units.gu(1) /*partial visible area*/
1232+ width/3 - units.gu(1) // partial visible area
1233 } else {
1234 width
1235 }
1236
1237=== modified file 'TimeLineHeader.qml'
1238--- TimeLineHeader.qml 2015-09-05 05:30:23 +0000
1239+++ TimeLineHeader.qml 2016-01-25 17:43:39 +0000
1240@@ -16,8 +16,8 @@
1241 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1242 */
1243
1244-import QtQuick 2.0
1245-import Ubuntu.Components 1.1
1246+import QtQuick 2.4
1247+import Ubuntu.Components 1.3
1248 import QtQuick.Layouts 1.1
1249
1250 import "ViewType.js" as ViewType
1251@@ -50,7 +50,7 @@
1252 id: weekNumLabel
1253 objectName: "weeknumber"
1254
1255- // TRANSLATORS: W refers to Week, followed by the actual week number (%1)
1256+ // TRANSLATORS: W refers to Week, followed by the actual week number (%1)
1257 text: i18n.tr("W%1").arg(startDay.weekNumber(Qt.locale().firstDayOfWeek))
1258 fontSize: "small"
1259 height: units.gu(5)
1260
1261=== modified file 'TimeLineHeaderComponent.qml'
1262--- TimeLineHeaderComponent.qml 2015-09-05 05:30:23 +0000
1263+++ TimeLineHeaderComponent.qml 2016-01-25 17:43:39 +0000
1264@@ -16,8 +16,8 @@
1265 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1266 */
1267
1268-import QtQuick 2.3
1269-import Ubuntu.Components 1.1
1270+import QtQuick 2.4
1271+import Ubuntu.Components 1.3
1272 import "dateExt.js" as DateExt
1273 import "ViewType.js" as ViewType
1274
1275
1276=== modified file 'TimeLineTimeScale.qml'
1277--- TimeLineTimeScale.qml 2014-12-11 20:29:27 +0000
1278+++ TimeLineTimeScale.qml 2016-01-25 17:43:39 +0000
1279@@ -16,8 +16,8 @@
1280 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1281 */
1282
1283-import QtQuick 2.0
1284-import Ubuntu.Components 1.1
1285+import QtQuick 2.4
1286+import Ubuntu.Components 1.3
1287
1288 Flickable{
1289 id: timeFlickble
1290
1291=== modified file 'ViewHeader.qml'
1292--- ViewHeader.qml 2014-11-29 09:40:53 +0000
1293+++ ViewHeader.qml 2016-01-25 17:43:39 +0000
1294@@ -15,8 +15,8 @@
1295 * You should have received a copy of the GNU General Public License
1296 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1297 */
1298-import QtQuick 2.3
1299-import Ubuntu.Components 1.1
1300+import QtQuick 2.4
1301+import Ubuntu.Components 1.3
1302
1303 Item{
1304 id: header
1305
1306=== modified file 'WeekView.qml'
1307--- WeekView.qml 2015-10-28 02:12:50 +0000
1308+++ WeekView.qml 2016-01-25 17:43:39 +0000
1309@@ -16,8 +16,8 @@
1310 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1311 */
1312
1313-import QtQuick 2.3
1314-import Ubuntu.Components 1.1
1315+import QtQuick 2.4
1316+import Ubuntu.Components 1.3
1317 import "dateExt.js" as DateExt
1318 import "ViewType.js" as ViewType
1319
1320@@ -25,8 +25,10 @@
1321 id: weekViewPage
1322 objectName: "weekViewPage"
1323
1324- property var dayStart: new Date();
1325- property var firstDay: dayStart.weekStart(Qt.locale().firstDayOfWeek);
1326+ property var anchorDate: new Date();
1327+ readonly property var currentDate: weekViewPath.currentItem.item.startDay
1328+
1329+ property var firstDayOfWeek: currentDate.weekStart(Qt.locale().firstDayOfWeek);
1330 property bool isCurrentPage: false
1331 property var selectedDay;
1332
1333@@ -61,7 +63,7 @@
1334 id:monthYear
1335 objectName:"monthYearLabel"
1336 fontSize: "x-large"
1337- text: i18n.tr(dayStart.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
1338+ text: i18n.tr(currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
1339 font.capitalization: Font.Capitalize
1340 }
1341 }
1342@@ -75,22 +77,6 @@
1343 //This is used to scroll all view together when currentItem scrolls
1344 property var childContentY;
1345
1346- onNextItemHighlighted: {
1347- nextWeek();
1348- }
1349-
1350- onPreviousItemHighlighted: {
1351- previousWeek();
1352- }
1353-
1354- function nextWeek() {
1355- dayStart = firstDay.addDays(7);
1356- }
1357-
1358- function previousWeek(){
1359- dayStart = firstDay.addDays(-7);
1360- }
1361-
1362 delegate: Loader {
1363 id: timelineLoader
1364 width: parent.width
1365@@ -104,10 +90,10 @@
1366 TimeLineBaseComponent {
1367 id: timeLineView
1368
1369+ anchors.fill: parent
1370 type: ViewType.ViewTypeWeek
1371- anchors.fill: parent
1372+ startDay: anchorDate.addDays((weekViewPath.loopCurrentIndex + weekViewPath.indexType(index)) * 7)
1373 isActive: parent.PathView.isCurrentItem
1374- startDay: firstDay.addDays( weekViewPath.indexType(index) * 7)
1375 keyboardEventProvider: weekViewPath
1376 selectedDay: weekViewPage.selectedDay
1377
1378@@ -128,7 +114,7 @@
1379 onTriggered:{
1380 if( isActive )
1381 timeLineView.scrollTocurrentDate();
1382- }
1383+ }
1384 }
1385
1386 Connections{
1387
1388=== modified file 'YearView.qml'
1389--- YearView.qml 2015-11-23 07:15:20 +0000
1390+++ YearView.qml 2016-01-25 17:43:39 +0000
1391@@ -16,15 +16,16 @@
1392 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1393 */
1394
1395-import QtQuick 2.3
1396-import Ubuntu.Components 1.1
1397+import QtQuick 2.4
1398+import Ubuntu.Components 1.3
1399
1400 import "dateExt.js" as DateExt
1401 Page {
1402 id: yearViewPage
1403 objectName: "yearViewPage"
1404
1405- property int currentYear: DateExt.today().getFullYear();
1406+ property int anchorYear: new Date().getFullYear()
1407+ readonly property int currentYear: yearPathView.currentItem.year
1408 signal monthSelected(var date);
1409
1410 Keys.forwardTo: [yearPathView]
1411@@ -41,10 +42,13 @@
1412 iconName: "calendar-today"
1413 text: i18n.tr("Today")
1414 onTriggered: {
1415- currentYear = new Date().getFullYear()
1416+ yearPathView.scrollToBegginer()
1417+ anchorYear = new Date().getFullYear()
1418 }
1419 }
1420
1421+ title: i18n.tr("Year %1").arg(currentYear)
1422+
1423 head {
1424 actions: [
1425 calendarTodayAction,
1426@@ -54,49 +58,25 @@
1427 commonHeaderActions.syncCalendarAction,
1428 commonHeaderActions.settingsAction
1429 ]
1430- contents: Label {
1431- id:year
1432- objectName:"yearLabel"
1433- fontSize: "x-large"
1434- text: i18n.tr("Year %1").arg(currentYear)
1435- }
1436 }
1437
1438+ flickable: null
1439+
1440 PathViewBase {
1441 id: yearPathView
1442 objectName: "yearPathView"
1443
1444 anchors.fill: parent
1445-
1446- onNextItemHighlighted: {
1447- currentYear = currentYear + 1;
1448- }
1449-
1450- onPreviousItemHighlighted: {
1451- currentYear = currentYear - 1;
1452- }
1453-
1454- delegate: Loader {
1455- width: parent.width
1456- height: parent.height
1457- anchors.top: parent.top
1458-
1459- asynchronous: index !== yearPathView.currentIndex
1460- sourceComponent: delegateComponent
1461-
1462- Component{
1463- id: delegateComponent
1464-
1465- YearViewDelegate{
1466- focus: index == yearPathView.currentIndex
1467-
1468- scrollMonth: 0;
1469- isCurrentItem: index == yearPathView.currentIndex
1470- year: (currentYear + yearPathView.indexType(index))
1471-
1472- anchors.fill: parent
1473- }
1474- }
1475+ snapMode: PathView.NoSnap
1476+
1477+ delegate: YearViewDelegate{
1478+ width: PathView.view.width
1479+ height: PathView.view.height
1480+ focus: index == yearPathView.currentIndex
1481+
1482+ scrollMonth: 0;
1483+ isCurrentItem: (index == yearPathView.currentIndex)
1484+ year: (anchorYear + yearPathView.loopCurrentIndex + yearPathView.indexType(index))
1485 }
1486 }
1487 }
1488
1489=== modified file 'YearViewDelegate.qml'
1490--- YearViewDelegate.qml 2015-11-23 07:15:20 +0000
1491+++ YearViewDelegate.qml 2016-01-25 17:43:39 +0000
1492@@ -1,26 +1,35 @@
1493-import QtQuick 2.0
1494-import Ubuntu.Components 1.1
1495+import QtQuick 2.4
1496+import Ubuntu.Components 1.3
1497
1498 GridView{
1499 id: yearView
1500- clip: true
1501
1502 property int scrollMonth;
1503 property bool isCurrentItem;
1504 property int year;
1505-
1506+ readonly property var currentDate: new Date()
1507+ readonly property int currentYear: currentDate.getFullYear()
1508+ readonly property int currentMonth: currentDate.getMonth()
1509 readonly property int minCellWidth: units.gu(30)
1510+
1511+ function refresh() {
1512+ scrollMonth = 0;
1513+ if(year == currentYear) {
1514+ scrollMonth = currentMonth
1515+ }
1516+ yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
1517+ }
1518+
1519+ // Does not increase cash buffer if user is scolling
1520+ cacheBuffer: PathView.view.flicking || PathView.view.dragging || !isCurrentItem ? 0 : 6 * cellHeight
1521+
1522 cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n)
1523 { return ((width / n >= minCellWidth) ? width / n : width / 2) })))
1524-
1525 cellHeight: cellWidth * 1.4
1526
1527+ clip: true
1528 model: 12 /* months in a year */
1529
1530- onYearChanged: {
1531- refresh();
1532- }
1533-
1534 //scroll in case content height changed
1535 onHeightChanged: {
1536 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
1537@@ -30,68 +39,36 @@
1538 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
1539 }
1540
1541- function refresh() {
1542- scrollMonth = 0;
1543- var today = new Date();
1544- if(year == today.getFullYear()) {
1545- scrollMonth = today.getMonth();
1546- }
1547- yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
1548- }
1549-
1550- Connections{
1551- target: yearPathView
1552- onScrollUp: {
1553- scrollMonth -= 2;
1554- if(scrollMonth < 0) {
1555- scrollMonth = 0;
1556- }
1557- yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
1558- }
1559-
1560- onScrollDown: {
1561- scrollMonth += 2;
1562- var visibleMonths = yearView.height / cellHeight;
1563- if( scrollMonth >= (11 - visibleMonths)) {
1564- scrollMonth = (11 - visibleMonths);
1565- }
1566- yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
1567- }
1568- }
1569-
1570- delegate: Loader {
1571+ delegate: Item {
1572 width: yearView.cellWidth
1573 height: yearView.cellHeight
1574
1575- sourceComponent: delegateComponent
1576- asynchronous: !yearView.focus
1577-
1578- Component {
1579- id: delegateComponent
1580-
1581- Item {
1582- anchors.fill: parent
1583- anchors.margins: units.gu(0.5)
1584-
1585- MonthComponent {
1586- id: monthComponent
1587- objectName: "monthComponent" + index
1588- showEvents: false
1589- currentMonth: new Date(yearView.year, index, 1, 0, 0, 0, 0)
1590- displayWeekNumber: mainView.displayWeekNumber;
1591- isCurrentItem: yearView.focus
1592-
1593- isYearView: true
1594- anchors.fill: parent
1595-
1596- dayLabelFontSize:"x-small"
1597- dateLabelFontSize: "medium"
1598- monthLabelFontSize: "medium"
1599- yearLabelFontSize: "medium"
1600-
1601- onMonthSelected: {
1602- yearViewPage.monthSelected(date);
1603- }
1604+ UbuntuShape {
1605+ radius: "medium"
1606+ anchors {
1607+ fill: parent
1608+ margins: units.gu(0.5)
1609+ }
1610+
1611+ MonthComponent {
1612+ id: monthComponent
1613+ objectName: "monthComponent" + index
1614+
1615+ anchors {
1616+ margins: units.gu(0.5)
1617+ fill: parent
1618+ }
1619+
1620+ currentYear: yearView.year
1621+ currentMonth: index
1622+ isCurrentItem: yearView.focus
1623+ isYearView: true
1624+ dayLabelFontSize:"x-small"
1625+ dateLabelFontSize: "medium"
1626+ monthLabelFontSize: "medium"
1627+ yearLabelFontSize: "medium"
1628+ onMonthSelected: {
1629+ yearViewPage.monthSelected(date);
1630 }
1631 }
1632 }
1633
1634=== modified file 'calendar.qml'
1635--- calendar.qml 2015-11-23 07:15:20 +0000
1636+++ calendar.qml 2016-01-25 17:43:39 +0000
1637@@ -15,8 +15,8 @@
1638 * You should have received a copy of the GNU General Public License
1639 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1640 */
1641-import QtQuick 2.3
1642-import Ubuntu.Components 1.1
1643+import QtQuick 2.4
1644+import Ubuntu.Components 1.3
1645 import Ubuntu.Components.Popups 1.0
1646 import QtOrganizer 5.0
1647 import Qt.labs.settings 1.0
1648@@ -27,8 +27,6 @@
1649
1650 property bool displayWeekNumber: false;
1651
1652- useDeprecatedToolbar: false
1653-
1654 // Work-around until this branch lands:
1655 // https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/212496
1656 //property bool windowActive: typeof window != 'undefined'
1657@@ -216,6 +214,7 @@
1658 id: tabs
1659 Keys.forwardTo: [tabs.currentPage]
1660
1661+ property bool isReady: false
1662 property var currentDay: DateExt.today();
1663 property var selectedDay;
1664
1665@@ -315,6 +314,7 @@
1666 else {
1667 tabs.selectedTabIndex = settings.defaultViewIndex;
1668 }
1669+ tabs.isReady = true
1670 } // End of Component.onCompleted:
1671
1672 EventActions {
1673@@ -349,139 +349,149 @@
1674 }
1675 }
1676
1677- onSelectedTabChanged: {
1678- switch (tabs.selectedTab) {
1679- case yearTab:{
1680- if (yearTab.page === null) {
1681- var yearViewCom = Qt.createComponent("YearView.qml");
1682- if (yearViewCom.status === Component.Ready) {
1683- var yearViewObj = yearViewCom.createObject(mainView);
1684-
1685- yearViewObj.monthSelected.connect(function (date){
1686- var now = DateExt.today();
1687- if( date.getMonth() === now.getMonth()
1688- && date.getFullYear() === now.getFullYear()) {
1689- tabs.currentDay = now;
1690- } else {
1691- tabs.currentDay = date.midnight();
1692- }
1693- tabs.selectedTabIndex = monthTab.index;
1694- })
1695-
1696- yearTab.page = yearViewObj;
1697- }
1698- } else {
1699- yearTab.page.refreshCurrentYear(DateExt.today().getFullYear());
1700- }
1701- } break;
1702- case monthTab: {
1703- if (monthTab.page === null) {
1704- var monthViewCom = Qt.createComponent("MonthView.qml");
1705- if (monthViewCom.status === Component.Ready) {
1706- var monthViewObj = monthViewCom.createObject(mainView);
1707-
1708- monthViewObj.dateSelected.connect(function (date) {
1709- tabs.currentDay = date;
1710- tabs.selectedTabIndex = dayTab.index;
1711- })
1712-
1713- monthTab.page = monthViewObj;
1714- }
1715- } else {
1716- monthTab.page.currentMonth = tabs.currentDay.midnight();
1717- }
1718- } break;
1719- case weekTab: {
1720- if (weekTab.page === null) {
1721- var weekViewCom = Qt.createComponent("WeekView.qml");
1722- if (weekViewCom.status === Component.Ready) {
1723- var weekViewObj = weekViewCom.createObject(mainView);
1724-
1725- weekViewObj.isCurrentPage = Qt.binding(function() { return tabs.selectedTab == weekTab })
1726- weekViewObj.onDayStartChanged.connect(function (){
1727- tabs.currentDay = weekViewObj.dayStart;
1728- });
1729- weekViewObj.dateSelected.connect(function (date){
1730- tabs.currentDay = date;
1731- tabs.selectedTabIndex = dayTab.index;
1732- });
1733-
1734- weekTab.page = weekViewObj;
1735- }
1736- } else {
1737- weekTab.page.dayStart = tabs.currentDay;
1738- }
1739- } break;
1740- case dayTab: {
1741- if (dayTab.page === null) {
1742- var dayViewCom = Qt.createComponent("DayView.qml");
1743- if (dayViewCom.status === Component.Ready) {
1744- var dayViewObj = dayViewCom.createObject(mainView);
1745-
1746- dayViewObj.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == dayTab })
1747- dayViewObj.onCurrentDayChanged.connect(function (){
1748- tabs.currentDay = dayViewObj.currentDay;
1749- });
1750- dayViewObj.dateSelected.connect(function (date) {
1751- tabs.currentDay = date;
1752- });
1753-
1754- dayTab.page =dayViewObj;
1755- }
1756- } else {
1757- dayTab.page.currentDay = tabs.currentDay;
1758- }
1759- } break;
1760- case agendaTab: {
1761- var agendaViewCom = Qt.createComponent("AgendaView.qml");
1762- if (agendaViewCom.status === Component.Ready) {
1763- var agendaViewObj = agendaViewCom.createObject(mainView);
1764-
1765- agendaViewObj.dateSelected.connect(function (date){
1766- tabs.currentDay = date;
1767- tabs.selectedTabIndex = dayTab.index;
1768- })
1769- agendaTab.page = agendaViewObj;
1770- }
1771- } break;
1772- default:
1773- break;
1774- }
1775- }
1776-
1777 Tab{
1778 id: yearTab
1779 objectName: "yearTab"
1780 title: i18n.tr("Year")
1781- page: null
1782+
1783+ page: Loader {
1784+ id: yearViewLoader
1785+
1786+ asynchronous: true
1787+ active: tabs.isReady && (tabs.selectedTab == yearTab)
1788+ sourceComponent: yearViewComp
1789+ }
1790 }
1791
1792 Tab{
1793 id: monthTab
1794 objectName: "monthTab"
1795 title: i18n.tr("Month")
1796- page: null
1797+
1798+ page: Loader {
1799+ id: monthTabLoader
1800+
1801+ asynchronous: true
1802+ active: tabs.isReady && (tabs.selectedTab == monthTab)
1803+ sourceComponent: monthViewComp
1804+ }
1805 }
1806
1807 Tab{
1808 id: weekTab
1809 objectName: "weekTab"
1810 title: i18n.tr("Week")
1811- page: null
1812+
1813+ page: Loader {
1814+ id: weekTabLoader
1815+
1816+ asynchronous: true
1817+ active: tabs.isReady && (tabs.selectedTab == weekTab)
1818+ sourceComponent: weekViewComp
1819+ }
1820 }
1821
1822 Tab{
1823 id: dayTab
1824 objectName: "dayTab"
1825 title: i18n.tr("Day")
1826- page: null
1827+
1828+ page:Loader {
1829+ id: dayTabLoader
1830+
1831+ asynchronous: true
1832+ active: tabs.isReady && (tabs.selectedTab == dayTab)
1833+ sourceComponent: dayViewComp
1834+ }
1835 }
1836
1837 Tab {
1838 id: agendaTab
1839 objectName: "agendaTab"
1840 title: i18n.tr("Agenda")
1841- page: null
1842+
1843+ page: Loader {
1844+ id: agendaTabLoader
1845+
1846+ asynchronous: true
1847+ active: tabs.isReady && (tabs.selectedTab == agendaTab)
1848+ sourceComponent: agendaViewComp
1849+ }
1850+ }
1851+ }
1852+
1853+ Component {
1854+ id: yearViewComp
1855+
1856+ YearView {
1857+ anchorYear: tabs.currentDay.getFullYear()
1858+ onMonthSelected: {
1859+ var now = DateExt.today();
1860+ if ((date.getMonth() === now.getMonth()) &&
1861+ (date.getFullYear() === now.getFullYear())) {
1862+ tabs.currentDay = now;
1863+ } else {
1864+ tabs.currentDay = date.midnight();
1865+ }
1866+ tabs.selectedTabIndex = monthTab.index;
1867+ }
1868+ }
1869+ }
1870+
1871+ Component {
1872+ id: monthViewComp
1873+
1874+ MonthView {
1875+ anchorDate: tabs.currentDay.midnight()
1876+ onDateSelected: {
1877+ tabs.currentDay = date
1878+ tabs.selectedTabIndex = dayTab.index
1879+ }
1880+ }
1881+ }
1882+
1883+ Component {
1884+ id: weekViewComp
1885+
1886+ WeekView {
1887+ onCurrentDateChanged: {
1888+ tabs.currentDay = currentDate
1889+ }
1890+ onDateSelected: {
1891+ tabs.currentDay = date;
1892+ tabs.selectedTabIndex = dayTab.index;
1893+ }
1894+ onActiveChanged: {
1895+ if (active)
1896+ anchorDate = tabs.currentDay.midnight()
1897+ }
1898+ }
1899+ }
1900+
1901+ Component {
1902+ id: dayViewComp
1903+
1904+ DayView {
1905+ onCurrentDateChanged: {
1906+ tabs.currentDay = currentDate;
1907+ }
1908+
1909+ onDateSelected: tabs.currentDay = date;
1910+ onActiveChanged: {
1911+ if (active)
1912+ anchorDate = tabs.currentDay
1913+ }
1914+ }
1915+ }
1916+
1917+ Component {
1918+ id: agendaViewComp
1919+
1920+ AgendaView {
1921+ onDateSelected: {
1922+ tabs.currentDay = date;
1923+ tabs.selectedTabIndex = dayTab.index;
1924+ }
1925 }
1926 }
1927 }
1928
1929=== modified file 'calendarTests.qml'
1930--- calendarTests.qml 2014-09-20 10:45:35 +0000
1931+++ calendarTests.qml 2016-01-25 17:43:39 +0000
1932@@ -15,8 +15,8 @@
1933 * You should have received a copy of the GNU General Public License
1934 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1935 */
1936-import QtQuick 2.3
1937-import Ubuntu.Components 1.1
1938+import QtQuick 2.4
1939+import Ubuntu.Components 1.3
1940
1941 MainView {
1942 width: units.gu(20)
1943
1944=== modified file 'po/com.ubuntu.calendar.pot'
1945--- po/com.ubuntu.calendar.pot 2015-11-23 07:15:20 +0000
1946+++ po/com.ubuntu.calendar.pot 2016-01-25 17:43:39 +0000
1947@@ -8,7 +8,7 @@
1948 msgstr ""
1949 "Project-Id-Version: \n"
1950 "Report-Msgid-Bugs-To: \n"
1951-"POT-Creation-Date: 2015-11-23 15:14+0800\n"
1952+"POT-Creation-Date: 2016-01-12 12:03-0300\n"
1953 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1954 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1955 "Language-Team: LANGUAGE <LL@li.org>\n"
1956@@ -263,7 +263,7 @@
1957 msgid "After Date"
1958 msgstr ""
1959
1960-#: ../MonthComponent.qml:260
1961+#: ../MonthComponent.qml:263
1962 msgid "Wk"
1963 msgstr ""
1964
1965@@ -416,7 +416,7 @@
1966 msgid "All Day"
1967 msgstr ""
1968
1969-#: ../YearView.qml:61
1970+#: ../YearView.qml:48
1971 #, qt-format
1972 msgid "Year %1"
1973 msgstr ""

Subscribers

People subscribed via source and target branches

to status/vote changes: