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

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 519
Merged at revision: 527
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/DeclinedEvents
Merge into: lp:ubuntu-calendar-app
Diff against target: 121 lines (+21/-75)
2 files modified
EventBubble.qml (+21/-3)
MonthComponentDateDelegate.qml.moved (+0/-72)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/DeclinedEvents
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+239559@code.launchpad.net

Commit message

Bug #1371871
Calendar events where I'm marked as not going should be detected and displayed differently in the views

Description of the change

Bug #1371871
Calendar events where I'm marked as not going should be detected and displayed differently in the views

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 :

Looks good to me !
Thank you

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventBubble.qml'
2--- EventBubble.qml 2014-10-21 15:16:26 +0000
3+++ EventBubble.qml 2014-10-24 13:23:34 +0000
4@@ -69,11 +69,29 @@
5 var collection = model.collection( event.collectionId );
6 var now = new Date();
7 if( event.endDateTime >= now) {
8- bg.color = collection.color
9+ if( getOwnersStatus(collection) === EventAttendee.StatusDeclined ) {
10+ //if owner of account is not attending event the dim it
11+ bg.color = Qt.tint( collection.color, "#aaffffff" );
12+ } else {
13+ bg.color = collection.color
14+ }
15 } else {
16 //if event is on past then add some white color to original color
17 bg.color = Qt.tint( collection.color, "#aaffffff" );
18- return;
19+ }
20+ }
21+ }
22+
23+ function getOwnersStatus(collection) {
24+ var attendees = event.attendees;
25+ if( attendees !== undefined ) {
26+ for (var j = 0 ; j < attendees.length ; ++j) {
27+ var contact = attendees[j];
28+ //mail to is appended on email address so remove it
29+ var email = contact.emailAddress.replace("mailto:", "");
30+ if( email === collection.name) {
31+ return contact.participationStatus;
32+ }
33 }
34 }
35 }
36@@ -205,7 +223,7 @@
37
38 layoutBubbleDetails();
39 } else if (event.displayLabel){
40- eventDetails.item.timeLableText = event.displayLabel;
41+ timeLabel.text = event.displayLabel;
42 }
43 }
44 }
45
46=== removed file 'MonthComponentDateDelegate.qml.moved'
47--- MonthComponentDateDelegate.qml.moved 2014-10-22 21:27:04 +0000
48+++ MonthComponentDateDelegate.qml.moved 1970-01-01 00:00:00 +0000
49@@ -1,72 +0,0 @@
50-import QtQuick 2.0
51-import Ubuntu.Components 1.1
52-
53-Item{
54- id: dateRootItem
55-
56- property int date;
57- property bool isCurrentMonth;
58- property bool isToday
59-
60- Loader {
61- width: parent.width < parent.height ? parent.width : parent.height
62- height: width
63- anchors.centerIn: parent
64- sourceComponent: isToday && isCurrentMonth ? highLightComp : undefined
65- }
66-
67- Label {
68- id: dateLabel
69- anchors.centerIn: parent
70- width: parent.width
71- text: date
72- horizontalAlignment: Text.AlignHCenter
73- fontSize: root.dateLabelFontSize
74- color: {
75- if( isCurrentMonth ) {
76- if(isToday) {
77- "white"
78- } else {
79- "#5D5D5D"
80- }
81- } else {
82- "#AEA79F"
83- }
84- }
85- }
86-
87- Loader{
88- property bool shouldLoad: showEvents
89- && intern.eventStatus !== undefined
90- && intern.eventStatus[index] !== undefined
91- &&intern.eventStatus[index]
92- sourceComponent: shouldLoad ? eventIndicatorComp : undefined
93- anchors.top: dateLabel.bottom
94- anchors.horizontalCenter: dateLabel.horizontalCenter
95- }
96-
97- MouseArea {
98- anchors.fill: parent
99- onPressAndHold: {
100- var selectedDate = new Date();
101- selectedDate.setFullYear(intern.monthStartYear)
102- selectedDate.setMonth(intern.monthStartMonth + 1)
103- selectedDate.setDate(date)
104- selectedDate.setMinutes(60, 0, 0)
105- pageStack.push(Qt.resolvedUrl("NewEvent.qml"), {"date":selectedDate, "model":eventModel});
106- }
107- onClicked: {
108- var selectedDate = new Date(intern.monthStartYear,
109- intern.monthStartMonth,
110- intern.monthStartDate + index, 0, 0, 0, 0)
111- //If monthView is clicked then open selected DayView
112- if ( isYearView === false ) {
113- root.dateSelected(selectedDate);
114- }
115- //If yearView is clicked then open selected MonthView
116- else {
117- root.monthSelected(selectedDate);
118- }
119- }
120- }
121-}

Subscribers

People subscribed via source and target branches

to status/vote changes: