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

Proposed by Kunal Parmar
Status: Merged
Approved by: Frank Mertens
Approved revision: 19
Merged at revision: 14
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/DetailsView
Merge into: lp:ubuntu-calendar-app
Diff against target: 442 lines (+310/-94)
4 files modified
DiaryView.qml (+4/-0)
EventDetails.qml (+185/-0)
MonthView.qml (+15/-2)
calendar.qml (+106/-92)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/DetailsView
Reviewer Review Type Date Requested Status
Frank Mertens (community) tested on phone and desktop Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+156246@code.launchpad.net

Commit message

Adding DetailsView frm EventView_EventAPI branch,
Details view modified to use DataService
Pagestack used to push Details View

Description of the change

Adding DetailsView frm EventView_EventAPI branch,
Details view modified to use DataService
Pagestack used to push Details View

To post a comment you must log in.
15. By Kunal Parmar

formatting applied

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Frank Mertens (frankencode) wrote :

Looks good on first sight. I have to take a second look later today. When I run it, it shows always the same event. Could you also update your calendar.qml from trunk? The uitoolkit APIs deviated a bit and I had to move the tool actions.

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

> Looks good on first sight. I have to take a second look later today. When I
> run it, it shows always the same event. Could you also update your
> calendar.qml from trunk? The uitoolkit APIs deviated a bit and I had to move
> the tool actions.

I tool the latest master/trunk code and applied my changes over there, so calendar.qml should be latest one. However once you push your changes, I will update it once again.

Regarding same event display, When I run, it shows me proper event, but for message , location, I am using default values if there is nothing returned from DB.

Revision history for this message
Frank Mertens (frankencode) wrote :

Yes, I thought jenkins merged it already... The layout looks totally broken on the daily build on the phone and on the desktop, too. Try this:

http://bazaar.launchpad.net/~frankencode/ubuntu-calendar-app/data-service-newevent/view/head:/calendar.qml

Revision history for this message
Frank Mertens (frankencode) wrote :

When I click on an event I get the following error:

file:///home/frank/Source/Ubuntu/Calendar/DetailsView/EventDetails.qml:17: TypeError: Cannot read property 'header' of null

Revision history for this message
Frank Mertens (frankencode) wrote :

That's with the latest uitoolkit on raring on the desktop. On the phone I have yesterdays build.

16. By Kunal Parmar

Broken layout fixes, due to new pagestack changes

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

> That's with the latest uitoolkit on raring on the desktop. On the phone I have
> yesterdays build.

There are some problem, due to latest modification in PageStack element. I made some temporary fixes. To make it look as it was before.

Revision history for this message
Frank Mertens (frankencode) wrote :

OK, I can see the DetailsView, now. Regarding the multiple venues: the data model is possible overstretched. Just take the first venue. I'm looking into simplifying the data model. There are still bugs with the calendar.qml. You need to move the actions to the Page level and there is still a layout issue on the desktop, although it looks fine one the touch.

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

Resolving the layout issue, temp commit for merging latest trunk code

18. By Kunal Parmar

Layout issue due to new page stack change resolved

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

> OK, I can see the DetailsView, now. Regarding the multiple venues: the data
> model is possible overstretched. Just take the first venue. I'm looking into
> simplifying the data model. There are still bugs with the calendar.qml. You
> need to move the actions to the Page level and there is still a layout issue
> on the desktop, although it looks fine one the touch.

This bug was affecting the layout (https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1160175), I used work around suggested in bug report.

I hope it should work fine now on both device and desktop.

19. By Kunal Parmar

Change height calculation,to consider case if latest version of pageStack is not used

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Frank Mertens (frankencode) wrote :

It works now on the phone, but still fails on the desktop: http://imagebin.org/252524 .

There are also a few warnings on the desktop, which do not appear on the phone:
QQmlComponent: Component is not ready
QXcbWindow: Unhandled client message: "_GTK_LOAD_ICONTHEMES"

Which makes me think it is a raring issue.
I hope I'm back tonight to have a deeper look into the issue.

