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
1=== modified file 'DiaryView.qml'
2--- DiaryView.qml 2013-03-29 23:12:40 +0000
3+++ DiaryView.qml 2013-04-02 11:51:24 +0000
4@@ -44,6 +44,10 @@
5
6 delegate: ListItem.Standard {
7 text: startTime.toLocaleTimeString(Qt.locale(i18n.language), Locale.ShortFormat) + " " + title
8+
9+ onClicked: {
10+ pageStack.push(Qt.resolvedUrl("EventDetails.qml"),{event:diaryView.model.get(index)});
11+ }
12 }
13
14 footer: ListItem.Standard {
15
16=== added file 'EventDetails.qml'
17--- EventDetails.qml 1970-01-01 00:00:00 +0000
18+++ EventDetails.qml 2013-04-02 11:51:24 +0000
19@@ -0,0 +1,185 @@
20+import QtQuick 2.0
21+import Ubuntu.Components 0.1
22+import Ubuntu.Components.Popups 0.1
23+import Ubuntu.Components.ListItems 0.1
24+
25+import "dataService.js" as DataService
26+
27+Page {
28+ id: root
29+
30+ property var event;
31+
32+ anchors.fill: parent
33+ anchors.margins: units.gu(2)
34+
35+ Component.onCompleted: {
36+ if( pageStack.header )
37+ pageStack.header.visible = false;
38+ showEvent(event);
39+ }
40+
41+ Component.onDestruction: {
42+ if( pageStack.header )
43+ pageStack.header.visible = true;
44+ }
45+
46+ function showEvent(e) {
47+
48+ // FIXME: temp location in case there is no vanue is defined
49+ var location="-15.800513,-47.91378";
50+ //var location ="Terry' Cafe, 158 Great Suffold St, London, SE1 1PE";
51+
52+ timeLabel.text = Qt.formatDateTime(e.startTime,"hh:mm") + " - " + Qt.formatDateTime(e.endTime,"hh:mm");
53+ dateLabel.text = Qt.formatDateTime(e.startTime,"ddd, d MMMM");
54+ titleLabel.text = e.title;
55+
56+ locationLabel.text = location;
57+ if( e.message ) {
58+ descLabel.text = e.message;
59+ }
60+
61+ var venues = []
62+ DataService.getVenues(e, venues)
63+ if( venues.length > 0 ) {
64+ //FIXME: what to do for multiple venue
65+ var place = venues[0];
66+ locationLabel.text = address;
67+ if( place.latitude && place.longitude) {
68+ location = place.latitude +"," + place.longitude;
69+ }
70+ }
71+
72+ var attendees = []
73+ DataService.getAttendees(e, attendees)
74+ contactModel.clear();
75+ for( var j = 0 ; j < attendees.length ; ++j ) {
76+ contactModel.append( {"name": attendees[j] } );
77+ }
78+
79+ // FIXME: need to cache map image to avoid duplicate download every time
80+ var imageSrc = "http://maps.googleapis.com/maps/api/staticmap?center="+location+
81+ "&markers=color:blue|"+location+"&zoom=15&size="+mapContainer.width+
82+ "x"+mapContainer.height+"&sensor=false";
83+ mapImage.source=imageSrc;
84+ }
85+
86+ tools: ToolbarActions {
87+ Action {
88+ text: i18n.tr("Add invite");
89+ onTriggered: {
90+ print(text + " not implemented");
91+ }
92+ }
93+ Action {
94+ text: i18n.tr("Edit");
95+ onTriggered: {
96+ print(text + " not implemented");
97+ }
98+ }
99+ active: true
100+ lock: false
101+ }
102+
103+ Column{
104+ anchors.fill: parent
105+ spacing: units.gu(1)
106+
107+ Item{
108+ width: parent.width
109+ height: timeLabel.height
110+ Label{
111+ id: timeLabel
112+ anchors.left: parent.left
113+ anchors.verticalCenter: parent.verticalCenter
114+ fontSize: "large"
115+ }
116+ Label{
117+ id: dateLabel
118+ anchors.right: parent.right
119+ anchors.verticalCenter: parent.verticalCenter
120+ fontSize: "small"
121+ }
122+ }
123+
124+ Label{
125+ id: titleLabel
126+ fontSize: "x-large"
127+ width: parent.width
128+ wrapMode: Text.WordWrap
129+ }
130+ ThinDivider{}
131+
132+ Label{
133+ id: descLabel
134+ // FIXME: temporaty text, in ui there is no field to enter message
135+ text:"Hi both, please turn up on time, it gets really busy by 1pm! Anna x"
136+ wrapMode: Text.WordWrap
137+ fontSize: "medium"
138+ width: parent.width
139+ }
140+
141+ //map control with location
142+ Rectangle{
143+ id: mapContainer
144+ width:parent.width
145+ height: units.gu(25)
146+ Image {
147+ id: mapImage
148+ anchors.fill: parent
149+ opacity: 0.5
150+ }
151+ Label{
152+ id:locationLabel
153+ wrapMode: Text.WordWrap
154+ fontSize: "medium"
155+ width: parent.width
156+ //color:"#c94212"
157+ color:"black"
158+
159+ anchors {
160+ left: parent.left
161+ leftMargin: units.gu(1)
162+ bottom: parent.bottom
163+ bottomMargin: units.gu(1)
164+ }
165+ }
166+ }
167+
168+ Label{
169+ text: i18n.tr("People");
170+ fontSize: "small"
171+ }
172+ ThinDivider{}
173+
174+ //contact list view
175+ ListView {
176+ id:contactList
177+ width: parent.width
178+ height: {
179+ var height = parent.height;
180+ //not considering the list view it self
181+ for( var i = 0; i < parent.children.length - 1 ; ++i) {
182+ height -= parent.children[i].height;
183+ }
184+ height -= parent.children.length * parent.spacing;
185+ }
186+ clip: true
187+ model: ListModel {
188+ id: contactModel
189+ }
190+
191+ Label{
192+ fontSize: "medium"
193+ visible: contactModel.count <= 0
194+ anchors.verticalCenter: parent.verticalCenter
195+ }
196+
197+ delegate: Standard{
198+ text: name
199+ icon: Qt.resolvedUrl("dummy.png")
200+ progression: true
201+ }
202+ }
203+ }
204+}
205
206=== modified file 'MonthView.qml'
207--- MonthView.qml 2013-03-27 23:36:18 +0000
208+++ MonthView.qml 2013-04-02 11:51:24 +0000
209@@ -11,8 +11,21 @@
210 readonly property var currentDayStart: intern.currentDayStart
211
212 property bool compressed: false
213- readonly property real compressedHeight: intern.squareUnit + intern.verticalMargin * 2
214- readonly property real expandedHeight: intern.squareUnit * 6 + intern.verticalMargin * 2
215+ readonly property real compressedHeight: {
216+ var height = intern.squareUnit + intern.verticalMargin * 2 ;
217+ if( pageStack.header ) {
218+ height += pageStack.header.height;
219+ }
220+ return height;
221+ }
222+
223+ readonly property real expandedHeight: {
224+ var height = intern.squareUnit * 6 + intern.verticalMargin * 2;
225+ if( pageStack.header ) {
226+ height += pageStack.header.height;
227+ }
228+ return height;
229+ }
230
231 signal incrementCurrentDay
232 signal decrementCurrentDay
233
234=== modified file 'calendar.qml'
235--- calendar.qml 2013-03-29 23:12:40 +0000
236+++ calendar.qml 2013-04-02 11:51:24 +0000
237@@ -11,99 +11,113 @@
238 width: units.gu(45)
239 height: units.gu(80)
240
241- Tabs {
242- id: tabs
243+ PageStack {
244+ id: pageStack
245+
246 anchors.fill: parent
247
248- Tab { title: Qt.locale(i18n.language).monthName(0) }
249- Tab { title: Qt.locale(i18n.language).monthName(1) }
250- Tab { title: Qt.locale(i18n.language).monthName(2) }
251- Tab { title: Qt.locale(i18n.language).monthName(3) }
252- Tab { title: Qt.locale(i18n.language).monthName(4) }
253- Tab { title: Qt.locale(i18n.language).monthName(5) }
254- Tab { title: Qt.locale(i18n.language).monthName(6) }
255- Tab { title: Qt.locale(i18n.language).monthName(7) }
256- Tab { title: Qt.locale(i18n.language).monthName(8) }
257- Tab { title: Qt.locale(i18n.language).monthName(9) }
258- Tab { title: Qt.locale(i18n.language).monthName(10) }
259- Tab { title: Qt.locale(i18n.language).monthName(11) }
260-
261- onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex)
262-
263- tools: ToolbarActions {
264- Action {
265- iconSource: Qt.resolvedUrl("avatar.png")
266- text: i18n.tr("To-do")
267- onTriggered:; // FIXME
268- }
269- Action {
270- iconSource: Qt.resolvedUrl("avatar.png")
271- text: i18n.tr("New Event")
272- onTriggered: mainView.newEvent()
273- }
274- Action {
275- iconSource: Qt.resolvedUrl("avatar.png")
276- text: i18n.tr("Timeline")
277- onTriggered:; // FIXME
278- }
279- }
280- }
281-
282- Rectangle {
283- anchors.fill: monthView
284- color: "white"
285- }
286-
287- MonthView {
288- id: monthView
289- onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth()
290- y: units.gu(9.5) // FIXME
291- onMovementEnded: eventView.currentDayStart = currentDayStart
292- onCurrentDayStartChanged: if (!(dragging || flicking)) eventView.currentDayStart = currentDayStart
293- Component.onCompleted: eventView.currentDayStart = currentDayStart
294- }
295-
296- EventView {
297- id: eventView
298-
299- property real minY: monthView.y + monthView.compressedHeight
300- property real maxY: monthView.y + monthView.expandedHeight
301-
302- y: maxY
303- width: mainView.width
304- height: parent.height - y
305-
306- expanded: monthView.compressed
307-
308- Component.onCompleted: {
309- incrementCurrentDay.connect(monthView.incrementCurrentDay)
310- decrementCurrentDay.connect(monthView.decrementCurrentDay)
311- }
312-
313- onExpand: {
314- monthView.compressed = true
315- yBehavior.enabled = true
316- y = minY
317- }
318- onCompress: {
319- monthView.compressed = false
320- y = maxY
321- }
322-
323- Behavior on y {
324- id: yBehavior
325- enabled: false
326- NumberAnimation { duration: 100 }
327- }
328-
329- onNewEvent: mainView.newEvent()
330- }
331-
332- signal newEvent
333- onNewEvent: PopupUtils.open(newEventComponent, mainView, {"defaultDate": monthView.currentDayStart})
334-
335- Component {
336- id: newEventComponent
337- NewEvent {}
338+ Component.onCompleted: push(monthViewPage)
339+ __showHeader: false
340+
341+ Page {
342+ id: monthViewPage
343+ anchors.fill: parent
344+
345+ tools: ToolbarActions {
346+ Action {
347+ iconSource: Qt.resolvedUrl("avatar.png")
348+ text: i18n.tr("To-do")
349+ onTriggered:; // FIXME
350+ }
351+ Action {
352+ iconSource: Qt.resolvedUrl("avatar.png")
353+ text: i18n.tr("New Event")
354+ onTriggered: monthViewPage.newEvent()
355+ }
356+ Action {
357+ iconSource: Qt.resolvedUrl("avatar.png")
358+ text: i18n.tr("Timeline")
359+ onTriggered:; // FIXME
360+ }
361+ }
362+
363+ Tabs {
364+ id: tabs
365+ anchors.fill: parent
366+
367+ Tab { title: Qt.locale(i18n.language).monthName(0) }
368+ Tab { title: Qt.locale(i18n.language).monthName(1) }
369+ Tab { title: Qt.locale(i18n.language).monthName(2) }
370+ Tab { title: Qt.locale(i18n.language).monthName(3) }
371+ Tab { title: Qt.locale(i18n.language).monthName(4) }
372+ Tab { title: Qt.locale(i18n.language).monthName(5) }
373+ Tab { title: Qt.locale(i18n.language).monthName(6) }
374+ Tab { title: Qt.locale(i18n.language).monthName(7) }
375+ Tab { title: Qt.locale(i18n.language).monthName(8) }
376+ Tab { title: Qt.locale(i18n.language).monthName(9) }
377+ Tab { title: Qt.locale(i18n.language).monthName(10) }
378+ Tab { title: Qt.locale(i18n.language).monthName(11) }
379+
380+ onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex)
381+ }
382+
383+ Rectangle {
384+ anchors.fill: monthView
385+ color: "white"
386+ }
387+
388+ MonthView {
389+ id: monthView
390+ onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth()
391+ //y: units.gu(9.5) // FIXME
392+ onMovementEnded: eventView.currentDayStart = currentDayStart
393+ onCurrentDayStartChanged: if (!(dragging || flicking)) eventView.currentDayStart = currentDayStart
394+ Component.onCompleted: eventView.currentDayStart = currentDayStart
395+ }
396+
397+ EventView {
398+ id: eventView
399+
400+ property real minY: monthView.y + monthView.compressedHeight
401+ property real maxY: monthView.y + monthView.expandedHeight
402+
403+ y: maxY
404+ width: mainView.width
405+ height: parent.height - y
406+
407+ expanded: monthView.compressed
408+
409+ Component.onCompleted: {
410+ incrementCurrentDay.connect(monthView.incrementCurrentDay)
411+ decrementCurrentDay.connect(monthView.decrementCurrentDay)
412+ }
413+
414+ onExpand: {
415+ monthView.compressed = true
416+ yBehavior.enabled = true
417+ y = minY
418+ }
419+ onCompress: {
420+ monthView.compressed = false
421+ y = maxY
422+ }
423+
424+ Behavior on y {
425+ id: yBehavior
426+ enabled: false
427+ NumberAnimation { duration: 100 }
428+ }
429+
430+ onNewEvent: monthViewPage.newEvent()
431+ }
432+
433+ signal newEvent
434+ onNewEvent: PopupUtils.open(newEventComponent, monthViewPage, {"defaultDate": monthView.currentDayStart})
435+
436+ Component {
437+ id: newEventComponent
438+ NewEvent {}
439+ }
440+ }
441 }
442 }

Subscribers

People subscribed via source and target branches

to status/vote changes: