Merge lp:~pkunal-parmar/ubuntu-calendar-app/Refactoring into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 258
Merged at revision: 254
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/Refactoring
Merge into: lp:ubuntu-calendar-app
Diff against target: 177 lines (+31/-36)
7 files modified
DayView.qml (+1/-12)
EventListModel.qml (+7/-0)
MonthComponent.qml (+13/-7)
MonthView.qml (+3/-12)
TimeLineBaseComponent.qml (+7/-3)
YearView.qml (+0/-1)
calendar.qml (+0/-1)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/Refactoring
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+217326@code.launchpad.net

Commit message

Loading Event indicator using Loader in monthView and other minor changes

Description of the change

Loading Event indicator using Loader in monthView and other minor changes

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
Mihir Soni (mihirsoni) wrote :

LGTM.
Thanks kunal

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'DayView.qml'
--- DayView.qml 2014-04-11 00:21:42 +0000
+++ DayView.qml 2014-04-26 05:02:19 +0000
@@ -108,18 +108,7 @@
108108
109 contentInteractive: timeLineView.PathView.isCurrentItem109 contentInteractive: timeLineView.PathView.isCurrentItem
110110
111 startDay: getStartDay()111 startDay: dayViewPath.startDay.addDays(dayViewPath.indexType(index))
112
113 function getStartDay() {
114 switch( dayViewPath.indexType(index)) {
115 case 0:
116 return dayViewPath.startDay;
117 case -1:
118 return dayViewPath.startDay.addDays(-1);
119 case 1:
120 return dayViewPath.startDay.addDays(1);
121 }
122 }
123 }112 }
124 }113 }
125 }114 }
126115
=== modified file 'EventListModel.qml'
--- EventListModel.qml 2014-04-05 04:49:47 +0000
+++ EventListModel.qml 2014-04-26 05:02:19 +0000
@@ -11,6 +11,13 @@
11 listeners.push(listener);11 listeners.push(listener);
12 }12 }
1313
14 function removeModelChangeListener(listener) {
15 var i = listeners.indexOf(listener);
16 if(i != -1) {
17 listeners.splice(i, 1);
18 }
19 }
20
14 function getItems(startDate, endDate){21 function getItems(startDate, endDate){
15 return itemsByTimePeriod(startDate,endDate);22 return itemsByTimePeriod(startDate,endDate);
16 }23 }
1724
=== modified file 'MonthComponent.qml'
--- MonthComponent.qml 2014-04-19 21:46:54 +0000
+++ MonthComponent.qml 2014-04-26 05:02:19 +0000
@@ -57,7 +57,6 @@
57 property int todayMonth: today.getMonth()57 property int todayMonth: today.getMonth()
58 property int todayYear: today.getFullYear()58 property int todayYear: today.getFullYear()
5959
60
61 //date from month will start, this date might be from previous month60 //date from month will start, this date might be from previous month
62 property var monthStart: currentMonth.weekStart( Qt.locale().firstDayOfWeek )61 property var monthStart: currentMonth.weekStart( Qt.locale().firstDayOfWeek )
63 property int monthStartDate: monthStart.getDate()62 property int monthStartDate: monthStart.getDate()
@@ -210,15 +209,12 @@
210 }209 }
211 }210 }
212211
213 Rectangle {212 Loader{
214 width: units.gu(1)213 property bool shouldLoad: showEvents
215 height: width
216 radius: height/2
217 color:"#5E2750"
218 visible: showEvents
219 && intern.eventStatus !== undefined214 && intern.eventStatus !== undefined
220 && intern.eventStatus[index] !== undefined215 && intern.eventStatus[index] !== undefined
221 &&intern.eventStatus[index]216 &&intern.eventStatus[index]
217 sourceComponent: shouldLoad ? eventIndicatorComp : undefined
222 anchors.top: dateLabel.bottom218 anchors.top: dateLabel.bottom
223 anchors.horizontalCenter: dateLabel.horizontalCenter219 anchors.horizontalCenter: dateLabel.horizontalCenter
224 }220 }
@@ -251,6 +247,16 @@
251 }247 }
252248
253 Component{249 Component{
250 id: eventIndicatorComp
251 Rectangle {
252 width: units.gu(1)
253 height: width
254 radius: height/2
255 color:"#5E2750"
256 }
257 }
258
259 Component{
254 id: dafaultDayLabelComponent260 id: dafaultDayLabelComponent
255261
256 Label{262 Label{
257263
=== modified file 'MonthView.qml'
--- MonthView.qml 2014-04-19 21:46:54 +0000
+++ MonthView.qml 2014-04-26 05:02:19 +0000
@@ -51,20 +51,11 @@
51 width: parent.width - units.gu(5)51 width: parent.width - units.gu(5)
52 height: parent.height - units.gu(5)52 height: parent.height - units.gu(5)
5353
54 currentMonth: getMonthDate();54 currentMonth: monthViewPath.addMonth(monthViewPath.startMonth,
55 monthViewPath.indexType(index));
56
55 isYearView: false57 isYearView: false
5658
57 function getMonthDate() {
58 switch( monthViewPath.indexType(index)) {
59 case 0:
60 return monthViewPath.addMonth(monthViewPath.startMonth, 0);
61 case -1:
62 return monthViewPath.addMonth(monthViewPath.startMonth, -1);
63 case 1:
64 return monthViewPath.addMonth(monthViewPath.startMonth, 1);
65 }
66 }
67
68 onDateSelected: {59 onDateSelected: {
69 monthViewPage.dateSelected(date);60 monthViewPage.dateSelected(date);
70 }61 }
7162
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2014-04-19 21:21:52 +0000
+++ TimeLineBaseComponent.qml 2014-04-26 05:02:19 +0000
@@ -19,9 +19,7 @@
19 property int scrollHour;19 property int scrollHour;
2020
21 function scrollToCurrentTime() {21 function scrollToCurrentTime() {
22 //scroll to current time
23 var currentTime = new Date();22 var currentTime = new Date();
24 //TODO: if current time is early morning should we show time from 9 am ?
25 scrollHour = currentTime.getHours();23 scrollHour = currentTime.getHours();
2624
27 timeLineView.contentY = scrollHour * units.gu(10);25 timeLineView.contentY = scrollHour * units.gu(10);
@@ -76,7 +74,10 @@
76 startDay: root.startDay74 startDay: root.startDay
77 model: mainModel75 model: mainModel
78 Component.onCompleted: {76 Component.onCompleted: {
79 model.addModelChangeListener(createAllDayEvents);77 mainModel.addModelChangeListener(createAllDayEvents);
78 }
79 Component.onDestruction: {
80 mainModel.removeModelChangeListener(createAllDayEvents);
80 }81 }
81 }82 }
8283
@@ -122,6 +123,9 @@
122 Component.onCompleted: {123 Component.onCompleted: {
123 model.addModelChangeListener(createEvents);124 model.addModelChangeListener(createEvents);
124 }125 }
126 Component.onDestruction: {
127 model.removeModelChangeListener(createEvents);
128 }
125 }129 }
126 }130 }
127 }131 }
128132
=== modified file 'YearView.qml'
--- YearView.qml 2014-04-19 21:46:54 +0000
+++ YearView.qml 2014-04-26 05:02:19 +0000
@@ -56,7 +56,6 @@
56 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);56 yearView.positionViewAtIndex(scrollMonth, GridView.Beginning);
57 }57 }
5858
59
60 Connections{59 Connections{
61 target: pathView60 target: pathView
62 onScrollUp: {61 onScrollUp: {
6362
=== modified file 'calendar.qml'
--- calendar.qml 2014-04-19 21:22:21 +0000
+++ calendar.qml 2014-04-26 05:02:19 +0000
@@ -290,7 +290,6 @@
290 onLoaded: {290 onLoaded: {
291 item.tools = Qt.binding(function() { return commonToolBar })291 item.tools = Qt.binding(function() { return commonToolBar })
292 item.currentMonth = tabs.currentDay.midnight();292 item.currentMonth = tabs.currentDay.midnight();
293 print("onLoaded:"+ tabs.currentDay);
294 }293 }
295294
296 anchors{295 anchors{

Subscribers

People subscribed via source and target branches

to status/vote changes: