Merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/revamp-newevent-page into lp:ubuntu-calendar-app
- revamp-newevent-page
- Merge into trunk
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Nekhelesh Ramananthan | ||||||||||||
Approved revision: | 425 | ||||||||||||
Merged at revision: | 441 | ||||||||||||
Proposed branch: | lp:~ubuntu-calendar-dev/ubuntu-calendar-app/revamp-newevent-page | ||||||||||||
Merge into: | lp:ubuntu-calendar-app | ||||||||||||
Diff against target: |
1445 lines (+774/-434) 8 files modified
EventReminder.qml (+85/-0) EventRepetition.qml (+246/-0) EventUtils.qml (+103/-0) NewEvent.qml (+308/-422) NewEventEntryField.qml (+17/-3) RecurrenceLabelDefines.qml (+7/-5) calendar.qml (+1/-1) tests/autopilot/calendar_app/__init__.py (+7/-3) |
||||||||||||
To merge this branch: | bzr merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/revamp-newevent-page | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Nekhelesh Ramananthan | Approve | ||
Alan Pope πΊπ§π± π¦ (community) | Approve | ||
Kunal Parmar | Needs Fixing | ||
Nicholas Skaggs (community) | Needs Fixing | ||
Review via email: mp+233414@code.launchpad.net |
Commit message
Redesigned New Event Page.
Description of the change
Redesigned New Event Page.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Nekhelesh Ramananthan (nik90) wrote : | # |
Added some inline comments.
Nekhelesh Ramananthan (nik90) wrote : | # |
I did a rather quick code review. I still need to to do an extensive code review + testing on device. But I can only do that tomorrow. But please do not merge before that.
Also kunal needs to approve as well!
Nicholas Skaggs (nskaggs) wrote : | # |
This will need re-merged with trunk.
Kunal Parmar (pkunal-parmar) wrote : | # |
gone through briefly, added few comments
Kunal Parmar (pkunal-parmar) wrote : | # |
i need to test it also
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:420
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 421. By Mihir Soni
-
review comments incorporated
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:421
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 422. By Mihir Soni
-
removed emulators.py file
- 423. By Mihir Soni
-
Modified test cases with referece to balloons change
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:422
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:423
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
LGTM!
- 424. By Nekhelesh Ramananthan
-
merged trunk
- 425. By Nekhelesh Ramananthan
-
Reverted accidental change to manifest file
Nekhelesh Ramananthan (nik90) wrote : | # |
lgtm! Tested on device and works as expected!
Nekhelesh Ramananthan (nik90) wrote : | # |
> This will need re-merged with trunk.
Done
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:425
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === added file 'EventReminder.qml' |
2 | --- EventReminder.qml 1970-01-01 00:00:00 +0000 |
3 | +++ EventReminder.qml 2014-09-09 10:47:16 +0000 |
4 | @@ -0,0 +1,85 @@ |
5 | +/* |
6 | + * Copyright (C) 2014 Canonical Ltd |
7 | + * |
8 | + * This file is part of Ubuntu Calendar App |
9 | + * |
10 | + * Ubuntu Calendar App is free software: you can redistribute it and/or modify |
11 | + * it under the terms of the GNU General Public License version 3 as |
12 | + * published by the Free Software Foundation. |
13 | + * |
14 | + * Ubuntu Calendar App is distributed in the hope that it will be useful, |
15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | + * GNU General Public License for more details. |
18 | + * |
19 | + * You should have received a copy of the GNU General Public License |
20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
21 | + */ |
22 | + |
23 | +import QtQuick 2.3 |
24 | +import QtOrganizer 5.0 |
25 | +import Ubuntu.Components 1.1 |
26 | +import Ubuntu.Components.ListItems 1.0 as ListItem |
27 | +import Ubuntu.Components.Pickers 1.0 |
28 | +import QtOrganizer 5.0 |
29 | +import "Defines.js" as Defines |
30 | + |
31 | +Page{ |
32 | + id:root |
33 | + objectName: "eventReminder" |
34 | + |
35 | + property var visualReminder :null |
36 | + property var audibleReminder :null |
37 | + property var eventTitle: null |
38 | + |
39 | + |
40 | + visible: false |
41 | + title: i18n.tr("Reminder") |
42 | + |
43 | + Component.onCompleted: { |
44 | + var reminderTime = visualReminder.secondsBeforeStart; |
45 | + var foundIndex = Defines.reminderValue.indexOf(reminderTime); |
46 | + reminderOption.selectedIndex = foundIndex != -1 ? foundIndex : 0; |
47 | + |
48 | + } |
49 | + |
50 | + head.backAction: Action{ |
51 | + id:backAction |
52 | + iconName:"back" |
53 | + onTriggered:{ |
54 | + var reminderTime = Defines.reminderValue[reminderOption.selectedIndex] |
55 | + if(reminderTime!== 0){ |
56 | + visualReminder.repetitionCount = 3; |
57 | + visualReminder.repetitionDelay = 120; |
58 | + visualReminder.message = eventTitle |
59 | + visualReminder.secondsBeforeStart = reminderTime; |
60 | + |
61 | + audibleReminder.repetitionCount = 3; |
62 | + audibleReminder.repetitionDelay = 120; |
63 | + audibleReminder.secondsBeforeStart = reminderTime; |
64 | + } |
65 | + pop(); |
66 | + } |
67 | + } |
68 | + |
69 | + Column{ |
70 | + id:reminder |
71 | + anchors.fill: parent |
72 | + spacing: units.gu(1) |
73 | + |
74 | + ListItem.Header{ |
75 | + text: i18n.tr("Reminder") |
76 | + } |
77 | + OptionSelector{ |
78 | + id: reminderOption |
79 | + objectName: "reminderOptions" |
80 | + anchors { |
81 | + left: parent.left |
82 | + right: parent.right |
83 | + margins: units.gu(2) |
84 | + } |
85 | + containerHeight: itemHeight * 4 |
86 | + model: Defines.reminderLabel |
87 | + } |
88 | + } |
89 | +} |
90 | |
91 | === added file 'EventRepetition.qml' |
92 | --- EventRepetition.qml 1970-01-01 00:00:00 +0000 |
93 | +++ EventRepetition.qml 2014-09-09 10:47:16 +0000 |
94 | @@ -0,0 +1,246 @@ |
95 | +/* |
96 | + * Copyright (C) 2014 Canonical Ltd |
97 | + * |
98 | + * This file is part of Ubuntu Calendar App |
99 | + * |
100 | + * Ubuntu Calendar App is free software: you can redistribute it and/or modify |
101 | + * it under the terms of the GNU General Public License version 3 as |
102 | + * published by the Free Software Foundation. |
103 | + * |
104 | + * Ubuntu Calendar App is distributed in the hope that it will be useful, |
105 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
106 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
107 | + * GNU General Public License for more details. |
108 | + * |
109 | + * You should have received a copy of the GNU General Public License |
110 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
111 | + */ |
112 | + |
113 | +import QtQuick 2.3 |
114 | +import QtOrganizer 5.0 |
115 | +import Ubuntu.Components 1.1 |
116 | +import Ubuntu.Components.ListItems 1.0 as ListItem |
117 | +import Ubuntu.Components.Pickers 1.0 |
118 | +import QtOrganizer 5.0 |
119 | +import "Defines.js" as Defines |
120 | + |
121 | +Page { |
122 | + id: repetition |
123 | + |
124 | + property var weekDays : []; |
125 | + property var rule |
126 | + property var date |
127 | + property var isEdit |
128 | + |
129 | + visible: false |
130 | + title: i18n.tr("Repeat") |
131 | + |
132 | + EventUtils{ |
133 | + id:eventUtils |
134 | + } |
135 | + |
136 | + Component.onCompleted: { |
137 | + //Fill Date & limitcount if any |
138 | + var index = 0; |
139 | + if(rule !== null && rule !== undefined){ |
140 | + index = rule.frequency ; |
141 | + if(index > 0 ) |
142 | + { |
143 | + if(rule.limit !== undefined){ |
144 | + var temp = rule.limit; |
145 | + if(parseInt(temp)){ |
146 | + limitOptions.selectedIndex = 1; |
147 | + limitCount.text = temp; |
148 | + } |
149 | + else{ |
150 | + limitOptions.selectedIndex = 2; |
151 | + datePick.date= temp; |
152 | + } |
153 | + } |
154 | + else{ |
155 | + // If limit is infinite |
156 | + limitOptions.selectedIndex = 0; |
157 | + } |
158 | + switch(index){ |
159 | + case RecurrenceRule.Weekly: |
160 | + index = eventUtils.getWeekDaysIndex(rule.daysOfWeek.sort()); |
161 | + if(rule.daysOfWeek.length>0 && index === 5){ |
162 | + for(var j = 0;j<rule.daysOfWeek.length;++j){ |
163 | + //Start childern after first element. |
164 | + weeksRow.children[rule.daysOfWeek[j] === 7 ? 0 :rule.daysOfWeek[j]].children[1].checked = true; |
165 | + } |
166 | + } |
167 | + break; |
168 | + case RecurrenceRule.Monthly: |
169 | + index = 6 |
170 | + break; |
171 | + case RecurrenceRule.Yearly: |
172 | + index = 7 |
173 | + break; |
174 | + } |
175 | + |
176 | + } |
177 | + } |
178 | + recurrenceOption.selectedIndex = index; |
179 | + } |
180 | + |
181 | + head.backAction: Action{ |
182 | + id:backAction |
183 | + iconName: "back" |
184 | + onTriggered: { |
185 | + var recurrenceRule = Defines.recurrenceValue[ recurrenceOption.selectedIndex ]; |
186 | + if( recurrenceRule !== RecurrenceRule.Invalid ) { |
187 | + rule.frequency = recurrenceRule; |
188 | + if(limitOptions.selectedIndex > 0) { |
189 | + rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex,weekDays ); |
190 | + if(limitOptions.selectedIndex === 1 && recurrenceOption.selectedIndex > 0){ |
191 | + rule.limit = parseInt(limitCount.text); |
192 | + } |
193 | + else if(limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0){ |
194 | + rule.limit = datePick.date; |
195 | + } |
196 | + else{ |
197 | + rule.limit = undefined; |
198 | + } |
199 | + } |
200 | + } |
201 | + else{ |
202 | + rule.frequency = 0 |
203 | + } |
204 | + pop() |
205 | + } |
206 | + } |
207 | + |
208 | + Column{ |
209 | + id:repeatColumn |
210 | + |
211 | + anchors.fill: parent |
212 | + spacing: units.gu(1) |
213 | + |
214 | + ListItem.Header{ |
215 | + text: i18n.tr("Repeat") |
216 | + } |
217 | + |
218 | + OptionSelector{ |
219 | + id: recurrenceOption |
220 | + visible: true |
221 | + |
222 | + anchors { |
223 | + left: parent.left |
224 | + right: parent.right |
225 | + margins: units.gu(2) |
226 | + } |
227 | + |
228 | + model: Defines.recurrenceLabel |
229 | + containerHeight: itemHeight * 4 |
230 | + onExpandedChanged: Qt.inputMethod.hide(); |
231 | + } |
232 | + |
233 | + ListItem.Header{ |
234 | + text: i18n.tr("Repeats On:") |
235 | + visible: recurrenceOption.selectedIndex == 5 |
236 | + } |
237 | + |
238 | + Row { |
239 | + id: weeksRow |
240 | + |
241 | + anchors { |
242 | + left: parent.left |
243 | + right: parent.right |
244 | + margins: units.gu(2) |
245 | + } |
246 | + |
247 | + spacing: units.gu(1) |
248 | + visible: recurrenceOption.selectedIndex == 5 |
249 | + |
250 | + Repeater { |
251 | + model: Defines.weekLabel |
252 | + Column { |
253 | + id: weeksRowColumn |
254 | + spacing: units.gu(1) |
255 | + Label { |
256 | + id:lbl |
257 | + text:modelData |
258 | + anchors.horizontalCenter: parent.horizontalCenter |
259 | + } |
260 | + CheckBox { |
261 | + id: weekCheck |
262 | + onCheckedChanged: { |
263 | + //EDS consider 7 as Sunday index so if the index is 0 then we have to explicitly push Sunday. |
264 | + if(index === 0) |
265 | + (checked) ? weekDays.push(Qt.Sunday) : weekDays.splice(weekDays.indexOf(Qt.Sunday),1); |
266 | + else |
267 | + (checked) ? weekDays.push(index) : weekDays.splice(weekDays.indexOf(index),1); |
268 | + } |
269 | + checked:{ |
270 | + (weekDays.length === 0 && index === date.getDay() && isEdit === false) ? true : false; |
271 | + } |
272 | + |
273 | + } |
274 | + } |
275 | + } |
276 | + } |
277 | + |
278 | + ListItem.Header { |
279 | + text: i18n.tr("Recurring event ends") |
280 | + visible: recurrenceOption.selectedIndex != 0 |
281 | + } |
282 | + |
283 | + OptionSelector{ |
284 | + id: limitOptions |
285 | + visible: recurrenceOption.selectedIndex != 0 |
286 | + |
287 | + anchors { |
288 | + left: parent.left |
289 | + right: parent.right |
290 | + margins: units.gu(2) |
291 | + } |
292 | + |
293 | + model: Defines.limitLabel |
294 | + containerHeight: itemHeight * 4 |
295 | + onExpandedChanged: Qt.inputMethod.hide() |
296 | + } |
297 | + |
298 | + ListItem.Header{ |
299 | + text:i18n.tr("Recurrences") |
300 | + visible: recurrenceOption.selectedIndex != 0 |
301 | + && limitOptions.selectedIndex == 1 |
302 | + } |
303 | + |
304 | + TextField { |
305 | + id: limitCount |
306 | + objectName: "eventLimitCount" |
307 | + |
308 | + anchors { |
309 | + left: parent.left |
310 | + right: parent.right |
311 | + margins: units.gu(2) |
312 | + } |
313 | + |
314 | + visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex == 1 |
315 | + validator: IntValidator{ bottom: 1; } |
316 | + inputMethodHints: Qt.ImhDialableCharactersOnly |
317 | + |
318 | + onTextChanged: { |
319 | + backAction.enabled = !!text.trim() |
320 | + } |
321 | + } |
322 | + |
323 | + ListItem.Header{ |
324 | + text:i18n.tr("Date") |
325 | + visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex == 2 |
326 | + } |
327 | + |
328 | + DatePicker{ |
329 | + id:datePick; |
330 | + |
331 | + anchors { |
332 | + left: parent.left |
333 | + right: parent.right |
334 | + margins: units.gu(2) |
335 | + } |
336 | + |
337 | + visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex===2 |
338 | + } |
339 | + } |
340 | +} |
341 | |
342 | === added file 'EventUtils.qml' |
343 | --- EventUtils.qml 1970-01-01 00:00:00 +0000 |
344 | +++ EventUtils.qml 2014-09-09 10:47:16 +0000 |
345 | @@ -0,0 +1,103 @@ |
346 | +/* |
347 | + * Copyright (C) 2013-2014 Canonical Ltd |
348 | + * |
349 | + * This file is part of Ubuntu Calendar App |
350 | + * |
351 | + * Ubuntu Calendar App is free software: you can redistribute it and/or modify |
352 | + * it under the terms of the GNU General Public License version 3 as |
353 | + * published by the Free Software Foundation. |
354 | + * |
355 | + * Ubuntu Calendar App is distributed in the hope that it will be useful, |
356 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
357 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
358 | + * GNU General Public License for more details. |
359 | + * |
360 | + * You should have received a copy of the GNU General Public License |
361 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
362 | + */ |
363 | + |
364 | +import QtQuick 2.3 |
365 | +import Ubuntu.Components 1.1 |
366 | +import QtOrganizer 5.0 |
367 | +import "Defines.js" as Defines |
368 | + |
369 | + |
370 | +QtObject{ |
371 | + id:eventUtil |
372 | + function getWeekDaysIndex(daysOfWeek){ |
373 | + var index = 0; |
374 | + if(compareArrays(daysOfWeek,[Qt.Monday,Qt.Tuesday,Qt.Wednesday,Qt.Thursday,Qt.Friday])) |
375 | + index = 2 |
376 | + else if(compareArrays(daysOfWeek,[Qt.Monday,Qt.Wednesday,Qt.Friday])) |
377 | + index = 3 |
378 | + else if(compareArrays(daysOfWeek,[Qt.Tuesday,Qt.Thursday])) |
379 | + index = 4 |
380 | + else |
381 | + index = 5 |
382 | + return index; |
383 | + } |
384 | + |
385 | + function compareArrays(daysOfWeek, actualArray){ |
386 | + if (daysOfWeek.length !== actualArray.length) return false; |
387 | + for (var i = 0; i < actualArray.length; i++) { |
388 | + if (daysOfWeek[i] !== actualArray[i]) return false; |
389 | + } |
390 | + return true; |
391 | + } |
392 | + function getDaysOfWeek(index,weekDays){ |
393 | + var daysOfWeek = []; |
394 | + switch(index){ |
395 | + case 2: |
396 | + daysOfWeek = [Qt.Monday,Qt.Tuesday,Qt.Wednesday,Qt.Thursday,Qt.Friday]; |
397 | + break; |
398 | + case 3: |
399 | + daysOfWeek = [Qt.Monday,Qt.Wednesday,Qt.Friday]; |
400 | + break; |
401 | + case 4: |
402 | + daysOfWeek = [Qt.Tuesday,Qt.Thursday]; |
403 | + break; |
404 | + case 5: |
405 | + daysOfWeek = weekDays.length === 0 ? [date.getDay()] : weekDays; |
406 | + break; |
407 | + } |
408 | + return daysOfWeek; |
409 | + } |
410 | + //Function to get Weeknames in narrow Format |
411 | + function getDays(daysOfWeek) { |
412 | + var days = [] |
413 | + for(var j = 0;j<daysOfWeek.length;++j){ |
414 | + //push all days |
415 | + days.push(Qt.locale().dayName(j,Locale.NarrowFormat)) |
416 | + } |
417 | + days = days.join(', '); |
418 | + return days; |
419 | + } |
420 | + |
421 | + function getRecurrenceString(rule){ |
422 | + |
423 | + var index; |
424 | + var reccurence = ""; |
425 | + var limit,str = ""; |
426 | + var dateFormat = i18n.tr("ddd MMMM d yyyy"); |
427 | + index = rule.frequency; |
428 | + if(index === RecurrenceRule.Weekly){ |
429 | + index = getWeekDaysIndex(rule.daysOfWeek.sort() ) |
430 | + reccurence = "Weekly " |
431 | + if(index === 5){ |
432 | + reccurence += "on " + getDays(rule.daysOfWeek.sort()) |
433 | + } |
434 | + } |
435 | + else if(index === RecurrenceRule.Monthly) |
436 | + index = 6 |
437 | + else if(index === RecurrenceRule.Yearly) |
438 | + index = 7 |
439 | + if(index !==5) |
440 | + reccurence += Defines.recurrenceLabel[index] |
441 | + |
442 | + str = (rule.limit === undefined) ? i18n.tr(reccurence) : |
443 | + (rule.limit !== undefined && parseInt(rule.limit)) ? |
444 | + i18n.tr("%1 ; %2 times ").arg(reccurence).arg(rule.limit) : |
445 | + i18n.tr("%1 ; until %2").arg(reccurence).arg(rule.limit.toLocaleString(Qt.locale(), dateFormat)) |
446 | + return str; |
447 | + } |
448 | +} |
449 | |
450 | === modified file 'NewEvent.qml' |
451 | --- NewEvent.qml 2014-09-06 18:17:28 +0000 |
452 | +++ NewEvent.qml 2014-09-09 10:47:16 +0000 |
453 | @@ -20,24 +20,23 @@ |
454 | import QtOrganizer 5.0 |
455 | import Ubuntu.Components 1.1 |
456 | import Ubuntu.Components.Popups 1.0 |
457 | -import Ubuntu.Components.ListItems 1.0 |
458 | +import Ubuntu.Components.ListItems 1.0 as ListItem |
459 | import Ubuntu.Components.Themes.Ambiance 1.0 |
460 | -import Ubuntu.Components.Pickers 1.0 |
461 | import QtOrganizer 5.0 |
462 | - |
463 | import "Defines.js" as Defines |
464 | |
465 | Page { |
466 | id: root |
467 | objectName: 'newEventPage' |
468 | + |
469 | property var date; |
470 | |
471 | property var event:null; |
472 | + property var rule :null; |
473 | property var model; |
474 | |
475 | property var startDate; |
476 | property var endDate; |
477 | - property int optionSelectorWidth: frequencyLabel.width > remindLabel.width ? frequencyLabel.width : remindLabel.width |
478 | |
479 | property alias scrollY: flickable.contentY |
480 | property bool isEdit: false |
481 | @@ -92,8 +91,8 @@ |
482 | if(event === null){ |
483 | isEdit = false; |
484 | addEvent(); |
485 | - titleEdit.forceActiveFocus(); |
486 | } |
487 | + |
488 | else{ |
489 | isEdit = true; |
490 | editEvent(event); |
491 | @@ -114,10 +113,18 @@ |
492 | //Data for Add events |
493 | function addEvent() { |
494 | event = Qt.createQmlObject("import QtOrganizer 5.0; Event { }", Qt.application,"NewEvent.qml"); |
495 | + //Create fresh Recurrence Object. |
496 | + rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence,"EventRepetition.qml"); |
497 | selectCalendar(model.defaultCollection().collectionId); |
498 | } |
499 | + |
500 | //Editing Event |
501 | function editEvent(e) { |
502 | + //If there is a ReccruenceRule use that , else create fresh Recurrence Object. |
503 | + rule = (e.recurrence.recurrenceRules[0] === undefined || e.recurrence.recurrenceRules[0] === null) ? |
504 | + Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence,"EventRepetition.qml") |
505 | + : e.recurrence.recurrenceRules[0]; |
506 | + |
507 | startDate =new Date(e.startDateTime); |
508 | endDate = new Date(e.endDateTime); |
509 | |
510 | @@ -146,74 +153,14 @@ |
511 | contactModel.append(e.attendees[j]); |
512 | } |
513 | } |
514 | - |
515 | - index = 0; |
516 | - if(e.recurrence ) { |
517 | - var recurrenceRule = e.recurrence.recurrenceRules; |
518 | - index = ( recurrenceRule.length > 0 ) ? recurrenceRule[0].frequency : 0; |
519 | - if(index > 0 ) |
520 | - { |
521 | - limit.visible = true; |
522 | - if(recurrenceRule[0].limit !== undefined){ |
523 | - var temp = recurrenceRule[0].limit; |
524 | - if(parseInt(temp)){ |
525 | - limitOptions.selectedIndex = 1; |
526 | - limitCount.text = temp; |
527 | - } |
528 | - else{ |
529 | - limitOptions.selectedIndex = 2; |
530 | - datePick.date= temp; |
531 | - } |
532 | - } |
533 | - else{ |
534 | - // If limit is infinite |
535 | - limitOptions.selectedIndex = 0; |
536 | - } |
537 | - if(index === RecurrenceRule.Weekly){ |
538 | - index = getWeekDaysIndex(recurrenceRule[0].daysOfWeek.sort()); |
539 | - } |
540 | - if(recurrenceRule[0].daysOfWeek.length>0 && index === 5){ |
541 | - for(var j = 0;j<recurrenceRule[0].daysOfWeek.length;++j){ |
542 | - //Start childern after first element. |
543 | - weeksRow.children[recurrenceRule[0].daysOfWeek[j] === 7 ? 0 :recurrenceRule[0].daysOfWeek[j]].children[1].checked = true; |
544 | - } |
545 | - } |
546 | - } |
547 | - } |
548 | - recurrenceOption.selectedIndex = index; |
549 | } |
550 | - |
551 | - index = 0; |
552 | var reminder = e.detail( Detail.VisualReminder); |
553 | if( reminder ) { |
554 | - var reminderTime = reminder.secondsBeforeStart; |
555 | - var foundIndex = Defines.reminderValue.indexOf(reminderTime); |
556 | - index = foundIndex != -1 ? foundIndex : 0; |
557 | + visualReminder.secondsBeforeStart = reminder.secondsBeforeStart; |
558 | + |
559 | } |
560 | - reminderOption.selectedIndex = index; |
561 | - |
562 | selectCalendar(e.collectionId); |
563 | } |
564 | - function getWeekDaysIndex(daysOfWeek){ |
565 | - var index = 0; |
566 | - if(compareArrays(daysOfWeek,[Qt.Monday,Qt.Tuesday,Qt.Wednesday,Qt.Thursday,Qt.Friday])) |
567 | - index = 2 |
568 | - else if(compareArrays(daysOfWeek,[Qt.Monday,Qt.Wednesday,Qt.Friday])) |
569 | - index = 3 |
570 | - else if(compareArrays(daysOfWeek,[Qt.Tuesday,Qt.Thursday])) |
571 | - index = 4 |
572 | - else |
573 | - index = 5 |
574 | - return index; |
575 | - } |
576 | - |
577 | - function compareArrays(daysOfWeek, actualArray){ |
578 | - if (daysOfWeek.length !== actualArray.length) return false; |
579 | - for (var i = 0; i < actualArray.length; i++) { |
580 | - if (daysOfWeek[i] !== actualArray[i]) return false; |
581 | - } |
582 | - return true; |
583 | - } |
584 | //Save the new or Existing event |
585 | function saveToQtPim() { |
586 | internal.clearFocus() |
587 | @@ -236,25 +183,10 @@ |
588 | contacts.push(contact); |
589 | } |
590 | event.attendees = contacts; |
591 | - |
592 | - var recurrenceRule = Defines.recurrenceValue[ recurrenceOption.selectedIndex ]; |
593 | - var rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence,"NewEvent.qml"); |
594 | - if( recurrenceRule !== RecurrenceRule.Invalid ) { |
595 | - rule.frequency = recurrenceRule; |
596 | - rule.daysOfWeek = getDaysOfWeek(); |
597 | - if(limitOptions.selectedIndex === 1 && recurrenceOption.selectedIndex > 0){ |
598 | - rule.limit = parseInt(limitCount.text); |
599 | - } |
600 | - else if(limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0){ |
601 | - rule.limit = datePick.date; |
602 | - } |
603 | - else{ |
604 | - rule.limit = undefined; |
605 | - } |
606 | - } |
607 | - event.recurrence.recurrenceRules = [rule]; |
608 | } |
609 | - |
610 | + //Set the Rule object to an event |
611 | + if(rule !== null && rule !== undefined) |
612 | + event.recurrence.recurrenceRules= [rule] |
613 | //remove old reminder value |
614 | var oldVisualReminder = event.detail(Detail.VisualReminder); |
615 | if(oldVisualReminder) { |
616 | @@ -265,22 +197,8 @@ |
617 | if(oldAudibleReminder) { |
618 | event.removeDetail(oldAudibleReminder); |
619 | } |
620 | - |
621 | - var reminderTime = Defines.reminderValue[ reminderOption.selectedIndex ]; |
622 | - if( reminderTime !== 0 ) { |
623 | - var visualReminder = Qt.createQmlObject("import QtOrganizer 5.0; VisualReminder{}", event, "NewEvent.qml"); |
624 | - visualReminder.repetitionCount = 3; |
625 | - visualReminder.repetitionDelay = 120; |
626 | - visualReminder.message = titleEdit.text |
627 | - visualReminder.secondsBeforeStart = reminderTime; |
628 | - event.setDetail(visualReminder); |
629 | - |
630 | - var audibleReminder = Qt.createQmlObject("import QtOrganizer 5.0; AudibleReminder{}", event, "NewEvent.qml"); |
631 | - audibleReminder.repetitionCount = 3; |
632 | - audibleReminder.repetitionDelay = 120; |
633 | - audibleReminder.secondsBeforeStart = reminderTime; |
634 | - event.setDetail(audibleReminder); |
635 | - } |
636 | + event.setDetail(visualReminder); |
637 | + event.setDetail(audibleReminder); |
638 | |
639 | event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId; |
640 | model.saveItem(event); |
641 | @@ -288,6 +206,13 @@ |
642 | } |
643 | } |
644 | |
645 | + VisualReminder{ |
646 | + id:visualReminder |
647 | + } |
648 | + AudibleReminder{ |
649 | + id:audibleReminder |
650 | + } |
651 | + |
652 | function getDaysOfWeek(){ |
653 | var daysOfWeek = []; |
654 | switch(recurrenceOption.selectedIndex){ |
655 | @@ -359,12 +284,6 @@ |
656 | pageStack.pop(); |
657 | } |
658 | |
659 | - // we use a custom toolbar in this view |
660 | - tools: ToolbarItems { |
661 | - locked: true |
662 | - opened: false |
663 | - } |
664 | - |
665 | Component{ |
666 | id: errorDlgComponent |
667 | Dialog { |
668 | @@ -377,6 +296,10 @@ |
669 | } |
670 | } |
671 | |
672 | + EventUtils{ |
673 | + id:eventUtils |
674 | + } |
675 | + |
676 | Flickable{ |
677 | id: flickable |
678 | |
679 | @@ -409,120 +332,203 @@ |
680 | } |
681 | |
682 | anchors.fill: parent |
683 | - anchors.margins: units.gu(2) |
684 | - |
685 | contentWidth: width |
686 | - contentHeight: column.height |
687 | + contentHeight: column.height + units.gu(10) |
688 | |
689 | Column { |
690 | id: column |
691 | |
692 | width: parent.width |
693 | - spacing: units.gu(1) |
694 | - |
695 | - UbuntuShape { |
696 | - width:parent.width |
697 | - height: timeColumn.height |
698 | - |
699 | - Column{ |
700 | - id: timeColumn |
701 | - width: parent.width |
702 | - anchors.centerIn: parent |
703 | - spacing: units.gu(1) |
704 | - |
705 | - Item { |
706 | - width: parent.width |
707 | - height: startDateInput.height |
708 | - |
709 | - NewEventEntryField{ |
710 | - id: startDateInput |
711 | - title: i18n.tr("Start") |
712 | - objectName: "startDateInput" |
713 | - |
714 | - text: "" |
715 | - |
716 | - width: allDayEventCheckbox.checked ? parent.width : parent.width / 2 |
717 | - |
718 | - MouseArea{ |
719 | - anchors.fill: parent |
720 | - onClicked: openDatePicker(startDateInput, root, "startDate", "Years|Months|Days") |
721 | - } |
722 | - } |
723 | - |
724 | - NewEventEntryField{ |
725 | - id: startTimeInput |
726 | - // TRANSLATORS: This "at" refers to HH:MM of an event. E.g 1st January at 10:30 |
727 | - title: i18n.tr("at") |
728 | - objectName: "startTimeInput" |
729 | - |
730 | - text: "" |
731 | - |
732 | - width: (parent.width / 2) - units.gu(1) |
733 | - anchors.right: parent.right |
734 | - visible: !allDayEventCheckbox.checked |
735 | - |
736 | - MouseArea{ |
737 | - anchors.fill: parent |
738 | - onClicked: openDatePicker(startTimeInput, root, "startDate", "Hours|Minutes") |
739 | - } |
740 | - } |
741 | - } |
742 | - |
743 | - Item { |
744 | - width: parent.width |
745 | - height: endDateInput.height |
746 | - visible: !allDayEventCheckbox.checked |
747 | - |
748 | - NewEventEntryField{ |
749 | - id: endDateInput |
750 | - title: i18n.tr("End") |
751 | - objectName: "endDateInput" |
752 | - |
753 | - text: "" |
754 | - |
755 | - width: parent.width / 2 |
756 | - |
757 | - MouseArea{ |
758 | - anchors.fill: parent |
759 | - onClicked: openDatePicker(endDateInput, root, "endDate", "Years|Months|Days") |
760 | - } |
761 | - } |
762 | - |
763 | - NewEventEntryField{ |
764 | - id: endTimeInput |
765 | - // TRANSLATORS: This "at" refers to HH:MM of an event. E.g 1st January at 10:30 |
766 | - title: i18n.tr("at") |
767 | - objectName: "endTimeInput" |
768 | - text: "" |
769 | - width: (parent.width / 2) - units.gu(1) |
770 | - anchors.right: parent.right |
771 | - |
772 | - MouseArea{ |
773 | - anchors.fill: parent |
774 | - onClicked: openDatePicker(endTimeInput, root, "endDate", "Hours|Minutes") |
775 | - |
776 | - } |
777 | - } |
778 | - } |
779 | - } |
780 | - } |
781 | - |
782 | - Item{ |
783 | - width: parent.width |
784 | - height: calendarsOption.height |
785 | - Label{ |
786 | - id: calendarLabel |
787 | - text: i18n.tr("Calendar "); |
788 | - anchors.verticalCenter: parent.verticalCenter |
789 | + |
790 | + ListItem.Header { |
791 | + text: i18n.tr("From") |
792 | + } |
793 | + |
794 | + Item { |
795 | + anchors { |
796 | + left: parent.left |
797 | + right: parent.right |
798 | + margins: units.gu(2) |
799 | + } |
800 | + |
801 | + height: startDateInput.height |
802 | + |
803 | + NewEventEntryField{ |
804 | + id: startDateInput |
805 | + objectName: "startDateInput" |
806 | + |
807 | + title: i18n.tr("Date") |
808 | + text: "" |
809 | + |
810 | + anchors.left: parent.left |
811 | + width: allDayEventCheckbox.checked ? parent.width : parent.width / 2 |
812 | + |
813 | + MouseArea{ |
814 | + anchors.fill: parent |
815 | + onClicked: openDatePicker(startDateInput, root, "startDate", "Years|Months|Days") |
816 | + } |
817 | + } |
818 | + |
819 | + NewEventEntryField{ |
820 | + id: startTimeInput |
821 | + // TRANSLATORS: This "at" refers to HH:MM of an event. E.g 1st January at 10:30 |
822 | + title: i18n.tr("Time") |
823 | + objectName: "startTimeInput" |
824 | + |
825 | + text: "" |
826 | + |
827 | + anchors.right: parent.right |
828 | + width: (parent.width / 2) - units.gu(1) |
829 | + visible: !allDayEventCheckbox.checked |
830 | + |
831 | + MouseArea{ |
832 | + anchors.fill: parent |
833 | + onClicked: openDatePicker(startTimeInput, root, "startDate", "Hours|Minutes") |
834 | + } |
835 | + } |
836 | + } |
837 | + |
838 | + ListItem.ThinDivider { |
839 | + visible: !allDayEventCheckbox.checked |
840 | + } |
841 | + |
842 | + ListItem.Header { |
843 | + text: i18n.tr("To") |
844 | + visible: !allDayEventCheckbox.checked |
845 | + } |
846 | + |
847 | + Item { |
848 | + anchors { |
849 | + left: parent.left |
850 | + right: parent.right |
851 | + margins: units.gu(2) |
852 | + } |
853 | + |
854 | + height: endDateInput.height |
855 | + visible: !allDayEventCheckbox.checked |
856 | + |
857 | + NewEventEntryField{ |
858 | + id: endDateInput |
859 | + objectName: "endDateInput" |
860 | + |
861 | + title: i18n.tr("Date") |
862 | + text: "" |
863 | + |
864 | + anchors.left: parent.left |
865 | + width: parent.width / 2 |
866 | + |
867 | + MouseArea{ |
868 | + anchors.fill: parent |
869 | + onClicked: openDatePicker(endDateInput, root, "endDate", "Years|Months|Days") |
870 | + } |
871 | + } |
872 | + |
873 | + NewEventEntryField{ |
874 | + id: endTimeInput |
875 | + objectName: "endTimeInput" |
876 | + |
877 | + // TRANSLATORS: This "at" refers to HH:MM of an event. E.g 1st January at 10:30 |
878 | + title: i18n.tr("Time") |
879 | + text: "" |
880 | + |
881 | + width: (parent.width / 2) - units.gu(1) |
882 | + anchors.right: parent.right |
883 | + |
884 | + MouseArea{ |
885 | + anchors.fill: parent |
886 | + onClicked: openDatePicker(endTimeInput, root, "endDate", "Hours|Minutes") |
887 | + } |
888 | + } |
889 | + } |
890 | + |
891 | + ListItem.ThinDivider {} |
892 | + |
893 | + ListItem.Standard { |
894 | + anchors { |
895 | + left: parent.left |
896 | + right: parent.right |
897 | + leftMargin: units.gu(-1) |
898 | + } |
899 | + |
900 | + text: "All Day Event" |
901 | + showDivider: false |
902 | + control: CheckBox { |
903 | + id: allDayEventCheckbox |
904 | + checked: false |
905 | + } |
906 | + } |
907 | + |
908 | + ListItem.ThinDivider {} |
909 | + |
910 | + Column { |
911 | + width: parent.width |
912 | + spacing: units.gu(1) |
913 | + |
914 | + ListItem.Header{ |
915 | + text: i18n.tr("Event Details") |
916 | + } |
917 | + |
918 | + TextField { |
919 | + id: titleEdit |
920 | + objectName: "newEventName" |
921 | + |
922 | + anchors { |
923 | + left: parent.left |
924 | + right: parent.right |
925 | + margins: units.gu(2) |
926 | + } |
927 | + |
928 | + placeholderText: i18n.tr("Event Name") |
929 | + } |
930 | + |
931 | + TextArea{ |
932 | + id: messageEdit |
933 | + objectName: "eventDescriptionInput" |
934 | + |
935 | + anchors { |
936 | + left: parent.left |
937 | + right: parent.right |
938 | + margins: units.gu(2) |
939 | + } |
940 | + |
941 | + placeholderText: i18n.tr("Description") |
942 | + } |
943 | + |
944 | + TextField { |
945 | + id: locationEdit |
946 | + objectName: "eventLocationInput" |
947 | + |
948 | + anchors { |
949 | + left: parent.left |
950 | + right: parent.right |
951 | + margins: units.gu(2) |
952 | + } |
953 | + |
954 | + placeholderText: i18n.tr("Location") |
955 | + } |
956 | + } |
957 | + |
958 | + Column { |
959 | + width: parent.width |
960 | + spacing: units.gu(1) |
961 | + |
962 | + ListItem.Header { |
963 | + text: i18n.tr("Calendar") |
964 | } |
965 | |
966 | OptionSelector{ |
967 | id: calendarsOption |
968 | objectName: "calendarsOption" |
969 | - anchors.right: parent.right |
970 | - width: parent.width - calendarLabel.width - units.gu(1) |
971 | + |
972 | + anchors { |
973 | + left: parent.left |
974 | + right: parent.right |
975 | + margins: units.gu(2) |
976 | + } |
977 | + |
978 | containerHeight: itemHeight * 4 |
979 | model: root.model.getCollections(); |
980 | + |
981 | delegate: OptionSelectorDelegate{ |
982 | text: modelData.name |
983 | |
984 | @@ -532,7 +538,7 @@ |
985 | height: parent.height - units.gu(2) |
986 | color: modelData.color |
987 | anchors.right: parent.right |
988 | - anchors.rightMargin: units.gu(1) |
989 | + anchors.rightMargin: units.gu(2) |
990 | anchors.verticalCenter: parent.verticalCenter |
991 | } |
992 | } |
993 | @@ -540,230 +546,111 @@ |
994 | } |
995 | } |
996 | |
997 | - Row { |
998 | - width: parent.width |
999 | - spacing: units.gu(1) |
1000 | - anchors.margins: units.gu(0.5) |
1001 | - |
1002 | - Label { |
1003 | - text: i18n.tr("All Day event:") |
1004 | - anchors.verticalCenter: allDayEventCheckbox.verticalCenter |
1005 | - } |
1006 | - |
1007 | - CheckBox { |
1008 | - id: allDayEventCheckbox |
1009 | - checked: false |
1010 | - } |
1011 | - } |
1012 | - |
1013 | - ThinDivider{} |
1014 | - |
1015 | - NewEventEntryField{ |
1016 | - id: titleEdit |
1017 | - width: parent.width |
1018 | - title: i18n.tr("Event Name") |
1019 | - objectName: "newEventName" |
1020 | - } |
1021 | - |
1022 | - Column{ |
1023 | - id: descriptionColumn |
1024 | - width: parent.width |
1025 | - spacing: units.gu(1) |
1026 | - |
1027 | - Label { |
1028 | - text: i18n.tr("Description") |
1029 | - anchors.margins: units.gu(0.5) |
1030 | - anchors.left: parent.left |
1031 | - } |
1032 | - |
1033 | - TextArea{ |
1034 | - id: messageEdit |
1035 | - objectName: "eventDescriptionInput" |
1036 | - width: parent.width |
1037 | - color: focus ? "#2C001E" : "#5D5D5D" |
1038 | - // default style |
1039 | - font { |
1040 | - pixelSize: focus ? FontUtils.sizeToPixels("large") : FontUtils.sizeToPixels("medium") |
1041 | - } |
1042 | - } |
1043 | - } |
1044 | - |
1045 | - NewEventEntryField{ |
1046 | - id: locationEdit |
1047 | - width: parent.width |
1048 | - title: i18n.tr("Location") |
1049 | - objectName: "eventLocationInput" |
1050 | - } |
1051 | - |
1052 | - UbuntuShape { |
1053 | - width: parent.width |
1054 | - height: contactList.height |
1055 | - Column{ |
1056 | - id: contactList |
1057 | - objectName: "guestList" |
1058 | - spacing: units.gu(1) |
1059 | - width: parent.width |
1060 | - clip: true |
1061 | - property var array: [] |
1062 | - ListModel{ |
1063 | - id: contactModel |
1064 | - } |
1065 | - Button{ |
1066 | - text: i18n.tr("Add Guest") |
1067 | - objectName: "addGuestButton" |
1068 | + Column { |
1069 | + width: parent.width |
1070 | + spacing: units.gu(1) |
1071 | + |
1072 | + ListItem.Header { |
1073 | + text: i18n.tr("Guests") |
1074 | + } |
1075 | + |
1076 | + Button{ |
1077 | + text: i18n.tr("Add Guest") |
1078 | + objectName: "addGuestButton" |
1079 | + |
1080 | + anchors { |
1081 | + left: parent.left |
1082 | + right: parent.right |
1083 | + margins: units.gu(2) |
1084 | + } |
1085 | + |
1086 | + onClicked: { |
1087 | + var popup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), contactList); |
1088 | + popup.contactSelected.connect( function(contact) { |
1089 | + var t = internal.contactToAttendee(contact); |
1090 | + if( !internal.isContactAlreadyAdded(contact) ) { |
1091 | + contactModel.append(t); |
1092 | + contactList.array.push(t); |
1093 | + } |
1094 | + }); |
1095 | + } |
1096 | + } |
1097 | + |
1098 | + UbuntuShape { |
1099 | + anchors { |
1100 | + left: parent.left |
1101 | + right: parent.right |
1102 | + margins: units.gu(2) |
1103 | + } |
1104 | + |
1105 | + height: contactList.height |
1106 | + |
1107 | + Column{ |
1108 | + id: contactList |
1109 | + objectName: "guestList" |
1110 | + |
1111 | + spacing: units.gu(1) |
1112 | width: parent.width |
1113 | - onClicked: { |
1114 | - var popup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), contactList); |
1115 | - popup.contactSelected.connect( function(contact) { |
1116 | - var t = internal.contactToAttendee(contact); |
1117 | - if( !internal.isContactAlreadyAdded(contact) ) { |
1118 | - contactModel.append(t); |
1119 | - contactList.array.push(t); |
1120 | - } |
1121 | - }); |
1122 | + clip: true |
1123 | + |
1124 | + property var array: [] |
1125 | + |
1126 | + ListModel{ |
1127 | + id: contactModel |
1128 | } |
1129 | - } |
1130 | |
1131 | - Repeater{ |
1132 | - model: contactModel |
1133 | - delegate: Standard { |
1134 | - objectName: "eventGuest%1".arg(index) |
1135 | - height: units.gu(4) |
1136 | - text: name |
1137 | + Repeater{ |
1138 | + model: contactModel |
1139 | + delegate: ListItem.Standard { |
1140 | + objectName: "eventGuest%1".arg(index) |
1141 | + height: units.gu(4) |
1142 | + text: name |
1143 | + } |
1144 | } |
1145 | } |
1146 | } |
1147 | + |
1148 | + ListItem.ThinDivider {} |
1149 | } |
1150 | |
1151 | - Item { |
1152 | - width: parent.width |
1153 | - height: recurrenceOption.height |
1154 | + ListItem.Subtitled{ |
1155 | + id:thisHappens |
1156 | + objectName :"thisHappens" |
1157 | + |
1158 | + anchors { |
1159 | + left: parent.left |
1160 | + leftMargin: units.gu(-1) |
1161 | + } |
1162 | + |
1163 | + showDivider: false |
1164 | visible: event.itemType === Type.Event |
1165 | - Label{ |
1166 | - id: frequencyLabel |
1167 | - text: i18n.tr("This happens"); |
1168 | - anchors.verticalCenter: parent.verticalCenter |
1169 | - } |
1170 | - OptionSelector{ |
1171 | - id: recurrenceOption |
1172 | - anchors.right: parent.right |
1173 | - width: parent.width - optionSelectorWidth - units.gu(1) |
1174 | - model: Defines.recurrenceLabel |
1175 | - containerHeight: itemHeight * 4 |
1176 | - onExpandedChanged: Qt.inputMethod.hide(); |
1177 | - onExpansionCompleted: scrollOnExpand(true,column,flickable,-8,[weeksColumn,limit,limitCount,limitDate,remind]) |
1178 | - } |
1179 | - } |
1180 | - |
1181 | - Column { |
1182 | - id: weeksColumn |
1183 | - visible: recurrenceOption.selectedIndex == 5 |
1184 | - Label { |
1185 | - text: i18n.tr("Repeats On:") |
1186 | - } |
1187 | - Row { |
1188 | - id: weeksRow |
1189 | - width: column.width |
1190 | - spacing: (weeksRow.width - units.gu(28))/6 //Units.gu(28) = weeksRowColumn.width * 7 [weeks] |
1191 | - Repeater { |
1192 | - model: Defines.weekLabel |
1193 | - Column { |
1194 | - id: weeksRowColumn |
1195 | - width: units.gu(4) //This is help calculate weeksRow.spacing |
1196 | - Label { |
1197 | - id:lbl |
1198 | - text:modelData |
1199 | - anchors.horizontalCenter: parent.horizontalCenter |
1200 | - } |
1201 | - CheckBox { |
1202 | - id: weekCheck |
1203 | - onCheckedChanged: { |
1204 | - //EDS consider 7 as Sunday index so if the index is 0 then we have to explicitly push Sunday. |
1205 | - if(index === 0) |
1206 | - (checked) ? internal.weekDays.push(Qt.Sunday) : internal.weekDays.splice(internal.weekDays.indexOf(Qt.Sunday),1); |
1207 | - else |
1208 | - (checked) ? internal.weekDays.push(index) : internal.weekDays.splice(internal.weekDays.indexOf(index),1); |
1209 | - } |
1210 | - checked: { |
1211 | - (internal.weekDays.length === 0 && index === date.getDay() && isEdit== false) ? true : false; |
1212 | - } |
1213 | - } |
1214 | - } |
1215 | - } |
1216 | - } |
1217 | - } |
1218 | - Item { |
1219 | - id: limit |
1220 | - visible: recurrenceOption.selectedIndex != 0 |
1221 | - width: parent.width |
1222 | - height: limitOptions.height |
1223 | - Label{ |
1224 | - id: limitLabel |
1225 | - text: i18n.tr("Recurring event ends"); |
1226 | - anchors{ |
1227 | - left: parent.left |
1228 | - right: limitOptions.left |
1229 | - } |
1230 | - wrapMode: Text.WordWrap |
1231 | - maximumLineCount: 2 |
1232 | - anchors.verticalCenter: parent.verticalCenter |
1233 | - } |
1234 | - OptionSelector{ |
1235 | - id: limitOptions |
1236 | - anchors.right: parent.right |
1237 | - width: parent.width - optionSelectorWidth - units.gu(3) |
1238 | - model: Defines.limitLabel |
1239 | - containerHeight: itemHeight * 4 |
1240 | - onExpandedChanged: Qt.inputMethod.hide(); |
1241 | - onExpansionCompleted: scrollOnExpand(true,column,flickable,-5,[limitCount,limitDate,remind]) |
1242 | - } |
1243 | - } |
1244 | - NewEventEntryField{ |
1245 | - id: limitCount |
1246 | - width: parent.width |
1247 | - // TRANSLATORS: This refers to no of occurences of an event. |
1248 | - title: i18n.tr("Recurrence") |
1249 | - objectName: "eventLimitCount" |
1250 | - visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex == 1; |
1251 | - validator: IntValidator{bottom: 1;} |
1252 | - inputMethodHints: Qt.ImhDialableCharactersOnly |
1253 | - focus: true |
1254 | - } |
1255 | - Item { |
1256 | - id: limitDate |
1257 | - width: parent.width |
1258 | - height: datePick.height |
1259 | - visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex===2; |
1260 | - onVisibleChanged: scrollOnExpand(this.visible,column,flickable,-16,[remind]) |
1261 | - DatePicker{ |
1262 | - id:datePick; |
1263 | - anchors.right: parent.right |
1264 | - anchors.left: parent.left |
1265 | - } |
1266 | - } |
1267 | - Item{ |
1268 | - id: remind |
1269 | - width: parent.width |
1270 | - height: reminderOption.height |
1271 | - Label{ |
1272 | - id: remindLabel |
1273 | - text: i18n.tr("Remind me"); |
1274 | - anchors.verticalCenter: parent.verticalCenter |
1275 | - } |
1276 | - |
1277 | - OptionSelector{ |
1278 | - id: reminderOption |
1279 | - anchors.right: parent.right |
1280 | - width: parent.width - optionSelectorWidth - units.gu(1) |
1281 | - containerHeight: itemHeight * 4 |
1282 | - model: Defines.reminderLabel |
1283 | - onExpandedChanged: Qt.inputMethod.hide(); |
1284 | - onExpansionCompleted: scrollOnExpand(true,column,flickable,-1) |
1285 | - } |
1286 | + text: i18n.tr("This Happens") |
1287 | + subText: eventUtils.getRecurrenceString(rule) |
1288 | + onClicked: pageStack.push(Qt.resolvedUrl("EventRepetition.qml"),{"rule": rule,"date":date,"isEdit":isEdit}); |
1289 | + } |
1290 | + |
1291 | + ListItem.ThinDivider {} |
1292 | + ListItem.Subtitled{ |
1293 | + id:eventReminder |
1294 | + objectName : "eventReminder" |
1295 | + anchors{ |
1296 | + left:parent.left |
1297 | + leftMargin: units.gu(-1) |
1298 | + } |
1299 | + showDivider: false |
1300 | + text: i18n.tr("Reminder") |
1301 | + subText:{ |
1302 | + var foundIndex = Defines.reminderValue.indexOf(visualReminder.secondsBeforeStart); |
1303 | + Defines.reminderLabel[foundIndex != -1 ? foundIndex : 0] |
1304 | + } |
1305 | + onClicked: pageStack.push(Qt.resolvedUrl("EventReminder.qml"), |
1306 | + {"visualReminder": visualReminder, |
1307 | + "audibleReminder":audibleReminder, |
1308 | + "eventTitle":titleEdit.text}); |
1309 | + |
1310 | } |
1311 | } |
1312 | } |
1313 | - |
1314 | // used to keep the field visible when the keyboard appear or dismiss |
1315 | KeyboardRectangle { |
1316 | id: keyboard |
1317 | @@ -777,7 +664,6 @@ |
1318 | |
1319 | QtObject { |
1320 | id: internal |
1321 | - property var weekDays : []; |
1322 | function clearFocus() { |
1323 | Qt.inputMethod.hide() |
1324 | titleEdit.focus = false |
1325 | |
1326 | === modified file 'NewEventEntryField.qml' |
1327 | --- NewEventEntryField.qml 2014-09-02 00:02:38 +0000 |
1328 | +++ NewEventEntryField.qml 2014-09-09 10:47:16 +0000 |
1329 | @@ -15,13 +15,21 @@ |
1330 | * You should have received a copy of the GNU General Public License |
1331 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1332 | */ |
1333 | -import QtQuick 2.0 |
1334 | + |
1335 | +import QtQuick 2.2 |
1336 | import Ubuntu.Components 1.1 |
1337 | +import Ubuntu.Components.Themes.Ambiance 1.0 |
1338 | +import Ubuntu.Components.ListItems 1.0 as ListItem |
1339 | |
1340 | TextField{ |
1341 | id: root |
1342 | + |
1343 | property alias title: label.text |
1344 | |
1345 | + style: TextFieldStyle { |
1346 | + background: Item {} |
1347 | + } |
1348 | + |
1349 | primaryItem: Label{ |
1350 | id: label |
1351 | anchors.left: parent.left |
1352 | @@ -30,8 +38,14 @@ |
1353 | } |
1354 | |
1355 | color: focus ? "#2C001E" : "#5D5D5D" |
1356 | - font { |
1357 | - pixelSize: focus ? FontUtils.sizeToPixels("large") : FontUtils.sizeToPixels("medium") |
1358 | + font.pixelSize: focus ? FontUtils.sizeToPixels("large") |
1359 | + : FontUtils.sizeToPixels("medium") |
1360 | + |
1361 | + Rectangle { |
1362 | + z: -1 |
1363 | + anchors.fill: parent |
1364 | + color: root.highlighted ? Theme.palette.selected.background |
1365 | + : "Transparent" |
1366 | } |
1367 | |
1368 | onActiveFocusChanged: { |
1369 | |
1370 | === modified file 'RecurrenceLabelDefines.qml' |
1371 | --- RecurrenceLabelDefines.qml 2014-09-08 10:21:19 +0000 |
1372 | +++ RecurrenceLabelDefines.qml 2014-09-09 10:47:16 +0000 |
1373 | @@ -15,14 +15,16 @@ |
1374 | * You should have received a copy of the GNU General Public License |
1375 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1376 | */ |
1377 | -import QtQuick 2.0; |
1378 | -import Ubuntu.Components 1.1; |
1379 | + |
1380 | +import QtQuick 2.0 |
1381 | +import Ubuntu.Components 1.1 |
1382 | + |
1383 | QtObject { |
1384 | property var recurrenceLabel:[i18n.tr("Once"), |
1385 | i18n.tr("Daily"), |
1386 | - i18n.tr("Every Weekday"), |
1387 | - i18n.tr("Every Monday, Wednesday and Friday"), |
1388 | - i18n.tr("Every Tuesday and Thursday"), |
1389 | + i18n.tr("On Weekdays"), |
1390 | + i18n.tr("On Monday, Wednesday and Friday"), |
1391 | + i18n.tr("On Tuesday and Thursday"), |
1392 | i18n.tr("Weekly"), |
1393 | i18n.tr("Monthly"), |
1394 | i18n.tr("Yearly")]; |
1395 | |
1396 | === modified file 'calendar.qml' |
1397 | --- calendar.qml 2014-09-02 00:02:38 +0000 |
1398 | +++ calendar.qml 2014-09-09 10:47:16 +0000 |
1399 | @@ -223,7 +223,7 @@ |
1400 | endDate = new Date(endTime); |
1401 | } |
1402 | } |
1403 | - pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"startDate": startDate, "endDate": endDate, "model":eventModel}); |
1404 | + //pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"startDate": startDate, "endDate": endDate, //"model":eventModel}); |
1405 | } |
1406 | |
1407 | // This function calculate the difference between --endtime and --starttime and choose the better view |
1408 | |
1409 | === modified file 'tests/autopilot/calendar_app/__init__.py' |
1410 | --- tests/autopilot/calendar_app/__init__.py 2014-09-05 15:24:20 +0000 |
1411 | +++ tests/autopilot/calendar_app/__init__.py 2014-09-09 10:47:16 +0000 |
1412 | @@ -543,12 +543,16 @@ |
1413 | self._ensure_entry_field_visible_and_write('newEventName', value) |
1414 | |
1415 | def _ensure_entry_field_visible_and_write(self, object_name, value): |
1416 | - name_text_field = self._get_new_event_entry_field(object_name) |
1417 | + name_text_field = self._get_text_box(object_name) |
1418 | self._ensure_visible_and_write(name_text_field, value) |
1419 | |
1420 | def _get_new_event_entry_field(self, object_name): |
1421 | return self.select_single(NewEventEntryField, objectName=object_name) |
1422 | |
1423 | + def _get_text_box(self, object_name): |
1424 | + return self.select_single( |
1425 | + ubuntuuitoolkit.TextField, objectName=object_name) |
1426 | + |
1427 | def _ensure_visible_and_write(self, text_field, value): |
1428 | text_field.swipe_into_view() |
1429 | text_field.write(value) |
1430 | @@ -600,13 +604,13 @@ |
1431 | return self._get_calendar().get_current_label().text |
1432 | |
1433 | def get_event_name(self): |
1434 | - return self._get_new_event_entry_field('newEventName').text |
1435 | + return self._get_text_box('newEventName').text |
1436 | |
1437 | def get_description_text(self): |
1438 | return self._get_description_text_area().text |
1439 | |
1440 | def get_location_name(self): |
1441 | - return self._get_new_event_entry_field('eventLocationInput').text |
1442 | + return self._get_text_box('eventLocationInput').text |
1443 | |
1444 | def _get_form_values(self): |
1445 | # TODO get start date and end date, is all day event, recurrence and |
FAILED: Continuous integration, rev:419 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 745/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 1893/console 91.189. 93.70:8080/ job/ubuntu- calendar- app-utopic- amd64-ci/ 303/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 745/rebuild
http://