review: Approve (tested on phone and desktop)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'DiaryView.qml'
--- DiaryView.qml 2013-03-29 23:12:40 +0000
+++ DiaryView.qml 2013-04-02 11:51:24 +0000
@@ -44,6 +44,10 @@
4444
45 delegate: ListItem.Standard {45 delegate: ListItem.Standard {
46 text: startTime.toLocaleTimeString(Qt.locale(i18n.language), Locale.ShortFormat) + " " + title46 text: startTime.toLocaleTimeString(Qt.locale(i18n.language), Locale.ShortFormat) + " " + title
47
48 onClicked: {
49 pageStack.push(Qt.resolvedUrl("EventDetails.qml"),{event:diaryView.model.get(index)});
50 }
47 }51 }
4852
49 footer: ListItem.Standard {53 footer: ListItem.Standard {
5054
=== added file 'EventDetails.qml'
--- EventDetails.qml 1970-01-01 00:00:00 +0000
+++ EventDetails.qml 2013-04-02 11:51:24 +0000
@@ -0,0 +1,185 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
4import Ubuntu.Components.ListItems 0.1
5
6import "dataService.js" as DataService
7
8Page {
9 id: root
10
11 property var event;
12
13 anchors.fill: parent
14 anchors.margins: units.gu(2)
15
16 Component.onCompleted: {
17 if( pageStack.header )
18 pageStack.header.visible = false;
19 showEvent(event);
20 }
21
22 Component.onDestruction: {
23 if( pageStack.header )
24 pageStack.header.visible = true;
25 }
26
27 function showEvent(e) {
28
29 // FIXME: temp location in case there is no vanue is defined
30 var location="-15.800513,-47.91378";
31 //var location ="Terry' Cafe, 158 Great Suffold St, London, SE1 1PE";
32
33 timeLabel.text = Qt.formatDateTime(e.startTime,"hh:mm") + " - " + Qt.formatDateTime(e.endTime,"hh:mm");
34 dateLabel.text = Qt.formatDateTime(e.startTime,"ddd, d MMMM");
35 titleLabel.text = e.title;
36
37 locationLabel.text = location;
38 if( e.message ) {
39 descLabel.text = e.message;
40 }
41
42 var venues = []
43 DataService.getVenues(e, venues)
44 if( venues.length > 0 ) {
45 //FIXME: what to do for multiple venue
46 var place = venues[0];
47 locationLabel.text = address;
48 if( place.latitude && place.longitude) {
49 location = place.latitude +"," + place.longitude;
50 }
51 }
52
53 var attendees = []
54 DataService.getAttendees(e, attendees)
55 contactModel.clear();
56 for( var j = 0 ; j < attendees.length ; ++j ) {
57 contactModel.append( {"name": attendees[j] } );
58 }
59
60 // FIXME: need to cache map image to avoid duplicate download every time
61 var imageSrc = "http://maps.googleapis.com/maps/api/staticmap?center="+location+
62 "&markers=color:blue|"+location+"&zoom=15&size="+mapContainer.width+
63 "x"+mapContainer.height+"&sensor=false";
64 mapImage.source=imageSrc;
65 }
66
67 tools: ToolbarActions {
68 Action {
69 text: i18n.tr("Add invite");
70 onTriggered: {
71 print(text + " not implemented");
72 }
73 }
74 Action {
75 text: i18n.tr("Edit");
76 onTriggered: {
77 print(text + " not implemented");
78 }
79 }
80 active: true
81 lock: false
82 }
83
84 Column{
85 anchors.fill: parent
86 spacing: units.gu(1)
87
88 Item{
89 width: parent.width
90 height: timeLabel.height
91 Label{
92 id: timeLabel
93 anchors.left: parent.left
94 anchors.verticalCenter: parent.verticalCenter
95 fontSize: "large"
96 }
97 Label{
98 id: dateLabel
99 anchors.right: parent.right
100 anchors.verticalCenter: parent.verticalCenter
101 fontSize: "small"
102 }
103 }
104
105 Label{
106 id: titleLabel
107 fontSize: "x-large"
108 width: parent.width
109 wrapMode: Text.WordWrap
110 }
111 ThinDivider{}
112
113 Label{
114 id: descLabel
115 // FIXME: temporaty text, in ui there is no field to enter message
116 text:"Hi both, please turn up on time, it gets really busy by 1pm! Anna x"
117 wrapMode: Text.WordWrap
118 fontSize: "medium"
119 width: parent.width
120 }
121
122 //map control with location
123 Rectangle{
124 id: mapContainer
125 width:parent.width
126 height: units.gu(25)
127 Image {
128 id: mapImage
129 anchors.fill: parent
130 opacity: 0.5
131 }
132 Label{
133 id:locationLabel
134 wrapMode: Text.WordWrap
135 fontSize: "medium"
136 width: parent.width
137 //color:"#c94212"
138 color:"black"
139
140 anchors {
141 left: parent.left
142 leftMargin: units.gu(1)
143 bottom: parent.bottom
144 bottomMargin: units.gu(1)
145 }
146 }
147 }
148
149 Label{
150 text: i18n.tr("People");
151 fontSize: "small"
152 }
153 ThinDivider{}
154
155 //contact list view
156 ListView {
157 id:contactList
158 width: parent.width
159 height: {
160 var height = parent.height;
161 //not considering the list view it self
162 for( var i = 0; i < parent.children.length - 1 ; ++i) {
163 height -= parent.children[i].height;
164 }
165 height -= parent.children.length * parent.spacing;
166 }
167 clip: true
168 model: ListModel {
169 id: contactModel
170 }
171
172 Label{
173 fontSize: "medium"
174 visible: contactModel.count <= 0
175 anchors.verticalCenter: parent.verticalCenter
176 }
177
178 delegate: Standard{
179 text: name
180 icon: Qt.resolvedUrl("dummy.png")
181 progression: true
182 }
183 }
184 }
185}
0186
=== modified file 'MonthView.qml'
--- MonthView.qml 2013-03-27 23:36:18 +0000
+++ MonthView.qml 2013-04-02 11:51:24 +0000
@@ -11,8 +11,21 @@
11 readonly property var currentDayStart: intern.currentDayStart11 readonly property var currentDayStart: intern.currentDayStart
1212
13 property bool compressed: false13 property bool compressed: false
14 readonly property real compressedHeight: intern.squareUnit + intern.verticalMargin * 214 readonly property real compressedHeight: {
15 readonly property real expandedHeight: intern.squareUnit * 6 + intern.verticalMargin * 215 var height = intern.squareUnit + intern.verticalMargin * 2 ;
16 if( pageStack.header ) {
17 height += pageStack.header.height;
18 }
19 return height;
20 }
21
22 readonly property real expandedHeight: {
23 var height = intern.squareUnit * 6 + intern.verticalMargin * 2;
24 if( pageStack.header ) {
25 height += pageStack.header.height;
26 }
27 return height;
28 }
1629
17 signal incrementCurrentDay30 signal incrementCurrentDay
18 signal decrementCurrentDay31 signal decrementCurrentDay
1932
=== modified file 'calendar.qml'
--- calendar.qml 2013-03-29 23:12:40 +0000
+++ calendar.qml 2013-04-02 11:51:24 +0000
@@ -11,99 +11,113 @@
11 width: units.gu(45)11 width: units.gu(45)
12 height: units.gu(80)12 height: units.gu(80)
1313
14 Tabs {14 PageStack {
15 id: tabs15 id: pageStack
16
16 anchors.fill: parent17 anchors.fill: parent
1718
18 Tab { title: Qt.locale(i18n.language).monthName(0) }19 Component.onCompleted: push(monthViewPage)
19 Tab { title: Qt.locale(i18n.language).monthName(1) }20 __showHeader: false
20 Tab { title: Qt.locale(i18n.language).monthName(2) }21
21 Tab { title: Qt.locale(i18n.language).monthName(3) }22 Page {
22 Tab { title: Qt.locale(i18n.language).monthName(4) }23 id: monthViewPage
23 Tab { title: Qt.locale(i18n.language).monthName(5) }24 anchors.fill: parent
24 Tab { title: Qt.locale(i18n.language).monthName(6) }25
25 Tab { title: Qt.locale(i18n.language).monthName(7) }26 tools: ToolbarActions {
26 Tab { title: Qt.locale(i18n.language).monthName(8) }27 Action {
27 Tab { title: Qt.locale(i18n.language).monthName(9) }28 iconSource: Qt.resolvedUrl("avatar.png")
28 Tab { title: Qt.locale(i18n.language).monthName(10) }29 text: i18n.tr("To-do")
29 Tab { title: Qt.locale(i18n.language).monthName(11) }30 onTriggered:; // FIXME
3031 }
31 onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex)32 Action {
3233 iconSource: Qt.resolvedUrl("avatar.png")
33 tools: ToolbarActions {34 text: i18n.tr("New Event")
34 Action {35 onTriggered: monthViewPage.newEvent()
35 iconSource: Qt.resolvedUrl("avatar.png")36 }
36 text: i18n.tr("To-do")37 Action {
37 onTriggered:; // FIXME38 iconSource: Qt.resolvedUrl("avatar.png")
38 }39 text: i18n.tr("Timeline")
39 Action {40 onTriggered:; // FIXME
40 iconSource: Qt.resolvedUrl("avatar.png")41 }
41 text: i18n.tr("New Event")42 }
42 onTriggered: mainView.newEvent()43
43 }44 Tabs {
44 Action {45 id: tabs
45 iconSource: Qt.resolvedUrl("avatar.png")46 anchors.fill: parent
46 text: i18n.tr("Timeline")47
47 onTriggered:; // FIXME48 Tab { title: Qt.locale(i18n.language).monthName(0) }
48 }49 Tab { title: Qt.locale(i18n.language).monthName(1) }
49 }50 Tab { title: Qt.locale(i18n.language).monthName(2) }
50 }51 Tab { title: Qt.locale(i18n.language).monthName(3) }
5152 Tab { title: Qt.locale(i18n.language).monthName(4) }
52 Rectangle {53 Tab { title: Qt.locale(i18n.language).monthName(5) }
53 anchors.fill: monthView54 Tab { title: Qt.locale(i18n.language).monthName(6) }
54 color: "white"55 Tab { title: Qt.locale(i18n.language).monthName(7) }
55 }56 Tab { title: Qt.locale(i18n.language).monthName(8) }
5657 Tab { title: Qt.locale(i18n.language).monthName(9) }
57 MonthView {58 Tab { title: Qt.locale(i18n.language).monthName(10) }
58 id: monthView59 Tab { title: Qt.locale(i18n.language).monthName(11) }
59 onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth()60
60 y: units.gu(9.5) // FIXME61 onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex)
61 onMovementEnded: eventView.currentDayStart = currentDayStart62 }
62 onCurrentDayStartChanged: if (!(dragging || flicking)) eventView.currentDayStart = currentDayStart63
63 Component.onCompleted: eventView.currentDayStart = currentDayStart64 Rectangle {
64 }65 anchors.fill: monthView
6566 color: "white"
66 EventView {67 }
67 id: eventView68
6869 MonthView {
69 property real minY: monthView.y + monthView.compressedHeight70 id: monthView
70 property real maxY: monthView.y + monthView.expandedHeight71 onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth()
7172 //y: units.gu(9.5) // FIXME
72 y: maxY73 onMovementEnded: eventView.currentDayStart = currentDayStart
73 width: mainView.width74 onCurrentDayStartChanged: if (!(dragging || flicking)) eventView.currentDayStart = currentDayStart
74 height: parent.height - y75 Component.onCompleted: eventView.currentDayStart = currentDayStart
7576 }
76 expanded: monthView.compressed77
7778 EventView {
78 Component.onCompleted: {79 id: eventView
79 incrementCurrentDay.connect(monthView.incrementCurrentDay)80
80 decrementCurrentDay.connect(monthView.decrementCurrentDay)81 property real minY: monthView.y + monthView.compressedHeight
81 }82 property real maxY: monthView.y + monthView.expandedHeight
8283
83 onExpand: {84 y: maxY
84 monthView.compressed = true85 width: mainView.width
85 yBehavior.enabled = true86 height: parent.height - y
86 y = minY87
87 }88 expanded: monthView.compressed
88 onCompress: {89
89 monthView.compressed = false90 Component.onCompleted: {
90 y = maxY91 incrementCurrentDay.connect(monthView.incrementCurrentDay)
91 }92 decrementCurrentDay.connect(monthView.decrementCurrentDay)
9293 }
93 Behavior on y {94
94 id: yBehavior95 onExpand: {
95 enabled: false96 monthView.compressed = true
96 NumberAnimation { duration: 100 }97 yBehavior.enabled = true
97 }98 y = minY
9899 }
99 onNewEvent: mainView.newEvent()100 onCompress: {
100 }101 monthView.compressed = false
101102 y = maxY
102 signal newEvent103 }
103 onNewEvent: PopupUtils.open(newEventComponent, mainView, {"defaultDate": monthView.currentDayStart})104
104105 Behavior on y {
105 Component {106 id: yBehavior
106 id: newEventComponent107 enabled: false
107 NewEvent {}108 NumberAnimation { duration: 100 }
109 }
110
111 onNewEvent: monthViewPage.newEvent()
112 }
113
114 signal newEvent
115 onNewEvent: PopupUtils.open(newEventComponent, monthViewPage, {"defaultDate": monthView.currentDayStart})
116
117 Component {
118 id: newEventComponent
119 NewEvent {}
120 }
121 }
108 }122 }
109}123}

Subscribers

People subscribed via source and target branches

to status/vote changes: