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
=== modified file 'DiaryView.qml'
--- DiaryView.qml 2013-03-27 23:09:07 +0000
+++ DiaryView.qml 2013-03-29 23:18:19 +0000
@@ -16,6 +16,7 @@
1616
17 signal expand()17 signal expand()
18 signal compress()18 signal compress()
19 signal newEvent()
1920
20 clip: true21 clip: true
2122
@@ -46,7 +47,8 @@
46 }47 }
4748
48 footer: ListItem.Standard {49 footer: ListItem.Standard {
49 text: i18n.tr("(+) New Event / Todo")50 text: i18n.tr("(+) New Event")
51 onClicked: newEvent()
50 }52 }
5153
52 onContentYChanged: {54 onContentYChanged: {
5355
=== modified file 'EventView.qml'
--- EventView.qml 2013-03-27 23:09:07 +0000
+++ EventView.qml 2013-03-29 23:18:19 +0000
@@ -14,6 +14,7 @@
1414
15 signal compress()15 signal compress()
16 signal expand()16 signal expand()
17 signal newEvent()
1718
18 readonly property real visibleHeight: parent.height - y19 readonly property real visibleHeight: parent.height - y
1920
@@ -74,5 +75,6 @@
7475
75 onExpand: eventView.expand()76 onExpand: eventView.expand()
76 onCompress: eventView.compress()77 onCompress: eventView.compress()
78 onNewEvent: eventView.newEvent()
77 }79 }
78}80}
7981
=== added file 'NewEvent.qml'
--- NewEvent.qml 1970-01-01 00:00:00 +0000
+++ NewEvent.qml 2013-03-29 23:18:19 +0000
@@ -0,0 +1,159 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
4import Ubuntu.Components.ListItems 0.1 as ListItem
5
6import "dataService.js" as DataService
7
8Popover {
9 id: popover
10 property var defaultDate;
11
12 Column {
13 id: containerLayout
14 anchors {
15 left: parent.left
16 top: parent.top
17 right: parent.right
18 }
19
20 ListItem.Header { text: i18n.tr("Create event") }
21 ListItem.Empty {
22 highlightWhenPressed: false
23 TextField {
24 id: titleEdit
25 placeholderText: i18n.tr("Add event name")
26 anchors {
27 fill: parent
28 margins: units.gu(1)
29 }
30 }
31 }
32
33 ListItem.Empty {
34 id: dateItem
35
36 height: column.height
37 width: parent.width
38
39 Column {
40 id: column
41
42 anchors {
43 left: parent.left
44 right: parent.right
45 }
46
47 Item {
48 width: popover.width
49 height: dateLabel.height
50 Label {
51 id: dateLabel
52 text: Qt.formatDateTime(defaultDate, "ddd, d MMMM yyyy");
53 anchors {
54 left: parent.left
55 right: parent.right
56 margins: units.gu(1)
57 }
58 }
59 }
60
61 Item {
62 id: timeContainer
63 width: parent.width
64 height: startTime.height
65
66 ListItem.Empty {
67 id: startTime
68 highlightWhenPressed: false
69 anchors.left: timeContainer.left
70 width: units.gu(12)
71 TextField {
72 id: startTimeEdit
73 text: Qt.formatDateTime(defaultDate,"hh")
74 anchors {
75 fill: parent
76 margins: units.gu(1)
77 }
78 }
79 }
80
81 ListItem.Empty {
82 id: endTime
83 highlightWhenPressed: false
84 anchors.right: timeContainer.right
85 width: units.gu(12)
86 TextField {
87 id: endTimeEdit
88 text: Qt.formatDateTime(defaultDate,"hh")
89 anchors {
90 fill: parent
91 margins: units.gu(1)
92 }
93 }
94 }
95 }
96 }
97 }
98
99 ListItem.Header { text: i18n.tr("Location") }
100 ListItem.Empty {
101 highlightWhenPressed: false
102 TextField {
103 id: locationEdit
104 placeholderText: i18n.tr("Add Location")
105 anchors {
106 fill: parent
107 margins: units.gu(1)
108 }
109 }
110 }
111
112 ListItem.Header { text: i18n.tr("People") }
113 ListItem.Empty {
114 highlightWhenPressed: false
115 TextField {
116 id: personEdit
117 placeholderText: i18n.tr("Invite People")
118 anchors {
119 fill: parent
120 margins: units.gu(1)
121 }
122 }
123 }
124
125 ListItem.SingleControl {
126 highlightWhenPressed: false
127 control: Button {
128 text: i18n.tr("Save")
129 anchors {
130 fill: parent
131 margins: units.gu(1)
132 }
133
134 onClicked: {
135 var startDate = new Date(defaultDate)
136 print(startDate)
137 startDate.setHours(startTimeEdit.text)
138 print(startTimeEdit.text)
139
140 var endDate = new Date(defaultDate)
141 print(endDate)
142 endDate.setHours(endTimeEdit.text)
143 print(endTimeEdit.text)
144
145 var event = {
146 title: titleEdit.text,
147 message: null,
148 startTime: startDate.getTime(),
149 endTime: endDate.getTime()
150 }
151
152 DataService.addEvent(event)
153
154 PopupUtils.close(popover);
155 }
156 }
157 }
158 }
159}
0160
=== modified file 'calendar.qml'
--- calendar.qml 2013-03-27 23:36:18 +0000
+++ calendar.qml 2013-03-29 23:18:19 +0000
@@ -1,5 +1,6 @@
1import QtQuick 2.01import QtQuick 2.0
2import Ubuntu.Components 0.12import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
34
4MainView {5MainView {
5 id: mainView6 id: mainView
@@ -9,26 +10,43 @@
910
10 width: units.gu(45)11 width: units.gu(45)
11 height: units.gu(80)12 height: units.gu(80)
12 // FIXME: 80/45 = aspect ration of Galaxy Nexus
1313
14 Tabs { // preliminary HACK, needs rewrite when NewTabBar is finalized!14 Tabs {
15 id: tabs15 id: tabs
16 anchors.fill: parent16 anchors.fill: parent
1717
18 Tab { id: pageArea; title: i18n.tr("January"); page: Item { anchors.fill: parent } }18 Tab { title: Qt.locale(i18n.language).monthName(0) }
19 Tab { title: i18n.tr("February") }19 Tab { title: Qt.locale(i18n.language).monthName(1) }
20 Tab { title: i18n.tr("March") }20 Tab { title: Qt.locale(i18n.language).monthName(2) }
21 Tab { title: i18n.tr("April") }21 Tab { title: Qt.locale(i18n.language).monthName(3) }
22 Tab { title: i18n.tr("May") }22 Tab { title: Qt.locale(i18n.language).monthName(4) }
23 Tab { title: i18n.tr("June") }23 Tab { title: Qt.locale(i18n.language).monthName(5) }
24 Tab { title: i18n.tr("July") }24 Tab { title: Qt.locale(i18n.language).monthName(6) }
25 Tab { title: i18n.tr("August") }25 Tab { title: Qt.locale(i18n.language).monthName(7) }
26 Tab { title: i18n.tr("September") }26 Tab { title: Qt.locale(i18n.language).monthName(8) }
27 Tab { title: i18n.tr("October") }27 Tab { title: Qt.locale(i18n.language).monthName(9) }
28 Tab { title: i18n.tr("November") }28 Tab { title: Qt.locale(i18n.language).monthName(10) }
29 Tab { title: i18n.tr("December") }29 Tab { title: Qt.locale(i18n.language).monthName(11) }
3030
31 onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex)31 onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex)
32
33 tools: ToolbarActions {
34 Action {
35 iconSource: Qt.resolvedUrl("avatar.png")
36 text: i18n.tr("To-do")
37 onTriggered:; // FIXME
38 }
39 Action {
40 iconSource: Qt.resolvedUrl("avatar.png")
41 text: i18n.tr("New Event")
42 onTriggered: mainView.newEvent()
43 }
44 Action {
45 iconSource: Qt.resolvedUrl("avatar.png")
46 text: i18n.tr("Timeline")
47 onTriggered:; // FIXME
48 }
49 }
32 }50 }
3351
34 Rectangle {52 Rectangle {
@@ -39,7 +57,7 @@
39 MonthView {57 MonthView {
40 id: monthView58 id: monthView
41 onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth()59 onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth()
42 y: pageArea.y60 y: units.gu(9.5) // FIXME
43 onMovementEnded: eventView.currentDayStart = currentDayStart61 onMovementEnded: eventView.currentDayStart = currentDayStart
44 onCurrentDayStartChanged: if (!(dragging || flicking)) eventView.currentDayStart = currentDayStart62 onCurrentDayStartChanged: if (!(dragging || flicking)) eventView.currentDayStart = currentDayStart
45 Component.onCompleted: eventView.currentDayStart = currentDayStart63 Component.onCompleted: eventView.currentDayStart = currentDayStart
@@ -48,8 +66,8 @@
48 EventView {66 EventView {
49 id: eventView67 id: eventView
5068
51 property real minY: pageArea.y + monthView.compressedHeight69 property real minY: monthView.y + monthView.compressedHeight
52 property real maxY: pageArea.y + monthView.expandedHeight70 property real maxY: monthView.y + monthView.expandedHeight
5371
54 y: maxY72 y: maxY
55 width: mainView.width73 width: mainView.width
@@ -77,23 +95,15 @@
77 enabled: false95 enabled: false
78 NumberAnimation { duration: 100 }96 NumberAnimation { duration: 100 }
79 }97 }
98
99 onNewEvent: mainView.newEvent()
80 }100 }
81101
82 tools: ToolbarActions {102 signal newEvent
83 Action {103 onNewEvent: PopupUtils.open(newEventComponent, mainView, {"defaultDate": monthView.currentDayStart})
84 iconSource: Qt.resolvedUrl("avatar.png")104
85 text: i18n.tr("To-do")105 Component {
86 onTriggered:; // FIXME106 id: newEventComponent
87 }107 NewEvent {}
88 Action {
89 iconSource: Qt.resolvedUrl("avatar.png")
90 text: i18n.tr("New Event")
91 onTriggered:; // FIXME
92 }
93 Action {
94 iconSource: Qt.resolvedUrl("avatar.png")
95 text: i18n.tr("Timeline")
96 onTriggered:; // FIXME
97 }
98 }108 }
99}109}
100110
=== modified file 'testrun.sh'
--- testrun.sh 2013-03-06 18:35:00 +0000
+++ testrun.sh 2013-03-29 23:18:19 +0000
@@ -1,4 +1,4 @@
1#! /bin/bash -ex1#! /bin/bash -ex
22
3rsync -aHv ./ phablet@nexus:/tmp/Calendar/3rsync -aHv ./ phablet@nexus:/tmp/Calendar/
4ssh -t phablet@nexus 'cd /tmp/Calendar && GRID_UNIT_PX=18 qmlscene --desktop_file_hint=$PWD/Calendar.desktop $PWD/calendar.qml'4ssh -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: