Merge lp:~frankencode/ubuntu-calendar-app/data-service-newevent into lp:ubuntu-calendar-app

Proposed by Frank Mertens
Status: Merged
Approved by: Frank Mertens
Approved revision: 15
Merged at revision: 13
Proposed branch: lp:~frankencode/ubuntu-calendar-app/data-service-newevent
Merge into: lp:ubuntu-calendar-app
Diff against target: 335 lines (+208/-35)
5 files modified
DiaryView.qml (+3/-1)
EventView.qml (+2/-0)
NewEvent.qml (+159/-0)
calendar.qml (+43/-33)
testrun.sh (+1/-1)
To merge this branch: bzr merge lp:~frankencode/ubuntu-calendar-app/data-service-newevent
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Kunal Parmar Approve
Review via email: mp+156228@code.launchpad.net

Commit message

Added the NewEvent component from the EventAPI_EventView branch

Description of the change

Added the NewEvent component from the EventAPI_EventView branch

To post a comment you must log in.
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

works fine, new way to compress month into week is much better

review: Approve
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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

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-27 23:09:07 +0000
3+++ DiaryView.qml 2013-03-29 23:18:19 +0000
4@@ -16,6 +16,7 @@
5
6 signal expand()
7 signal compress()
8+ signal newEvent()
9
10 clip: true
11
12@@ -46,7 +47,8 @@
13 }
14
15 footer: ListItem.Standard {
16- text: i18n.tr("(+) New Event / Todo")
17+ text: i18n.tr("(+) New Event")
18+ onClicked: newEvent()
19 }
20
21 onContentYChanged: {
22
23=== modified file 'EventView.qml'
24--- EventView.qml 2013-03-27 23:09:07 +0000
25+++ EventView.qml 2013-03-29 23:18:19 +0000
26@@ -14,6 +14,7 @@
27
28 signal compress()
29 signal expand()
30+ signal newEvent()
31
32 readonly property real visibleHeight: parent.height - y
33
34@@ -74,5 +75,6 @@
35
36 onExpand: eventView.expand()
37 onCompress: eventView.compress()
38+ onNewEvent: eventView.newEvent()
39 }
40 }
41
42=== added file 'NewEvent.qml'
43--- NewEvent.qml 1970-01-01 00:00:00 +0000
44+++ NewEvent.qml 2013-03-29 23:18:19 +0000
45@@ -0,0 +1,159 @@
46+import QtQuick 2.0
47+import Ubuntu.Components 0.1
48+import Ubuntu.Components.Popups 0.1
49+import Ubuntu.Components.ListItems 0.1 as ListItem
50+
51+import "dataService.js" as DataService
52+
53+Popover {
54+ id: popover
55+ property var defaultDate;
56+
57+ Column {
58+ id: containerLayout
59+ anchors {
60+ left: parent.left
61+ top: parent.top
62+ right: parent.right
63+ }
64+
65+ ListItem.Header { text: i18n.tr("Create event") }
66+ ListItem.Empty {
67+ highlightWhenPressed: false
68+ TextField {
69+ id: titleEdit
70+ placeholderText: i18n.tr("Add event name")
71+ anchors {
72+ fill: parent
73+ margins: units.gu(1)
74+ }
75+ }
76+ }
77+
78+ ListItem.Empty {
79+ id: dateItem
80+
81+ height: column.height
82+ width: parent.width
83+
84+ Column {
85+ id: column
86+
87+ anchors {
88+ left: parent.left
89+ right: parent.right
90+ }
91+
92+ Item {
93+ width: popover.width
94+ height: dateLabel.height
95+ Label {
96+ id: dateLabel
97+ text: Qt.formatDateTime(defaultDate, "ddd, d MMMM yyyy");
98+ anchors {
99+ left: parent.left
100+ right: parent.right
101+ margins: units.gu(1)
102+ }
103+ }
104+ }
105+
106+ Item {
107+ id: timeContainer
108+ width: parent.width
109+ height: startTime.height
110+
111+ ListItem.Empty {
112+ id: startTime
113+ highlightWhenPressed: false
114+ anchors.left: timeContainer.left
115+ width: units.gu(12)
116+ TextField {
117+ id: startTimeEdit
118+ text: Qt.formatDateTime(defaultDate,"hh")
119+ anchors {
120+ fill: parent
121+ margins: units.gu(1)
122+ }
123+ }
124+ }
125+
126+ ListItem.Empty {
127+ id: endTime
128+ highlightWhenPressed: false
129+ anchors.right: timeContainer.right
130+ width: units.gu(12)
131+ TextField {
132+ id: endTimeEdit
133+ text: Qt.formatDateTime(defaultDate,"hh")
134+ anchors {
135+ fill: parent
136+ margins: units.gu(1)
137+ }
138+ }
139+ }
140+ }
141+ }
142+ }
143+
144+ ListItem.Header { text: i18n.tr("Location") }
145+ ListItem.Empty {
146+ highlightWhenPressed: false
147+ TextField {
148+ id: locationEdit
149+ placeholderText: i18n.tr("Add Location")
150+ anchors {
151+ fill: parent
152+ margins: units.gu(1)
153+ }
154+ }
155+ }
156+
157+ ListItem.Header { text: i18n.tr("People") }
158+ ListItem.Empty {
159+ highlightWhenPressed: false
160+ TextField {
161+ id: personEdit
162+ placeholderText: i18n.tr("Invite People")
163+ anchors {
164+ fill: parent
165+ margins: units.gu(1)
166+ }
167+ }
168+ }
169+
170+ ListItem.SingleControl {
171+ highlightWhenPressed: false
172+ control: Button {
173+ text: i18n.tr("Save")
174+ anchors {
175+ fill: parent
176+ margins: units.gu(1)
177+ }
178+
179+ onClicked: {
180+ var startDate = new Date(defaultDate)
181+ print(startDate)
182+ startDate.setHours(startTimeEdit.text)
183+ print(startTimeEdit.text)
184+
185+ var endDate = new Date(defaultDate)
186+ print(endDate)
187+ endDate.setHours(endTimeEdit.text)
188+ print(endTimeEdit.text)
189+
190+ var event = {
191+ title: titleEdit.text,
192+ message: null,
193+ startTime: startDate.getTime(),
194+ endTime: endDate.getTime()
195+ }
196+
197+ DataService.addEvent(event)
198+
199+ PopupUtils.close(popover);
200+ }
201+ }
202+ }
203+ }
204+}
205
206=== modified file 'calendar.qml'
207--- calendar.qml 2013-03-27 23:36:18 +0000
208+++ calendar.qml 2013-03-29 23:18:19 +0000
209@@ -1,5 +1,6 @@
210 import QtQuick 2.0
211 import Ubuntu.Components 0.1
212+import Ubuntu.Components.Popups 0.1
213
214 MainView {
215 id: mainView
216@@ -9,26 +10,43 @@
217
218 width: units.gu(45)
219 height: units.gu(80)
220- // FIXME: 80/45 = aspect ration of Galaxy Nexus
221
222- Tabs { // preliminary HACK, needs rewrite when NewTabBar is finalized!
223+ Tabs {
224 id: tabs
225 anchors.fill: parent
226
227- Tab { id: pageArea; title: i18n.tr("January"); page: Item { anchors.fill: parent } }
228- Tab { title: i18n.tr("February") }
229- Tab { title: i18n.tr("March") }
230- Tab { title: i18n.tr("April") }
231- Tab { title: i18n.tr("May") }
232- Tab { title: i18n.tr("June") }
233- Tab { title: i18n.tr("July") }
234- Tab { title: i18n.tr("August") }
235- Tab { title: i18n.tr("September") }
236- Tab { title: i18n.tr("October") }
237- Tab { title: i18n.tr("November") }
238- Tab { title: i18n.tr("December") }
239+ Tab { title: Qt.locale(i18n.language).monthName(0) }
240+ Tab { title: Qt.locale(i18n.language).monthName(1) }
241+ Tab { title: Qt.locale(i18n.language).monthName(2) }
242+ Tab { title: Qt.locale(i18n.language).monthName(3) }
243+ Tab { title: Qt.locale(i18n.language).monthName(4) }
244+ Tab { title: Qt.locale(i18n.language).monthName(5) }
245+ Tab { title: Qt.locale(i18n.language).monthName(6) }
246+ Tab { title: Qt.locale(i18n.language).monthName(7) }
247+ Tab { title: Qt.locale(i18n.language).monthName(8) }
248+ Tab { title: Qt.locale(i18n.language).monthName(9) }
249+ Tab { title: Qt.locale(i18n.language).monthName(10) }
250+ Tab { title: Qt.locale(i18n.language).monthName(11) }
251
252 onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex)
253+
254+ tools: ToolbarActions {
255+ Action {
256+ iconSource: Qt.resolvedUrl("avatar.png")
257+ text: i18n.tr("To-do")
258+ onTriggered:; // FIXME
259+ }
260+ Action {
261+ iconSource: Qt.resolvedUrl("avatar.png")
262+ text: i18n.tr("New Event")
263+ onTriggered: mainView.newEvent()
264+ }
265+ Action {
266+ iconSource: Qt.resolvedUrl("avatar.png")
267+ text: i18n.tr("Timeline")
268+ onTriggered:; // FIXME
269+ }
270+ }
271 }
272
273 Rectangle {
274@@ -39,7 +57,7 @@
275 MonthView {
276 id: monthView
277 onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth()
278- y: pageArea.y
279+ y: units.gu(9.5) // FIXME
280 onMovementEnded: eventView.currentDayStart = currentDayStart
281 onCurrentDayStartChanged: if (!(dragging || flicking)) eventView.currentDayStart = currentDayStart
282 Component.onCompleted: eventView.currentDayStart = currentDayStart
283@@ -48,8 +66,8 @@
284 EventView {
285 id: eventView
286
287- property real minY: pageArea.y + monthView.compressedHeight
288- property real maxY: pageArea.y + monthView.expandedHeight
289+ property real minY: monthView.y + monthView.compressedHeight
290+ property real maxY: monthView.y + monthView.expandedHeight
291
292 y: maxY
293 width: mainView.width
294@@ -77,23 +95,15 @@
295 enabled: false
296 NumberAnimation { duration: 100 }
297 }
298+
299+ onNewEvent: mainView.newEvent()
300 }
301
302- tools: ToolbarActions {
303- Action {
304- iconSource: Qt.resolvedUrl("avatar.png")
305- text: i18n.tr("To-do")
306- onTriggered:; // FIXME
307- }
308- Action {
309- iconSource: Qt.resolvedUrl("avatar.png")
310- text: i18n.tr("New Event")
311- onTriggered:; // FIXME
312- }
313- Action {
314- iconSource: Qt.resolvedUrl("avatar.png")
315- text: i18n.tr("Timeline")
316- onTriggered:; // FIXME
317- }
318+ signal newEvent
319+ onNewEvent: PopupUtils.open(newEventComponent, mainView, {"defaultDate": monthView.currentDayStart})
320+
321+ Component {
322+ id: newEventComponent
323+ NewEvent {}
324 }
325 }
326
327=== modified file 'testrun.sh'
328--- testrun.sh 2013-03-06 18:35:00 +0000
329+++ testrun.sh 2013-03-29 23:18:19 +0000
330@@ -1,4 +1,4 @@
331 #! /bin/bash -ex
332
333 rsync -aHv ./ phablet@nexus:/tmp/Calendar/
334-ssh -t phablet@nexus 'cd /tmp/Calendar && GRID_UNIT_PX=18 qmlscene --desktop_file_hint=$PWD/Calendar.desktop $PWD/calendar.qml'
335+ssh -t phablet@nexus 'cd /tmp/Calendar && echo "qmlscene --desktop_file_hint=$PWD/Calendar.desktop $PWD/calendar.qml" > runme.sh && chmod +x runme.sh && bash -i runme.sh'

Subscribers

People subscribed via source and target branches

to status/vote changes: