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
=== modified file 'AgendaView.qml'
--- AgendaView.qml 2015-07-11 02:18:03 +0000
+++ AgendaView.qml 2016-01-25 17:43:39 +0000
@@ -16,9 +16,9 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import QtOrganizer 5.020import QtOrganizer 5.0
21import Ubuntu.Components 1.121import Ubuntu.Components 1.3
22import Ubuntu.Components.ListItems 1.0 as ListItem22import Ubuntu.Components.ListItems 1.0 as ListItem
23import "dateExt.js" as DateExt23import "dateExt.js" as DateExt
2424
2525
=== modified file 'AllDayEventComponent.qml'
--- AllDayEventComponent.qml 2015-08-07 06:20:23 +0000
+++ AllDayEventComponent.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
21import QtOrganizer 5.021import QtOrganizer 5.0
2222
2323
=== modified file 'CalendarChoicePopup.qml'
--- CalendarChoicePopup.qml 2015-05-28 13:56:12 +0000
+++ CalendarChoicePopup.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
21import Ubuntu.Components.ListItems 1.0 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
22import QtOrganizer 5.022import QtOrganizer 5.0
2323
=== modified file 'CalendarListButtonDelegate.qml'
--- CalendarListButtonDelegate.qml 2015-05-28 13:58:30 +0000
+++ CalendarListButtonDelegate.qml 2016-01-25 17:43:39 +0000
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 1.0 as ListItem19import Ubuntu.Components.ListItems 1.0 as ListItem
2020
21ListItem.Standard {21ListItem.Standard {
2222
=== modified file 'ColorPickerDialog.qml'
--- ColorPickerDialog.qml 2015-04-14 19:52:04 +0000
+++ ColorPickerDialog.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
2121
22Dialog {22Dialog {
2323
=== modified file 'ContactChoicePopup.qml'
--- ContactChoicePopup.qml 2015-05-14 03:36:22 +0000
+++ ContactChoicePopup.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
21import Ubuntu.Components.ListItems 1.021import Ubuntu.Components.ListItems 1.0
22import Ubuntu.Components.Themes.Ambiance 1.022import Ubuntu.Components.Themes.Ambiance 1.0
2323
=== modified file 'DayView.qml'
--- DayView.qml 2015-11-23 07:15:20 +0000
+++ DayView.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import "dateExt.js" as DateExt21import "dateExt.js" as DateExt
22import "ViewType.js" as ViewType22import "ViewType.js" as ViewType
2323
@@ -25,8 +25,8 @@
25 id: dayViewPage25 id: dayViewPage
26 objectName: "dayViewPage"26 objectName: "dayViewPage"
2727
28 property var currentDay: new Date()28 property var anchorDate: new Date()
29 property bool isCurrentPage: false29 readonly property var currentDate: dayViewPath.currentItem.startDay
3030
31 signal dateSelected(var date);31 signal dateSelected(var date);
3232
@@ -39,7 +39,8 @@
39 iconName: "calendar-today"39 iconName: "calendar-today"
40 text: i18n.tr("Today")40 text: i18n.tr("Today")
41 onTriggered: {41 onTriggered: {
42 currentDay = new Date()42 dayViewPath.scrollToBegginer()
43 anchorDate = new Date()
43 }44 }
44 }45 }
4546
@@ -57,7 +58,7 @@
57 id:monthYear58 id:monthYear
58 objectName:"monthYearLabel"59 objectName:"monthYearLabel"
59 fontSize: "x-large"60 fontSize: "x-large"
60 text: currentDay.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))61 text: currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
61 font.capitalization: Font.Capitalize62 font.capitalization: Font.Capitalize
62 }63 }
63 }64 }
@@ -66,74 +67,53 @@
66 id: dayViewPath67 id: dayViewPath
67 objectName: "dayViewPath"68 objectName: "dayViewPath"
6869
69 property var startDay: currentDay
70 //This is used to scroll all view together when currentItem scrolls70 //This is used to scroll all view together when currentItem scrolls
71 property var childContentY;71 property var childContentY;
7272
73 anchors.fill: parent73 anchors.fill: parent
7474
75 onNextItemHighlighted: {75 delegate: TimeLineBaseComponent {
76 //next day76 id: timeLineView
77 currentDay = currentDay.addDays(1);77 objectName: "DayComponent-"+index
78 }78
79
80 onPreviousItemHighlighted: {
81 //previous day
82 currentDay = currentDay.addDays(-1);
83 }
84
85 delegate: Loader {
86 width: parent.width79 width: parent.width
87 height: parent.height80 height: parent.height
88 asynchronous: !dayViewPath.isCurrentItem81
89 sourceComponent: delegateComponent82 type: ViewType.ViewTypeDay
9083 isActive: PathView.isCurrentItem
91 Component {84 contentInteractive: PathView.isCurrentItem
92 id: delegateComponent85 startDay: anchorDate.addDays(dayViewPath.loopCurrentIndex + dayViewPath.indexType(index))
9386 keyboardEventProvider: dayViewPath
94 TimeLineBaseComponent {87
95 id: timeLineView88 Component.onCompleted: {
96 objectName: "DayComponent-"+index89 if(dayViewPage.active){
9790 timeLineView.scrollToCurrentTime();
98 type: ViewType.ViewTypeDay91 }
99 anchors.fill: parent92 }
10093
101 isActive: parent.PathView.isCurrentItem94 Connections{
102 contentInteractive: parent.PathView.isCurrentItem95 target: dayViewPage
103 startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))96 onActiveChanged: {
104 keyboardEventProvider: dayViewPath97 if(dayViewPage.active){
10598 timeLineView.scrollToCurrentTime();
106 Component.onCompleted: {99 }
107 if(dayViewPage.isCurrentPage){100 }
108 timeLineView.scrollToCurrentTime();101 }
109 }102
110 }103 //get contentY value from PathView, if its not current Item
111104 Binding{
112 Connections{105 target: timeLineView
113 target: dayViewPage106 property: "contentY"
114 onIsCurrentPageChanged:{107 value: dayViewPath.childContentY;
115 if(dayViewPage.isCurrentPage){108 when: !parent.PathView.isCurrentItem
116 timeLineView.scrollToCurrentTime();109 }
117 }110
118 }111 //set PathView's contentY property, if its current item
119 }112 Binding{
120113 target: dayViewPath
121 //get contentY value from PathView, if its not current Item114 property: "childContentY"
122 Binding{115 value: contentY
123 target: timeLineView116 when: parent.PathView.isCurrentItem
124 property: "contentY"
125 value: dayViewPath.childContentY;
126 when: !parent.PathView.isCurrentItem
127 }
128
129 //set PathView's contentY property, if its current item
130 Binding{
131 target: dayViewPath
132 property: "childContentY"
133 value: contentY
134 when: parent.PathView.isCurrentItem
135 }
136 }
137 }117 }
138 }118 }
139 }119 }
140120
=== modified file 'Defines.js'
--- Defines.js 2014-10-22 14:03:01 +0000
+++ Defines.js 2016-01-25 17:43:39 +0000
@@ -43,8 +43,8 @@
4343
44function getWeekLabels(){44function getWeekLabels(){
45 var object = Qt.createQmlObject('\45 var object = Qt.createQmlObject('\
46 import QtQuick 2.3;\46 import QtQuick 2.4;\
47 import Ubuntu.Components 1.1;\47 import Ubuntu.Components 1.3;\
48 QtObject {\48 QtObject {\
49 property var weekLabel:[Qt.locale().dayName(7,Locale.NarrowFormat),\49 property var weekLabel:[Qt.locale().dayName(7,Locale.NarrowFormat),\
50 Qt.locale().dayName(1,Locale.NarrowFormat),\50 Qt.locale().dayName(1,Locale.NarrowFormat),\
5151
=== modified file 'DeleteConfirmationDialog.qml'
--- DeleteConfirmationDialog.qml 2014-10-14 17:20:13 +0000
+++ DeleteConfirmationDialog.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
2121
22Dialog {22Dialog {
2323
=== modified file 'EditEventConfirmationDialog.qml'
--- EditEventConfirmationDialog.qml 2014-10-14 17:20:13 +0000
+++ EditEventConfirmationDialog.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
2121
22Dialog {22Dialog {
2323
=== modified file 'EventActions.qml'
--- EventActions.qml 2015-07-11 02:18:03 +0000
+++ EventActions.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import Ubuntu.SyncMonitor 0.121import Ubuntu.SyncMonitor 0.1
2222
23Item {23Item {
2424
=== modified file 'EventBubble.qml'
--- EventBubble.qml 2015-11-29 03:17:30 +0000
+++ EventBubble.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import QtOrganizer 5.021import QtOrganizer 5.0
2222
23Item{23Item{
2424
=== modified file 'EventDetails.qml'
--- EventDetails.qml 2015-08-03 04:47:59 +0000
+++ EventDetails.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.ListItems 1.0 as ListItem20import Ubuntu.Components.ListItems 1.0 as ListItem
21import Ubuntu.Components.Themes.Ambiance 1.021import Ubuntu.Components.Themes.Ambiance 1.0
22import Ubuntu.Components.Popups 1.022import Ubuntu.Components.Popups 1.0
@@ -209,7 +209,7 @@
209 dialog.editEvent.connect( function(eventId){209 dialog.editEvent.connect( function(eventId){
210 if( eventId === event.parentId ) {210 if( eventId === event.parentId ) {
211 showEditEventPage(internal.parentEvent, model)211 showEditEventPage(internal.parentEvent, model)
212 } else { 212 } else {
213 showEditEventPage(event, model)213 showEditEventPage(event, model)
214 }214 }
215 });215 });
216216
=== modified file 'EventReminder.qml'
--- EventReminder.qml 2015-07-12 03:39:07 +0000
+++ EventReminder.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import Ubuntu.Components.ListItems 1.0 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
2222
23Page{23Page{
2424
=== modified file 'EventRepetition.qml'
--- EventRepetition.qml 2015-07-11 11:33:00 +0000
+++ EventRepetition.qml 2016-01-25 17:43:39 +0000
@@ -16,9 +16,9 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import QtOrganizer 5.020import QtOrganizer 5.0
21import Ubuntu.Components 1.121import Ubuntu.Components 1.3
22import Ubuntu.Components.ListItems 1.0 as ListItem22import Ubuntu.Components.ListItems 1.0 as ListItem
23import Ubuntu.Components.Pickers 1.023import Ubuntu.Components.Pickers 1.0
24import QtOrganizer 5.024import QtOrganizer 5.0
2525
=== modified file 'EventUtils.qml'
--- EventUtils.qml 2014-10-04 04:37:34 +0000
+++ EventUtils.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import QtOrganizer 5.021import QtOrganizer 5.0
22import "Defines.js" as Defines22import "Defines.js" as Defines
23import "Recurrence.js" as Recurrence23import "Recurrence.js" as Recurrence
2424
=== modified file 'HeaderDateComponent.qml'
--- HeaderDateComponent.qml 2015-05-14 13:03:02 +0000
+++ HeaderDateComponent.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
2121
22Item {22Item {
23 id: root23 id: root
2424
=== modified file 'MonthComponent.qml'
--- MonthComponent.qml 2015-11-23 07:15:20 +0000
+++ MonthComponent.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,10 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import QtQuick.Layouts 1.1
21
20import "dateExt.js" as DateExt22import "dateExt.js" as DateExt
21import "colorUtils.js" as Color23import "colorUtils.js" as Color
2224
@@ -25,12 +27,11 @@
25 objectName: "MonthComponent"27 objectName: "MonthComponent"
2628
27 property bool isCurrentItem;29 property bool isCurrentItem;
2830 property int currentYear;
29 property bool showEvents: false31 property int currentMonth;
3032
31 property var currentMonth;
32 property var isYearView;33 property var isYearView;
33 property var selectedDay;34 property var highlightedDate;
34 property bool displayWeekNumber:false;35 property bool displayWeekNumber:false;
3536
36 property string dayLabelFontSize: "medium"37 property string dayLabelFontSize: "medium"
@@ -40,91 +41,59 @@
4041
41 property alias dayLabelDelegate : dayLabelRepeater.delegate42 property alias dayLabelDelegate : dayLabelRepeater.delegate
42 property alias dateLabelDelegate : dateLabelRepeater.delegate43 property alias dateLabelDelegate : dateLabelRepeater.delegate
44 readonly property alias monthStartDate: intern.monthStart
4345
44 signal monthSelected(var date);46 signal monthSelected(var date);
45 signal dateSelected(var date);47 signal dateSelected(var date);
46 signal dateHighlighted(var date);48 signal dateHighlighted(var date);
4749
48 //creatng timer only if we need to show events in month50 function updateEvents(events) {
49 Loader {51 intern.eventStatus = events
50 id: timerLoader
51 sourceComponent: showEvents ? timerComp : undefined
52 }
53
54 // Timer to delay creation of Model, There seems some problem fetching events if we create Model immediatly
55 Component {
56 id: timerComp
57 Timer{
58 interval: 200; running: true; repeat: false
59 onTriggered: {
60 modelLoader.sourceComponent = modelComponent
61 }
62 }
63 }
64
65 Loader{
66 id: modelLoader
67 }
68
69 Component{
70 id: modelComponent
71 EventListModel {
72 id: mainModel
73 startPeriod: intern.monthStart.midnight();
74 endPeriod: intern.monthStart.addDays((/*monthGrid.rows * cols */ 42 )-1).endOfDay()
75 filter: eventModel.filter
76 onModelChanged: {
77 intern.eventStatus = Qt.binding(function() { return mainModel.containsItems(startPeriod, endPeriod, 86400/*24*60*60*/)});
78 }
79 }
80 }52 }
8153
82 QtObject{54 QtObject{
83 id: intern55 id: intern
8456
85 property var eventStatus;57 property var eventStatus: new Array(42)
86
87 property int curMonthDate: currentMonth.getDate()
88 property int curMonth: currentMonth.getMonth()
89 property int curMonthYear: currentMonth.getFullYear()
9058
91 property var today: DateExt.today()59 property var today: DateExt.today()
92 property int todayDate: today.getDate()60 property int todayDate: today.getDate()
93 property int todayMonth: today.getMonth()61 property int todayMonth: today.getMonth()
94 property int todayYear: today.getFullYear()62 property int todayYear: today.getFullYear()
9563
96
97 //date from month will start, this date might be from previous month64 //date from month will start, this date might be from previous month
98 property var monthStart: currentMonth.weekStart( Qt.locale().firstDayOfWeek )65 property var currentDate: new Date(root.currentYear, root.currentMonth, 1, 0, 0, 0, 0)
66 property var monthStart: currentDate.weekStart( Qt.locale().firstDayOfWeek )
99 property int monthStartDate: monthStart.getDate()67 property int monthStartDate: monthStart.getDate()
100 property int monthStartMonth: monthStart.getMonth()68 property int monthStartMonth: monthStart.getMonth()
101 property int monthStartYear: monthStart.getFullYear()69 property int monthStartYear: monthStart.getFullYear()
102
103 property int daysInStartMonth: Date.daysInMonth(monthStartYear, monthStartMonth)70 property int daysInStartMonth: Date.daysInMonth(monthStartYear, monthStartMonth)
104 property int daysInCurMonth: Date.daysInMonth(curMonthYear,curMonth)
10571
106 //check if current month is start month72 //check if current month is start month
107 property bool isCurMonthStartMonth: curMonthDate === monthStartDate73 property bool isCurMonthStartMonth: root.currentMonth === monthStartMonth &&
108 && curMonth === monthStartMonth74 root.currentYear === monthStartYear
109 && curMonthYear === monthStartYear
11075
111 //check current month is same as today's month76 //check current month is same as today's month
112 property bool isCurMonthTodayMonth: todayYear === curMonthYear && todayMonth == curMonth77 property bool isCurMonthTodayMonth: todayYear === root.currentYear &&
78 todayMonth == root.currentMonth
113 //offset from current month's first date to start date of current month79 //offset from current month's first date to start date of current month
114 property int offset: isCurMonthStartMonth ? -1 : (daysInStartMonth - monthStartDate)80 property int offset: isCurMonthStartMonth ? -1 : (daysInStartMonth - monthStartDate)
11581
116 property int dateFontSize: FontUtils.sizeToPixels(root.dateLabelFontSize)82 property int dateFontSize: FontUtils.sizeToPixels(root.dateLabelFontSize)
117 property int dayFontSize: FontUtils.sizeToPixels(root.dayLabelFontSize)83 property int dayFontSize: FontUtils.sizeToPixels(root.dayLabelFontSize)
11884
119 property int selectedIndex: -185 property int highlightedIndex: root.isCurrentItem &&
12086 root.highlightedDate ?
121 function findSelectedDayIndex(){87 intern.indexByDate(root.highlightedDate) : -1
122 if(!selectedDay) {88 function indexByDate(date){
89 if (!date) {
123 return -1;90 return -1;
124 }91 }
12592
126 if( todayMonth === selectedDay.getMonth() && selectedDay.getFullYear() === todayYear){93 if ((root.currentMonth === date.getMonth()) &&
127 return selectedDay.getDate() +94 (root.currentYear === date.getFullYear())) {
95
96 return date.getDate() +
128 (Date.daysInMonth(monthStartYear, monthStartMonth) - monthStartDate);97 (Date.daysInMonth(monthStartYear, monthStartMonth) - monthStartDate);
129 } else {98 } else {
130 return -1;99 return -1;
@@ -132,14 +101,40 @@
132 }101 }
133 }102 }
134103
135 onSelectedDayChanged: {104 UbuntuShape{
136 if( isCurrentItem ) {105 id: todayShape
137 intern.selectedIndex = intern.findSelectedDayIndex();106
107 visible: root.isCurrentItem && intern.isCurMonthTodayMonth && monthGrid.todayItem != null
108 color: (monthGrid.highlightedItem === monthGrid.todayItem) ? UbuntuColors.darkGrey : UbuntuColors.orange
109 width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
110 height: width
111 parent: monthGrid.todayItem
112 anchors.centerIn: parent
113 z: -1
114 Rectangle {
115 anchors.fill: parent
116 anchors.margins: units.gu(0.5)
117 color: UbuntuColors.orange
118 radius: 5
138 }119 }
139 }120 }
140121
141 onCurrentMonthChanged: {122 UbuntuShape{
142 intern.selectedIndex = -1;123 id: highlightedShape
124
125 visible: monthGrid.highlightedItem && (monthGrid.highlightedItem != monthGrid.todayItem)
126 color: UbuntuColors.darkGrey
127 width: parent ? Math.min(parent.height, parent.width) / 1.3 : 0
128 height: width
129 parent: monthGrid.highlightedItem
130 anchors.centerIn: parent
131 z: -1
132 Rectangle {
133 anchors.fill: parent
134 anchors.margins: units.gu(0.5)
135 color: UbuntuColors.lightGrey
136 radius: 5
137 }
143 }138 }
144139
145 Column{140 Column{
@@ -165,8 +160,8 @@
165 ViewHeader{160 ViewHeader{
166 id: monthHeader161 id: monthHeader
167 anchors.fill: parent162 anchors.fill: parent
168 month: intern.curMonth163 month: root.currentMonth
169 year: intern.curMonthYear164 year: root.currentYear
170165
171 monthLabelFontSize: root.monthLabelFontSize166 monthLabelFontSize: root.monthLabelFontSize
172 yearLabelFontSize: root.yearLabelFontSize167 yearLabelFontSize: root.yearLabelFontSize
@@ -184,9 +179,11 @@
184179
185 property int dayWidth: width / 7;180 property int dayWidth: width / 7;
186181
187 width: parent.width182 anchors{
188 anchors.horizontalCenter: parent.horizontalCenter183 left: parent.left
189 anchors.verticalCenter: parent.verticalCenter184 right: parent.right
185 verticalCenter: parent.verticalCenter
186 }
190187
191 Repeater{188 Repeater{
192 id: dayLabelRepeater189 id: dayLabelRepeater
@@ -196,23 +193,43 @@
196 }193 }
197 }194 }
198195
199 Grid{196 Grid {
200 id: monthGrid197 id: monthGrid
201 objectName: "monthGrid"198 objectName: "monthGrid"
202199
203 width: parent.width
204 height: parent.height - monthGrid.y
205
206 property int dayWidth: width / 7 /*cols*/;200 property int dayWidth: width / 7 /*cols*/;
207 property int dayHeight: height / 6/*rows*/;201 property int dayHeight: height / 6/*rows*/;
208202 property var todayItem: null
209 rows: 6203 readonly property var highlightedItem: intern.highlightedIndex != -1 ?
204 dateLabelRepeater.itemAt(intern.highlightedIndex) : null
205 anchors {
206 left: parent.left
207 right: parent.right
208 }
209 height: parent.height - monthGrid.y
210 columns: 7210 columns: 7
211211
212 Repeater{212 Repeater{
213 id: dateLabelRepeater213 id: dateLabelRepeater
214 model: 42 //monthGrid.rows * monthGrid.columns214 model: 42
215 delegate: defaultDateLabelComponent215 delegate: MonthComponentDateDelegate {
216 property var delegateDate: intern.monthStart.addDays(index)
217
218 date: delegateDate.getDate()
219 isCurrentMonth: delegateDate.getMonth() === root.currentMonth
220 showEvent: intern.eventStatus[index] === true
221
222 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
223 isSelected: intern.highlightedIndex == index
224 width: monthGrid.dayWidth
225 height: monthGrid.dayHeight
226
227 onIsTodayChanged: {
228 if (isToday) {
229 monthGrid.todayItem = this
230 }
231 }
232 }
216 }233 }
217 }234 }
218 }235 }
@@ -299,52 +316,9 @@
299 }316 }
300317
301 Component{318 Component{
302 id: defaultDateLabelComponent
303 MonthComponentDateDelegate{
304 date: {
305 //try to find date from index and month's first week's first date
306 var temp = intern.daysInStartMonth - intern.offset + index
307 //date exceeds days in startMonth,
308 //this means previous month is over and we are now in current month
309 //to get actual date we need to remove number of days in startMonth
310 if( temp > intern.daysInStartMonth ) {
311 temp = temp - intern.daysInStartMonth
312 //date exceeds days in current month
313 // this means date is from next month
314 //to get actual date we need to remove number of days in current month
315 if( temp > intern.daysInCurMonth ) {
316 temp = temp - intern.daysInCurMonth
317 }
318 }
319 return temp;
320 }
321
322 isCurrentMonth: {
323 //remove offset from index
324 //if index falls in 1 to no of days in current month
325 //then date is inside current month
326 var temp = index - intern.offset
327 return (temp >= 1 && temp <= intern.daysInCurMonth)
328 }
329
330 isToday: intern.todayDate == date && intern.isCurMonthTodayMonth
331
332 isSelected: showEvents && intern.selectedIndex == index
333
334 width: parent.dayWidth
335 height: parent.dayHeight
336 fontSize: intern.dateFontSize
337 showEvent: showEvents
338 && intern.eventStatus !== undefined
339 && intern.eventStatus[index] !== undefined
340 && intern.eventStatus[index]
341 }
342 }
343
344 Component{
345 id: dafaultDayLabelComponent319 id: dafaultDayLabelComponent
346320
347 Label{321 Text {
348 id: weekDay322 id: weekDay
349 objectName: "weekDay" + index323 objectName: "weekDay" + index
350 width: parent.dayWidth324 width: parent.dayWidth
351325
=== modified file 'MonthComponentDateDelegate.qml'
--- MonthComponentDateDelegate.qml 2015-09-05 05:30:23 +0000
+++ MonthComponentDateDelegate.qml 2016-01-25 17:43:39 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.01import QtQuick 2.4
2import Ubuntu.Components 1.12import Ubuntu.Components 1.3
33
4Item{4Item{
5 id: dateRootItem5 id: dateRootItem
@@ -9,27 +9,12 @@
9 property bool isToday;9 property bool isToday;
10 property bool showEvent;10 property bool showEvent;
11 property alias fontSize: dateLabel.font.pixelSize11 property alias fontSize: dateLabel.font.pixelSize
12
13 property bool isSelected: false12 property bool isSelected: false
1413
15 Loader {14 Text {
16 sourceComponent: (isToday && isCurrentMonth) || isSelected ? highLightComp : undefined
17
18 onSourceComponentChanged: {
19 width = Qt.binding( function() {
20 var width = dateRootItem.height > dateRootItem.width ? dateRootItem.width :dateRootItem.height
21 return ( width / 1.3 );
22 });
23 height = Qt.binding ( function() { return width} );
24 anchors.centerIn = Qt.binding( function() { return dateLabel});
25 }
26 }
27
28 Label {
29 id: dateLabel15 id: dateLabel
30 anchors.centerIn: parent16 anchors.centerIn: parent
31 text: date17 text: date
32 fontSize: root.dateLabelFontSize
33 color: {18 color: {
34 if( isCurrentMonth ) {19 if( isCurrentMonth ) {
35 if( isToday || isSelected ) {20 if( isToday || isSelected ) {
@@ -47,46 +32,19 @@
47 }32 }
48 }33 }
4934
50 Loader{35 Rectangle {
51 sourceComponent: showEvent ? eventIndicatorComp : undefined36 id: eventIndicator
52 onSourceComponentChanged: {37
53 width = Qt.binding( function() { return units.gu(0.8)})38 width: units.gu(0.8)
54 height = Qt.binding( function() { return width })39 height: width
55 anchors.horizontalCenter = Qt.binding( function() { return parent.horizontalCenter })40 anchors {
56 anchors.top = Qt.binding( function() { return parent.verticalCenter })41 horizontalCenter: parent.horizontalCenter
57 anchors.topMargin = Qt.binding( function() {42 top: parent.verticalCenter
58 var w = (dateRootItem.height > dateRootItem.width ? dateRootItem.width :dateRootItem.height)/1.343 topMargin: ((Math.min(parent.height, dateRootItem.width) / 1.3) / 2) + units.gu(0.1)
59 return (w/2) + units.gu(0.1)44 }
60 });45 radius: height/2
61 }46 color:"black"
62 }47 visible: showEvent
63
64 Component{
65 id: eventIndicatorComp
66 Rectangle {
67 anchors.fill: parent
68 radius: height/2
69 color: "black"
70 }
71 }
72
73 Component{
74 id: highLightComp
75 UbuntuShape{
76 color: {
77 if( isToday && !isSelected ) {
78 "#DD4814"
79 } else {
80 "gray"
81 }
82 }
83
84 Rectangle{
85 anchors.fill: parent
86 anchors.margins: units.gu(0.5)
87 color: isToday ? "#DD4814" : "darkgray"
88 }
89 }
90 }48 }
9149
92 MouseArea {50 MouseArea {
@@ -113,7 +71,6 @@
113 //If monthView is clicked then open selected DayView71 //If monthView is clicked then open selected DayView
114 root.dateSelected(selectedDate);72 root.dateSelected(selectedDate);
115 } else {73 } else {
116 intern.selectedIndex = index
117 root.dateHighlighted(selectedDate)74 root.dateHighlighted(selectedDate)
118 }75 }
119 }76 }
12077
=== modified file 'MonthView.qml'
--- MonthView.qml 2015-11-23 07:15:20 +0000
+++ MonthView.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import "dateExt.js" as DateExt20import "dateExt.js" as DateExt
21import "colorUtils.js" as Color21import "colorUtils.js" as Color
2222
@@ -24,8 +24,10 @@
24 id: monthViewPage24 id: monthViewPage
25 objectName: "monthViewPage"25 objectName: "monthViewPage"
2626
27 property var currentMonth: DateExt.today();27 property var anchorDate: DateExt.today();
28 readonly property var currentDate: monthViewPath.currentItem.indexDate
28 property var selectedDay;29 property var selectedDay;
30 property var highlightedDate;
2931
30 signal dateSelected(var date);32 signal dateSelected(var date);
31 signal dateHighlighted(var date);33 signal dateHighlighted(var date);
@@ -38,7 +40,8 @@
38 iconName: "calendar-today"40 iconName: "calendar-today"
39 text: i18n.tr("Today")41 text: i18n.tr("Today")
40 onTriggered: {42 onTriggered: {
41 currentMonth = new Date().midnight()43 monthViewPath.scrollToBegginer()
44 anchorDate = new Date().midnight()
42 }45 }
43 }46 }
4447
@@ -58,7 +61,7 @@
58 // TRANSLATORS: this is a time formatting string,61 // TRANSLATORS: this is a time formatting string,
59 // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.62 // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
60 // It's used in the header of the month and week views63 // It's used in the header of the month and week views
61 text: currentMonth.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))64 text: currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
62 font.capitalization: Font.Capitalize65 font.capitalization: Font.Capitalize
63 }66 }
64 }67 }
@@ -67,66 +70,28 @@
67 id: monthViewPath70 id: monthViewPath
68 objectName: "monthViewPath"71 objectName: "monthViewPath"
6972
70 property var startMonth: currentMonth;73 anchors.fill: parent
7174
72 anchors.top:parent.top75 delegate: MonthWithEventsComponent {
7376 property var indexDate: monthViewPath.loopCurrentIndex === 0 ?
74 width:parent.width77 anchorDate : anchorDate.addMonths(monthViewPath.loopCurrentIndex + monthViewPath.indexType(index))
75 height: parent.height78
7679 currentMonth: indexDate.getMonth()
77 onNextItemHighlighted: {80 currentYear: indexDate.getFullYear()
78 nextMonth();81
79 }
80
81 onPreviousItemHighlighted: {
82 previousMonth();
83 }
84
85 function nextMonth() {
86 currentMonth = addMonth(currentMonth, 1);
87 }
88
89 function previousMonth() {
90 currentMonth = addMonth(currentMonth, -1);
91 }
92
93 function addMonth(date,month) {
94 return new Date(date.getFullYear(), date.getMonth() + month, 1, 0, 0, 0);
95 }
96
97 delegate: Loader {
98 width: parent.width - units.gu(4)82 width: parent.width - units.gu(4)
99 height: parent.height83 height: parent.height
10084 isCurrentItem: (index === monthViewPath.currentIndex)
101 sourceComponent: delegateComponent85 displayWeekNumber: mainView.displayWeekNumber
102 asynchronous: index !== monthViewPath.currentIndex86 highlightedDate: monthViewPage.highlightedDate
10387 isYearView: false
104 Component {88
105 id: delegateComponent89 onDateSelected: {
10690 monthViewPage.dateSelected(date);
107 MonthComponent {91 }
108 isCurrentItem: index === monthViewPath.currentIndex92 onDateHighlighted: {
10993 monthViewPage.highlightedDate = date
110 showEvents: true94 monthViewPage.dateHighlighted(date);
111
112 displayWeekNumber: mainView.displayWeekNumber;
113
114 anchors.fill: parent
115
116 currentMonth: monthViewPath.addMonth(monthViewPath.startMonth,
117 monthViewPath.indexType(index));
118
119 selectedDay: monthViewPage.selectedDay
120 isYearView: false
121
122 onDateSelected: {
123 monthViewPage.dateSelected(date);
124 }
125
126 onDateHighlighted: {
127 monthViewPage.dateHighlighted(date);
128 }
129 }
130 }95 }
131 }96 }
132 }97 }
13398
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2015-08-24 05:08:46 +0000
+++ NewEvent.qml 2016-01-25 17:43:39 +0000
@@ -16,9 +16,9 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import QtOrganizer 5.020import QtOrganizer 5.0
21import Ubuntu.Components 1.121import Ubuntu.Components 1.3
22import Ubuntu.Components.Popups 1.022import Ubuntu.Components.Popups 1.0
23import Ubuntu.Components.ListItems 1.0 as ListItem23import Ubuntu.Components.ListItems 1.0 as ListItem
24import Ubuntu.Components.Themes.Ambiance 1.024import Ubuntu.Components.Themes.Ambiance 1.0
2525
=== modified file 'NewEventEntryField.qml'
--- NewEventEntryField.qml 2015-02-17 05:53:42 +0000
+++ NewEventEntryField.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
2121
22Label {22Label {
23 id: root23 id: root
2424
=== modified file 'NewEventTimePicker.qml'
--- NewEventTimePicker.qml 2014-10-21 18:58:31 +0000
+++ NewEventTimePicker.qml 2016-01-25 17:43:39 +0000
@@ -1,4 +1,4 @@
1import QtQuick 2.31import QtQuick 2.4
2import Ubuntu.Components.ListItems 1.0 as ListItem2import Ubuntu.Components.ListItems 1.0 as ListItem
3import Ubuntu.Components.Themes.Ambiance 1.03import Ubuntu.Components.Themes.Ambiance 1.0
4import Ubuntu.Components.Pickers 1.04import Ubuntu.Components.Pickers 1.0
55
=== modified file 'OnlineAccountsHelper.qml'
--- OnlineAccountsHelper.qml 2015-03-28 11:31:47 +0000
+++ OnlineAccountsHelper.qml 2016-01-25 17:43:39 +0000
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.4
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
19import Ubuntu.OnlineAccounts 0.119import Ubuntu.OnlineAccounts 0.1
20import Ubuntu.OnlineAccounts.Client 0.120import Ubuntu.OnlineAccounts.Client 0.1
2121
2222
=== modified file 'PathViewBase.qml'
--- PathViewBase.qml 2015-08-29 08:59:47 +0000
+++ PathViewBase.qml 2016-01-25 17:43:39 +0000
@@ -20,8 +20,7 @@
20PathView {20PathView {
21 id: root21 id: root
2222
23 model: 323 readonly property alias loopCurrentIndex: intern.loopCurrentIndex
24 snapMode: PathView.SnapOneItem
2524
26 signal nextItemHighlighted();25 signal nextItemHighlighted();
27 signal previousItemHighlighted();26 signal previousItemHighlighted();
@@ -29,6 +28,8 @@
29 signal scrollUp();28 signal scrollUp();
30 signal scrollDown();29 signal scrollDown();
3130
31 model: 3
32 snapMode: PathView.SnapOneItem
32 preferredHighlightBegin: 0.533 preferredHighlightBegin: 0.5
33 preferredHighlightEnd: 0.534 preferredHighlightEnd: 0.5
3435
@@ -68,6 +69,11 @@
68 }69 }
69 }70 }
7071
72 function scrollToBegginer()
73 {
74 intern.loopCurrentIndex = intern.previousIndex = currentIndex = 0
75 }
76
71 Keys.onLeftPressed:{77 Keys.onLeftPressed:{
72 root.decrementCurrentIndex();78 root.decrementCurrentIndex();
73 }79 }
@@ -98,15 +104,17 @@
98 intern.previousIndex = currentIndex104 intern.previousIndex = currentIndex
99105
100 if ( diff > 0 ) {106 if ( diff > 0 ) {
101 root.nextItemHighlighted();107 intern.loopCurrentIndex++
102 }108 }
103 else {109 else {
104 root.previousItemHighlighted();110 intern.loopCurrentIndex--
105 }111 }
106 }112 }
107113
108 QtObject{114 QtObject{
109 id: intern115 id: intern
116
117 property int loopCurrentIndex: 0
110 property int previousIndex: root.currentIndex118 property int previousIndex: root.currentIndex
111 }119 }
112}120}
113121
=== modified file 'RecurrenceLabelDefines.qml'
--- RecurrenceLabelDefines.qml 2014-10-17 05:42:34 +0000
+++ RecurrenceLabelDefines.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
2121
22QtObject {22QtObject {
23 property var recurrenceLabel:[i18n.tr("Once"),23 property var recurrenceLabel:[i18n.tr("Once"),
2424
=== modified file 'Scroller.qml'
--- Scroller.qml 2014-09-20 10:45:35 +0000
+++ Scroller.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import Ubuntu.Components.ListItems 1.0 as ListItems21import Ubuntu.Components.ListItems 1.0 as ListItems
2222
23Item {23Item {
2424
=== modified file 'Settings.qml'
--- Settings.qml 2015-11-23 07:15:20 +0000
+++ Settings.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
21import Ubuntu.Components.ListItems 1.0 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
2222
2323
=== modified file 'TimeLineBackground.qml'
--- TimeLineBackground.qml 2014-11-29 05:15:13 +0000
+++ TimeLineBackground.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
2121
22Column {22Column {
23 width: parent.width23 width: parent.width
2424
=== modified file 'TimeLineBase.qml'
--- TimeLineBase.qml 2015-08-20 12:27:59 +0000
+++ TimeLineBase.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import QtOrganizer 5.020import QtOrganizer 5.0
2121
22import "dateExt.js" as DateExt22import "dateExt.js" as DateExt
2323
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2015-10-31 18:47:23 +0000
+++ TimeLineBaseComponent.qml 2016-01-25 17:43:39 +0000
@@ -16,9 +16,9 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import QtQuick.Layouts 1.120import QtQuick.Layouts 1.1
21import Ubuntu.Components 1.121import Ubuntu.Components 1.3
22import Ubuntu.Components.Popups 1.022import Ubuntu.Components.Popups 1.0
23import QtOrganizer 5.023import QtOrganizer 5.0
2424
@@ -112,28 +112,33 @@
112 }112 }
113113
114 Timer{114 Timer{
115 interval: 200; running: true; repeat: false115 interval: 200
116 onTriggered: {116 running: true
117 mainModel = modelComponent.createObject();117 repeat: false
118 activityLoader.running = Qt.binding( function (){ return mainModel.isLoading;});118 onTriggered: {
119 }119 mainModel.filter = eventModel.filter
120 }
121
122 Component {
123 id: modelComponent
124 EventListModel {
125 id: mainModel
126 startPeriod: startDay.midnight();
127 endPeriod: type == ViewType.ViewTypeWeek ? startPeriod.addDays(7).endOfDay(): startPeriod.endOfDay()
128 filter: eventModel.filter
129 }120 }
130 }121 }
131122
123 InvalidFilter {
124 id: invalidFilter
125 }
126
127 EventListModel {
128 id: mainModel
129
130 filter: invalidFilter // delay event filter in case the user is scrolling too fast
131 startPeriod: startDay.midnight();
132 endPeriod: type == ViewType.ViewTypeWeek ? startPeriod.addDays(7).endOfDay(): startPeriod.endOfDay()
133 }
134
132 ActivityIndicator {135 ActivityIndicator {
133 id: activityLoader136 id: activityLoader
137 objectName : "activityIndicator"
138
134 visible: running139 visible: running
135 objectName : "activityIndicator"
136 anchors.centerIn: parent140 anchors.centerIn: parent
141 running: mainModel.isLoading
137 z:2142 z:2
138 }143 }
139144
@@ -184,7 +189,7 @@
184189
185 property int delegateWidth: {190 property int delegateWidth: {
186 if( type == ViewType.ViewTypeWeek ) {191 if( type == ViewType.ViewTypeWeek ) {
187 width/3 - units.gu(1) /*partial visible area*/192 width/3 - units.gu(1) // partial visible area
188 } else {193 } else {
189 width194 width
190 }195 }
191196
=== modified file 'TimeLineHeader.qml'
--- TimeLineHeader.qml 2015-09-05 05:30:23 +0000
+++ TimeLineHeader.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import QtQuick.Layouts 1.121import QtQuick.Layouts 1.1
2222
23import "ViewType.js" as ViewType23import "ViewType.js" as ViewType
@@ -50,7 +50,7 @@
50 id: weekNumLabel50 id: weekNumLabel
51 objectName: "weeknumber"51 objectName: "weeknumber"
5252
53 // TRANSLATORS: W refers to Week, followed by the actual week number (%1)53 // TRANSLATORS: W refers to Week, followed by the actual week number (%1)
54 text: i18n.tr("W%1").arg(startDay.weekNumber(Qt.locale().firstDayOfWeek))54 text: i18n.tr("W%1").arg(startDay.weekNumber(Qt.locale().firstDayOfWeek))
55 fontSize: "small"55 fontSize: "small"
56 height: units.gu(5)56 height: units.gu(5)
5757
=== modified file 'TimeLineHeaderComponent.qml'
--- TimeLineHeaderComponent.qml 2015-09-05 05:30:23 +0000
+++ TimeLineHeaderComponent.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import "dateExt.js" as DateExt21import "dateExt.js" as DateExt
22import "ViewType.js" as ViewType22import "ViewType.js" as ViewType
2323
2424
=== modified file 'TimeLineTimeScale.qml'
--- TimeLineTimeScale.qml 2014-12-11 20:29:27 +0000
+++ TimeLineTimeScale.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
2121
22Flickable{22Flickable{
23 id: timeFlickble23 id: timeFlickble
2424
=== modified file 'ViewHeader.qml'
--- ViewHeader.qml 2014-11-29 09:40:53 +0000
+++ ViewHeader.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
2020
21Item{21Item{
22 id: header22 id: header
2323
=== modified file 'WeekView.qml'
--- WeekView.qml 2015-10-28 02:12:50 +0000
+++ WeekView.qml 2016-01-25 17:43:39 +0000
@@ -16,8 +16,8 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
21import "dateExt.js" as DateExt21import "dateExt.js" as DateExt
22import "ViewType.js" as ViewType22import "ViewType.js" as ViewType
2323
@@ -25,8 +25,10 @@
25 id: weekViewPage25 id: weekViewPage
26 objectName: "weekViewPage"26 objectName: "weekViewPage"
2727
28 property var dayStart: new Date();28 property var anchorDate: new Date();
29 property var firstDay: dayStart.weekStart(Qt.locale().firstDayOfWeek);29 readonly property var currentDate: weekViewPath.currentItem.item.startDay
30
31 property var firstDayOfWeek: currentDate.weekStart(Qt.locale().firstDayOfWeek);
30 property bool isCurrentPage: false32 property bool isCurrentPage: false
31 property var selectedDay;33 property var selectedDay;
3234
@@ -61,7 +63,7 @@
61 id:monthYear63 id:monthYear
62 objectName:"monthYearLabel"64 objectName:"monthYearLabel"
63 fontSize: "x-large"65 fontSize: "x-large"
64 text: i18n.tr(dayStart.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))66 text: i18n.tr(currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
65 font.capitalization: Font.Capitalize67 font.capitalization: Font.Capitalize
66 }68 }
67 }69 }
@@ -75,22 +77,6 @@
75 //This is used to scroll all view together when currentItem scrolls77 //This is used to scroll all view together when currentItem scrolls
76 property var childContentY;78 property var childContentY;
7779
78 onNextItemHighlighted: {
79 nextWeek();
80 }
81
82 onPreviousItemHighlighted: {
83 previousWeek();
84 }
85
86 function nextWeek() {
87 dayStart = firstDay.addDays(7);
88 }
89
90 function previousWeek(){
91 dayStart = firstDay.addDays(-7);
92 }
93
94 delegate: Loader {80 delegate: Loader {
95 id: timelineLoader81 id: timelineLoader
96 width: parent.width82 width: parent.width
@@ -104,10 +90,10 @@
104 TimeLineBaseComponent {90 TimeLineBaseComponent {
105 id: timeLineView91 id: timeLineView
10692
93 anchors.fill: parent
107 type: ViewType.ViewTypeWeek94 type: ViewType.ViewTypeWeek
108 anchors.fill: parent95 startDay: anchorDate.addDays((weekViewPath.loopCurrentIndex + weekViewPath.indexType(index)) * 7)
109 isActive: parent.PathView.isCurrentItem96 isActive: parent.PathView.isCurrentItem
110 startDay: firstDay.addDays( weekViewPath.indexType(index) * 7)
111 keyboardEventProvider: weekViewPath97 keyboardEventProvider: weekViewPath
112 selectedDay: weekViewPage.selectedDay98 selectedDay: weekViewPage.selectedDay
11399
@@ -128,7 +114,7 @@
128 onTriggered:{114 onTriggered:{
129 if( isActive )115 if( isActive )
130 timeLineView.scrollTocurrentDate();116 timeLineView.scrollTocurrentDate();
131 }117 }
132 }118 }
133119
134 Connections{120 Connections{
135121
=== modified file 'YearView.qml'
--- YearView.qml 2015-11-23 07:15:20 +0000
+++ YearView.qml 2016-01-25 17:43:39 +0000
@@ -16,15 +16,16 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
1818
19import QtQuick 2.319import QtQuick 2.4
20import Ubuntu.Components 1.120import Ubuntu.Components 1.3
2121
22import "dateExt.js" as DateExt22import "dateExt.js" as DateExt
23Page {23Page {
24 id: yearViewPage24 id: yearViewPage
25 objectName: "yearViewPage"25 objectName: "yearViewPage"
2626
27 property int currentYear: DateExt.today().getFullYear();27 property int anchorYear: new Date().getFullYear()
28 readonly property int currentYear: yearPathView.currentItem.year
28 signal monthSelected(var date);29 signal monthSelected(var date);
2930
30 Keys.forwardTo: [yearPathView]31 Keys.forwardTo: [yearPathView]
@@ -41,10 +42,13 @@
41 iconName: "calendar-today"42 iconName: "calendar-today"
42 text: i18n.tr("Today")43 text: i18n.tr("Today")
43 onTriggered: {44 onTriggered: {
44 currentYear = new Date().getFullYear()45 yearPathView.scrollToBegginer()
46 anchorYear = new Date().getFullYear()
45 }47 }
46 }48 }
4749
50 title: i18n.tr("Year %1").arg(currentYear)
51
48 head {52 head {
49 actions: [53 actions: [
50 calendarTodayAction,54 calendarTodayAction,
@@ -54,49 +58,25 @@
54 commonHeaderActions.syncCalendarAction,58 commonHeaderActions.syncCalendarAction,
55 commonHeaderActions.settingsAction59 commonHeaderActions.settingsAction
56 ]60 ]
57 contents: Label {
58 id:year
59 objectName:"yearLabel"
60 fontSize: "x-large"
61 text: i18n.tr("Year %1").arg(currentYear)
62 }
63 }61 }
6462
63 flickable: null
64
65 PathViewBase {65 PathViewBase {
66 id: yearPathView66 id: yearPathView
67 objectName: "yearPathView"67 objectName: "yearPathView"
6868
69 anchors.fill: parent69 anchors.fill: parent
7070 snapMode: PathView.NoSnap
71 onNextItemHighlighted: {71
72 currentYear = currentYear + 1;72 delegate: YearViewDelegate{
73 }73 width: PathView.view.width
7474 height: PathView.view.height
75 onPreviousItemHighlighted: {75 focus: index == yearPathView.currentIndex
76 currentYear = currentYear - 1;76
77 }77 scrollMonth: 0;
7878 isCurrentItem: (index == yearPathView.currentIndex)
79 delegate: Loader {79 year: (anchorYear + yearPathView.loopCurrentIndex + yearPathView.indexType(index))
80 width: parent.width
81 height: parent.height
82 anchors.top: parent.top
83
84 asynchronous: index !== yearPathView.currentIndex
85 sourceComponent: delegateComponent
86
87 Component{
88 id: delegateComponent
89
90 YearViewDelegate{
91 focus: index == yearPathView.currentIndex
92
93 scrollMonth: 0;
94 isCurrentItem: index == yearPathView.currentIndex
95 year: (currentYear + yearPathView.indexType(index))
96
97 anchors.fill: parent
98 }
99 }
100 }80 }
101 }81 }
102}82}
10383
=== modified file 'YearViewDelegate.qml'
--- YearViewDelegate.qml 2015-11-23 07:15:20 +0000
+++ YearViewDelegate.qml 2016-01-25 17:43:39 +0000
@@ -1,26 +1,35 @@
1import QtQuick 2.01import QtQuick 2.4
2import Ubuntu.Components 1.12import Ubuntu.Components 1.3
33
4GridView{4GridView{
5 id: yearView5 id: yearView
6 clip: true
76
8 property int scrollMonth;7 property int scrollMonth;
9 property bool isCurrentItem;8 property bool isCurrentItem;
10 property int year;9 property int year;
1110 readonly property var currentDate: new Date()
11 readonly property int currentYear: currentDate.getFullYear()
12 readonly property int currentMonth: currentDate.getMonth()
12 readonly property int minCellWidth: units.gu(30)13 readonly property int minCellWidth: units.gu(30)
14
15 function refresh() {
16 scrollMonth = 0;
17 if(year == currentYear) {
18 scrollMonth = currentMonth
19 }
20 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
21 }
22
23 // Does not increase cash buffer if user is scolling
24 cacheBuffer: PathView.view.flicking || PathView.view.dragging || !isCurrentItem ? 0 : 6 * cellHeight
25
13 cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n)26 cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n)
14 { return ((width / n >= minCellWidth) ? width / n : width / 2) })))27 { return ((width / n >= minCellWidth) ? width / n : width / 2) })))
15
16 cellHeight: cellWidth * 1.428 cellHeight: cellWidth * 1.4
1729
30 clip: true
18 model: 12 /* months in a year */31 model: 12 /* months in a year */
1932
20 onYearChanged: {
21 refresh();
22 }
23
24 //scroll in case content height changed33 //scroll in case content height changed
25 onHeightChanged: {34 onHeightChanged: {
26 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);35 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
@@ -30,68 +39,36 @@
30 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);39 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
31 }40 }
3241
33 function refresh() {42 delegate: Item {
34 scrollMonth = 0;
35 var today = new Date();
36 if(year == today.getFullYear()) {
37 scrollMonth = today.getMonth();
38 }
39 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
40 }
41
42 Connections{
43 target: yearPathView
44 onScrollUp: {
45 scrollMonth -= 2;
46 if(scrollMonth < 0) {
47 scrollMonth = 0;
48 }
49 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
50 }
51
52 onScrollDown: {
53 scrollMonth += 2;
54 var visibleMonths = yearView.height / cellHeight;
55 if( scrollMonth >= (11 - visibleMonths)) {
56 scrollMonth = (11 - visibleMonths);
57 }
58 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
59 }
60 }
61
62 delegate: Loader {
63 width: yearView.cellWidth43 width: yearView.cellWidth
64 height: yearView.cellHeight44 height: yearView.cellHeight
6545
66 sourceComponent: delegateComponent46 UbuntuShape {
67 asynchronous: !yearView.focus47 radius: "medium"
6848 anchors {
69 Component {49 fill: parent
70 id: delegateComponent50 margins: units.gu(0.5)
7151 }
72 Item {52
73 anchors.fill: parent53 MonthComponent {
74 anchors.margins: units.gu(0.5)54 id: monthComponent
7555 objectName: "monthComponent" + index
76 MonthComponent {56
77 id: monthComponent57 anchors {
78 objectName: "monthComponent" + index58 margins: units.gu(0.5)
79 showEvents: false59 fill: parent
80 currentMonth: new Date(yearView.year, index, 1, 0, 0, 0, 0)60 }
81 displayWeekNumber: mainView.displayWeekNumber;61
82 isCurrentItem: yearView.focus62 currentYear: yearView.year
8363 currentMonth: index
84 isYearView: true64 isCurrentItem: yearView.focus
85 anchors.fill: parent65 isYearView: true
8666 dayLabelFontSize:"x-small"
87 dayLabelFontSize:"x-small"67 dateLabelFontSize: "medium"
88 dateLabelFontSize: "medium"68 monthLabelFontSize: "medium"
89 monthLabelFontSize: "medium"69 yearLabelFontSize: "medium"
90 yearLabelFontSize: "medium"70 onMonthSelected: {
9171 yearViewPage.monthSelected(date);
92 onMonthSelected: {
93 yearViewPage.monthSelected(date);
94 }
95 }72 }
96 }73 }
97 }74 }
9875
=== modified file 'calendar.qml'
--- calendar.qml 2015-11-23 07:15:20 +0000
+++ calendar.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.0
21import QtOrganizer 5.021import QtOrganizer 5.0
22import Qt.labs.settings 1.022import Qt.labs.settings 1.0
@@ -27,8 +27,6 @@
2727
28 property bool displayWeekNumber: false;28 property bool displayWeekNumber: false;
2929
30 useDeprecatedToolbar: false
31
32 // Work-around until this branch lands:30 // Work-around until this branch lands:
33 // https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/21249631 // https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/212496
34 //property bool windowActive: typeof window != 'undefined'32 //property bool windowActive: typeof window != 'undefined'
@@ -216,6 +214,7 @@
216 id: tabs214 id: tabs
217 Keys.forwardTo: [tabs.currentPage]215 Keys.forwardTo: [tabs.currentPage]
218216
217 property bool isReady: false
219 property var currentDay: DateExt.today();218 property var currentDay: DateExt.today();
220 property var selectedDay;219 property var selectedDay;
221220
@@ -315,6 +314,7 @@
315 else {314 else {
316 tabs.selectedTabIndex = settings.defaultViewIndex;315 tabs.selectedTabIndex = settings.defaultViewIndex;
317 }316 }
317 tabs.isReady = true
318 } // End of Component.onCompleted:318 } // End of Component.onCompleted:
319319
320 EventActions {320 EventActions {
@@ -349,139 +349,149 @@
349 }349 }
350 }350 }
351351
352 onSelectedTabChanged: {
353 switch (tabs.selectedTab) {
354 case yearTab:{
355 if (yearTab.page === null) {
356 var yearViewCom = Qt.createComponent("YearView.qml");
357 if (yearViewCom.status === Component.Ready) {
358 var yearViewObj = yearViewCom.createObject(mainView);
359
360 yearViewObj.monthSelected.connect(function (date){
361 var now = DateExt.today();
362 if( date.getMonth() === now.getMonth()
363 && date.getFullYear() === now.getFullYear()) {
364 tabs.currentDay = now;
365 } else {
366 tabs.currentDay = date.midnight();
367 }
368 tabs.selectedTabIndex = monthTab.index;
369 })
370
371 yearTab.page = yearViewObj;
372 }
373 } else {
374 yearTab.page.refreshCurrentYear(DateExt.today().getFullYear());
375 }
376 } break;
377 case monthTab: {
378 if (monthTab.page === null) {
379 var monthViewCom = Qt.createComponent("MonthView.qml");
380 if (monthViewCom.status === Component.Ready) {
381 var monthViewObj = monthViewCom.createObject(mainView);
382
383 monthViewObj.dateSelected.connect(function (date) {
384 tabs.currentDay = date;
385 tabs.selectedTabIndex = dayTab.index;
386 })
387
388 monthTab.page = monthViewObj;
389 }
390 } else {
391 monthTab.page.currentMonth = tabs.currentDay.midnight();
392 }
393 } break;
394 case weekTab: {
395 if (weekTab.page === null) {
396 var weekViewCom = Qt.createComponent("WeekView.qml");
397 if (weekViewCom.status === Component.Ready) {
398 var weekViewObj = weekViewCom.createObject(mainView);
399
400 weekViewObj.isCurrentPage = Qt.binding(function() { return tabs.selectedTab == weekTab })
401 weekViewObj.onDayStartChanged.connect(function (){
402 tabs.currentDay = weekViewObj.dayStart;
403 });
404 weekViewObj.dateSelected.connect(function (date){
405 tabs.currentDay = date;
406 tabs.selectedTabIndex = dayTab.index;
407 });
408
409 weekTab.page = weekViewObj;
410 }
411 } else {
412 weekTab.page.dayStart = tabs.currentDay;
413 }
414 } break;
415 case dayTab: {
416 if (dayTab.page === null) {
417 var dayViewCom = Qt.createComponent("DayView.qml");
418 if (dayViewCom.status === Component.Ready) {
419 var dayViewObj = dayViewCom.createObject(mainView);
420
421 dayViewObj.isCurrentPage= Qt.binding(function() { return tabs.selectedTab == dayTab })
422 dayViewObj.onCurrentDayChanged.connect(function (){
423 tabs.currentDay = dayViewObj.currentDay;
424 });
425 dayViewObj.dateSelected.connect(function (date) {
426 tabs.currentDay = date;
427 });
428
429 dayTab.page =dayViewObj;
430 }
431 } else {
432 dayTab.page.currentDay = tabs.currentDay;
433 }
434 } break;
435 case agendaTab: {
436 var agendaViewCom = Qt.createComponent("AgendaView.qml");
437 if (agendaViewCom.status === Component.Ready) {
438 var agendaViewObj = agendaViewCom.createObject(mainView);
439
440 agendaViewObj.dateSelected.connect(function (date){
441 tabs.currentDay = date;
442 tabs.selectedTabIndex = dayTab.index;
443 })
444 agendaTab.page = agendaViewObj;
445 }
446 } break;
447 default:
448 break;
449 }
450 }
451
452 Tab{352 Tab{
453 id: yearTab353 id: yearTab
454 objectName: "yearTab"354 objectName: "yearTab"
455 title: i18n.tr("Year")355 title: i18n.tr("Year")
456 page: null356
357 page: Loader {
358 id: yearViewLoader
359
360 asynchronous: true
361 active: tabs.isReady && (tabs.selectedTab == yearTab)
362 sourceComponent: yearViewComp
363 }
457 }364 }
458365
459 Tab{366 Tab{
460 id: monthTab367 id: monthTab
461 objectName: "monthTab"368 objectName: "monthTab"
462 title: i18n.tr("Month")369 title: i18n.tr("Month")
463 page: null370
371 page: Loader {
372 id: monthTabLoader
373
374 asynchronous: true
375 active: tabs.isReady && (tabs.selectedTab == monthTab)
376 sourceComponent: monthViewComp
377 }
464 }378 }
465379
466 Tab{380 Tab{
467 id: weekTab381 id: weekTab
468 objectName: "weekTab"382 objectName: "weekTab"
469 title: i18n.tr("Week")383 title: i18n.tr("Week")
470 page: null384
385 page: Loader {
386 id: weekTabLoader
387
388 asynchronous: true
389 active: tabs.isReady && (tabs.selectedTab == weekTab)
390 sourceComponent: weekViewComp
391 }
471 }392 }
472393
473 Tab{394 Tab{
474 id: dayTab395 id: dayTab
475 objectName: "dayTab"396 objectName: "dayTab"
476 title: i18n.tr("Day")397 title: i18n.tr("Day")
477 page: null398
399 page:Loader {
400 id: dayTabLoader
401
402 asynchronous: true
403 active: tabs.isReady && (tabs.selectedTab == dayTab)
404 sourceComponent: dayViewComp
405 }
478 }406 }
479407
480 Tab {408 Tab {
481 id: agendaTab409 id: agendaTab
482 objectName: "agendaTab"410 objectName: "agendaTab"
483 title: i18n.tr("Agenda")411 title: i18n.tr("Agenda")
484 page: null412
413 page: Loader {
414 id: agendaTabLoader
415
416 asynchronous: true
417 active: tabs.isReady && (tabs.selectedTab == agendaTab)
418 sourceComponent: agendaViewComp
419 }
420 }
421 }
422
423 Component {
424 id: yearViewComp
425
426 YearView {
427 anchorYear: tabs.currentDay.getFullYear()
428 onMonthSelected: {
429 var now = DateExt.today();
430 if ((date.getMonth() === now.getMonth()) &&
431 (date.getFullYear() === now.getFullYear())) {
432 tabs.currentDay = now;
433 } else {
434 tabs.currentDay = date.midnight();
435 }
436 tabs.selectedTabIndex = monthTab.index;
437 }
438 }
439 }
440
441 Component {
442 id: monthViewComp
443
444 MonthView {
445 anchorDate: tabs.currentDay.midnight()
446 onDateSelected: {
447 tabs.currentDay = date
448 tabs.selectedTabIndex = dayTab.index
449 }
450 }
451 }
452
453 Component {
454 id: weekViewComp
455
456 WeekView {
457 onCurrentDateChanged: {
458 tabs.currentDay = currentDate
459 }
460 onDateSelected: {
461 tabs.currentDay = date;
462 tabs.selectedTabIndex = dayTab.index;
463 }
464 onActiveChanged: {
465 if (active)
466 anchorDate = tabs.currentDay.midnight()
467 }
468 }
469 }
470
471 Component {
472 id: dayViewComp
473
474 DayView {
475 onCurrentDateChanged: {
476 tabs.currentDay = currentDate;
477 }
478
479 onDateSelected: tabs.currentDay = date;
480 onActiveChanged: {
481 if (active)
482 anchorDate = tabs.currentDay
483 }
484 }
485 }
486
487 Component {
488 id: agendaViewComp
489
490 AgendaView {
491 onDateSelected: {
492 tabs.currentDay = date;
493 tabs.selectedTabIndex = dayTab.index;
494 }
485 }495 }
486 }496 }
487 }497 }
488498
=== modified file 'calendarTests.qml'
--- calendarTests.qml 2014-09-20 10:45:35 +0000
+++ calendarTests.qml 2016-01-25 17:43:39 +0000
@@ -15,8 +15,8 @@
15 * You should have received a copy of the GNU General Public License15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */17 */
18import QtQuick 2.318import QtQuick 2.4
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
2020
21MainView {21MainView {
22 width: units.gu(20)22 width: units.gu(20)
2323
=== modified file 'po/com.ubuntu.calendar.pot'
--- po/com.ubuntu.calendar.pot 2015-11-23 07:15:20 +0000
+++ po/com.ubuntu.calendar.pot 2016-01-25 17:43:39 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2015-11-23 15:14+0800\n"11"POT-Creation-Date: 2016-01-12 12:03-0300\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -263,7 +263,7 @@
263msgid "After Date"263msgid "After Date"
264msgstr ""264msgstr ""
265265
266#: ../MonthComponent.qml:260266#: ../MonthComponent.qml:263
267msgid "Wk"267msgid "Wk"
268msgstr ""268msgstr ""
269269
@@ -416,7 +416,7 @@
416msgid "All Day"416msgid "All Day"
417msgstr ""417msgstr ""
418418
419#: ../YearView.qml:61419#: ../YearView.qml:48
420#, qt-format420#, qt-format
421msgid "Year %1"421msgid "Year %1"
422msgstr ""422msgstr ""

Subscribers

People subscribed via source and target branches

to status/vote changes: