Merge lp:~majster-pl/ubuntu-calendar-app/new-event-page into lp:ubuntu-calendar-app
- new-event-page
- Merge into trunk
Status: | Rejected | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Rejected by: | Renato Araujo Oliveira Filho | ||||||||||||
Proposed branch: | lp:~majster-pl/ubuntu-calendar-app/new-event-page | ||||||||||||
Merge into: | lp:ubuntu-calendar-app | ||||||||||||
Diff against target: |
1758 lines (+714/-626) 7 files modified
EventReminder.qml (+39/-27) EventRepetition.qml (+236/-187) NewEvent.qml (+265/-260) NewEventEntryField.qml (+0/-38) NewEventTimePicker.qml (+94/-58) RemindersModel.qml (+12/-0) po/com.ubuntu.calendar.pot (+68/-56) |
||||||||||||
To merge this branch: | bzr merge lp:~majster-pl/ubuntu-calendar-app/new-event-page | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Renato Araujo Oliveira Filho (community) | Disapprove | ||
Jenkins Bot | continuous-integration | Needs Fixing | |
Nekhelesh Ramananthan | code-review & testing | Approve | |
Review via email: mp+288637@code.launchpad.net |
Commit message
Description of the change
This is very first implementation of new-event-page.
There is still plenty of space of improvements but I want to get it reviewed before I continue my work.
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
Nekhelesh Ramananthan (nik90) wrote : | # |
I'm setting this MP as a work in progress since it is. I have added inline comments of all things that needs fixing. This is just a preliminary check since I suspect more changes.
Do note that when I click the add guest button, I get ,
file://
Not sure if this was introduced in your branch or in trunk by some other branch. Please do check to make sure you don't introduce a regression.
I also see file://
Nekhelesh Ramananthan (nik90) wrote : | # |
Nice work! It is *almost* ready. Just few minor touch ups to do and then we are set to land this MP.
1. In the old guest design layout, I notice 3 minor issues ( refer to http://
a) Remove the listitem dividers of the guests listitem
b) set the guest listitem height as listitemlayout.
c) Align the guest names to the "Add Guest" button. This can be done by setting the left and right margin to -2 gu. Yes negative :)
2. In the repeat and reminders page, the "Repeat" and "Reminder" listitem header is shown using "blue" color due to the new SDK. Please change these to the new list items to fix this issue.
( refer to http://
3. The selection color which is shown when you click on the date/time is a bit strong. Please change the background to lightgray shade and the text color to white/black.
Nekhelesh Ramananthan (nik90) wrote : | # |
Almost there, just noticed one minor issue. In the Event reminders page, the option "No Reminder" is hidden by the page header. I had a quick look at it, and is quite easy to fix -> http://
Nekhelesh Ramananthan (nik90) wrote : | # |
LGTM. Awesome work. We can finish of the new design implementation for the Guests feature when we get design specs for it in another MP.
@renato, You can go ahead test this and top-approve. It fixes the label color issue that bill pointed out as well.
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
Great work.
I added some small comments but in general the code looks great.
Szymon Waliczek (majster-pl) wrote : | # |
Thanks for review, I added few comments.
Will push fixed code soon.
- 779. By Szymon Waliczek
-
Added Flickable to EventRepetition.qml and fixed anchoring to header.
Removed unnecessary empty lanes and code clean up.
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
Code looks good, but I can not test it due some conflicts with trunk.
please merge with trunk
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:779
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
Unmerged revisions
- 779. By Szymon Waliczek
-
Added Flickable to EventRepetition.qml and fixed anchoring to header.
Removed unnecessary empty lanes and code clean up. - 778. By Szymon Waliczek
-
Fix 'No Reminder' hiden under header. in EventReminder.qml
- 777. By Szymon Waliczek
-
Update code to new SDK (header, ListItems)
Small visual improvments in Guest repeater.
Changed color of selection then user choosing date/time. - 776. By Szymon Waliczek
-
Postpone the 'Add guest' redesign - waiting for designs.
- 775. By Szymon Waliczek
-
Fix Save button to be desible when no event name is not set.
- 774. By Szymon Waliczek
-
Fixed everything what Nik90 pointed out in review, apart from AddGuest field as I'm missing designs for it.
- 773. By Szymon Waliczek
-
First implementation of NewEvent.qml page, few code clean ups
Preview Diff
1 | === modified file 'EventReminder.qml' |
2 | --- EventReminder.qml 2016-01-29 14:47:31 +0000 |
3 | +++ EventReminder.qml 2016-03-15 21:24:54 +0000 |
4 | @@ -32,43 +32,54 @@ |
5 | |
6 | visible: false |
7 | flickable: null |
8 | - title: i18n.tr("Reminder") |
9 | - |
10 | - head.backAction: Action{ |
11 | - iconName:"back" |
12 | - onTriggered:{ |
13 | - var repeatCount = 3; |
14 | - var repeatDelay = 5 * 60; |
15 | - |
16 | - //reminder on event time |
17 | - if( reminderTime === 0 ) { |
18 | - repeatCount = 0; |
19 | - repeatDelay = 0; |
20 | - } else if( reminderTime === 300) { //5 min |
21 | - repeatCount = 1; |
22 | + |
23 | + header: PageHeader { |
24 | + title: i18n.tr("Reminder") |
25 | + flickable: _pageFlickable |
26 | + |
27 | + leadingActionBar.actions: [ |
28 | + Action { |
29 | + iconName: "back" |
30 | + text: "Back" |
31 | + shortcut: "Esc" |
32 | + onTriggered: onBackClicked() |
33 | } |
34 | - |
35 | - visualReminder.repetitionCount = repeatCount; |
36 | - visualReminder.repetitionDelay = repeatDelay; |
37 | - visualReminder.message = eventTitle |
38 | - visualReminder.secondsBeforeStart = reminderTime; |
39 | - |
40 | - audibleReminder.repetitionCount = repeatCount; |
41 | - audibleReminder.repetitionDelay = repeatDelay; |
42 | - audibleReminder.secondsBeforeStart = reminderTime; |
43 | - |
44 | - pop(); |
45 | + ] |
46 | + } |
47 | + |
48 | + function onBackClicked() { |
49 | + var repeatCount = 3; |
50 | + var repeatDelay = 5 * 60; |
51 | + |
52 | + //reminder on event time |
53 | + if( reminderTime === 0 ) { |
54 | + repeatCount = 0; |
55 | + repeatDelay = 0; |
56 | + } else if( reminderTime === 300) { //5 min |
57 | + repeatCount = 1; |
58 | } |
59 | + |
60 | + visualReminder.repetitionCount = repeatCount; |
61 | + visualReminder.repetitionDelay = repeatDelay; |
62 | + visualReminder.message = eventTitle |
63 | + visualReminder.secondsBeforeStart = reminderTime; |
64 | + |
65 | + audibleReminder.repetitionCount = repeatCount; |
66 | + audibleReminder.repetitionDelay = repeatDelay; |
67 | + audibleReminder.secondsBeforeStart = reminderTime; |
68 | + |
69 | + pop(); |
70 | } |
71 | + |
72 | Scrollbar{ |
73 | id:scrollList |
74 | flickableItem: _pageFlickable |
75 | - anchors.fill :parent |
76 | + anchors.fill: parent |
77 | } |
78 | + |
79 | Flickable { |
80 | id: _pageFlickable |
81 | |
82 | - |
83 | clip: true |
84 | anchors.fill: parent |
85 | contentHeight: _reminders.itemHeight * reminderModel.count + units.gu(2) |
86 | @@ -91,6 +102,7 @@ |
87 | } |
88 | } |
89 | } |
90 | + |
91 | Component { |
92 | id: selectorDelegate |
93 | OptionSelectorDelegate { text: label; } |
94 | |
95 | === modified file 'EventRepetition.qml' |
96 | --- EventRepetition.qml 2016-03-07 17:57:04 +0000 |
97 | +++ EventRepetition.qml 2016-03-15 21:24:54 +0000 |
98 | @@ -19,25 +19,37 @@ |
99 | import QtQuick 2.4 |
100 | import QtOrganizer 5.0 |
101 | import Ubuntu.Components 1.3 |
102 | -import Ubuntu.Components.ListItems 1.0 as ListItem |
103 | +import Ubuntu.Components.ListItems 1.0 as ListItems |
104 | import Ubuntu.Components.Pickers 1.0 |
105 | import QtOrganizer 5.0 |
106 | import "Defines.js" as Defines |
107 | import "Recurrence.js" as Recurrence |
108 | |
109 | Page { |
110 | - id: repetition |
111 | + id: root |
112 | |
113 | property var weekDays : []; |
114 | property var eventRoot; |
115 | property var isEdit |
116 | |
117 | visible: false |
118 | - // TRANSLATORS: this refers to how often a recurrent event repeats |
119 | - // and it is shown as the header of the page to choose repetition |
120 | - // and as the header of the list item that shows the repetition |
121 | - // summary in the page that displays the event details |
122 | - title: i18n.tr("Repeat") |
123 | + header: PageHeader { |
124 | + // TRANSLATORS: this refers to how often a recurrent event repeats |
125 | + // and it is shown as the header of the page to choose repetition |
126 | + // and as the header of the list item that shows the repetition |
127 | + // summary in the page that displays the event details |
128 | + title: i18n.tr("Repeat") |
129 | + flickable: null |
130 | + |
131 | + leadingActionBar.actions: [ |
132 | + Action { |
133 | + iconName: "back" |
134 | + text: "Back" |
135 | + shortcut: "Esc" |
136 | + onTriggered: onBackClicked() |
137 | + } |
138 | + ] |
139 | + } |
140 | |
141 | EventUtils{ |
142 | id:eventUtils |
143 | @@ -92,192 +104,229 @@ |
144 | recurrenceOption.selectedIndex = index; |
145 | } |
146 | |
147 | - head.backAction: Action{ |
148 | - id:backAction |
149 | - iconName: "back" |
150 | - onTriggered: { |
151 | - var recurrenceRule = Defines.recurrenceValue[ recurrenceOption.selectedIndex ]; |
152 | - |
153 | - if (recurrenceRule !== RecurrenceRule.Invalid) { |
154 | - if (eventRoot.rule === null || eventRoot.rule === undefined ){ |
155 | - eventRoot.rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", eventRoot.event.recurrence,"EventRepetition.qml"); |
156 | - } |
157 | - |
158 | - var rule = eventRoot.rule; |
159 | - rule.frequency = recurrenceRule; |
160 | - switch(recurrenceOption.selectedIndex){ |
161 | - case 1: //daily |
162 | - case 2: //weekly |
163 | - case 3: //weekly |
164 | - case 4: //weekly |
165 | - case 5: //weekly |
166 | - rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex, weekDays ); |
167 | - break; |
168 | - case 6: //monthly |
169 | - rule.daysOfMonth = [eventRoot.date.getDate()]; |
170 | - break; |
171 | - case 7: //yearly |
172 | - rule.monthsOfYear = [eventRoot.date.getMonth()]; |
173 | - rule.daysOfMonth = [eventRoot.date.getDate()]; |
174 | - break; |
175 | - case 0: //once |
176 | - default: |
177 | - //it should not come here |
178 | - break; |
179 | - } |
180 | - |
181 | - if (limitOptions.selectedIndex === 1 |
182 | - && recurrenceOption.selectedIndex > 0 |
183 | - && limitCount.text != "") { |
184 | - rule.limit = parseInt(limitCount.text); |
185 | - } |
186 | - else if (limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0) { |
187 | - rule.limit = datePick.date; |
188 | - } |
189 | - else { |
190 | - rule.limit = undefined; |
191 | - } |
192 | + function onBackClicked() { |
193 | + var recurrenceRule = Defines.recurrenceValue[ recurrenceOption.selectedIndex ]; |
194 | + |
195 | + if (recurrenceRule !== RecurrenceRule.Invalid) { |
196 | + if (eventRoot.rule === null || eventRoot.rule === undefined ){ |
197 | + eventRoot.rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", eventRoot.event.recurrence,"EventRepetition.qml"); |
198 | + } |
199 | + |
200 | + var rule = eventRoot.rule; |
201 | + rule.frequency = recurrenceRule; |
202 | + switch(recurrenceOption.selectedIndex){ |
203 | + case 1: //daily |
204 | + case 2: //weekly |
205 | + case 3: //weekly |
206 | + case 4: //weekly |
207 | + case 5: //weekly |
208 | + rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex, weekDays ); |
209 | + break; |
210 | + case 6: //monthly |
211 | + rule.daysOfMonth = [eventRoot.date.getDate()]; |
212 | + break; |
213 | + case 7: //yearly |
214 | + rule.monthsOfYear = [eventRoot.date.getMonth()]; |
215 | + rule.daysOfMonth = [eventRoot.date.getDate()]; |
216 | + break; |
217 | + case 0: //once |
218 | + default: |
219 | + //it should not come here |
220 | + break; |
221 | + } |
222 | + |
223 | + if (limitOptions.selectedIndex === 1 |
224 | + && recurrenceOption.selectedIndex > 0 |
225 | + && limitCount.text != "") { |
226 | + rule.limit = parseInt(limitCount.text); |
227 | + } |
228 | + else if (limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0) { |
229 | + rule.limit = datePick.date; |
230 | } |
231 | else { |
232 | - eventRoot.rule = null; |
233 | + rule.limit = undefined; |
234 | } |
235 | - pop() |
236 | - } |
237 | + } |
238 | + else { |
239 | + eventRoot.rule = null; |
240 | + } |
241 | + pop() |
242 | } |
243 | |
244 | - Column{ |
245 | - id:repeatColumn |
246 | - |
247 | - anchors.fill: parent |
248 | - spacing: units.gu(1) |
249 | - |
250 | - ListItem.Header{ |
251 | - text: i18n.tr("Repeat") |
252 | - } |
253 | - |
254 | - OptionSelector{ |
255 | - id: recurrenceOption |
256 | - visible: true |
257 | - |
258 | - anchors { |
259 | - left: parent.left |
260 | - right: parent.right |
261 | - margins: units.gu(2) |
262 | - } |
263 | - |
264 | - model: Defines.recurrenceLabel |
265 | - containerHeight: itemHeight * 4 |
266 | - onExpandedChanged: Qt.inputMethod.hide(); |
267 | - } |
268 | - |
269 | - ListItem.Header{ |
270 | - text: i18n.tr("Repeats On:") |
271 | - visible: recurrenceOption.selectedIndex == 5 |
272 | - } |
273 | - |
274 | - Row { |
275 | - id: weeksRow |
276 | - |
277 | - anchors { |
278 | - left: parent.left |
279 | - right: parent.right |
280 | - margins: units.gu(2) |
281 | - } |
282 | - |
283 | + Flickable { |
284 | + anchors { fill: parent; topMargin: parent.header.height } |
285 | + contentHeight: repeatColumn.height + units.gu(2) |
286 | + interactive: repeatColumn.height > height ? true : false |
287 | + Column{ |
288 | + id:repeatColumn |
289 | + |
290 | + width: parent.width |
291 | spacing: units.gu(1) |
292 | - visible: recurrenceOption.selectedIndex == 5 |
293 | - |
294 | - Repeater { |
295 | - model: Defines.weekLabel |
296 | - Column { |
297 | - id: weeksRowColumn |
298 | - spacing: units.gu(1) |
299 | - Label { |
300 | - id:lbl |
301 | - text:modelData |
302 | - anchors.horizontalCenter: parent.horizontalCenter |
303 | - } |
304 | - CheckBox { |
305 | - id: weekCheck |
306 | - onCheckedChanged: { |
307 | - //EDS consider 7 as Sunday index so if the index is 0 then we have to explicitly push Sunday. |
308 | - if(index === 0) |
309 | - (checked) ? weekDays.push(Qt.Sunday) : weekDays.splice(weekDays.indexOf(Qt.Sunday),1); |
310 | - else |
311 | - (checked) ? weekDays.push(index) : weekDays.splice(weekDays.indexOf(index),1); |
312 | - } |
313 | - checked:{ |
314 | - (weekDays.length === 0 && eventRoot.date && (index === eventRoot.date.getDay()) && !isEdit) ? true : false; |
315 | - } |
316 | - |
317 | - } |
318 | - } |
319 | - } |
320 | - } |
321 | - |
322 | - ListItem.Header { |
323 | - text: i18n.tr("Recurring event ends") |
324 | - visible: recurrenceOption.selectedIndex != 0 |
325 | - } |
326 | - |
327 | - OptionSelector{ |
328 | - id: limitOptions |
329 | - visible: recurrenceOption.selectedIndex != 0 |
330 | - |
331 | - anchors { |
332 | - left: parent.left |
333 | - right: parent.right |
334 | - margins: units.gu(2) |
335 | - } |
336 | - |
337 | - model: limitLabels |
338 | - containerHeight: itemHeight * 4 |
339 | - onExpandedChanged: Qt.inputMethod.hide() |
340 | - } |
341 | - |
342 | - ListItem.Header{ |
343 | - // TRANSLATORS: this refers to how often a recurrent event repeats |
344 | - // and it is shown as the header of the option selector to choose |
345 | - // its repetition |
346 | - text:i18n.tr("Repeats") |
347 | - visible: recurrenceOption.selectedIndex != 0 |
348 | - && limitOptions.selectedIndex == 1 |
349 | - } |
350 | - |
351 | - TextField { |
352 | - id: limitCount |
353 | - objectName: "eventLimitCount" |
354 | - |
355 | - anchors { |
356 | - left: parent.left |
357 | - right: parent.right |
358 | - margins: units.gu(2) |
359 | - } |
360 | - |
361 | - visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex == 1 |
362 | - validator: IntValidator{ bottom: 1; } |
363 | - inputMethodHints: Qt.ImhDialableCharactersOnly |
364 | - |
365 | - onTextChanged: { |
366 | - backAction.enabled = !!text.trim() |
367 | - } |
368 | - } |
369 | - |
370 | - ListItem.Header{ |
371 | - text:i18n.tr("Date") |
372 | - visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex == 2 |
373 | - } |
374 | - |
375 | - DatePicker{ |
376 | - id:datePick; |
377 | - |
378 | - anchors { |
379 | - left: parent.left |
380 | - right: parent.right |
381 | - margins: units.gu(2) |
382 | - } |
383 | - |
384 | - visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex===2 |
385 | + |
386 | + ListItem { |
387 | + height: repeatListItem.height |
388 | + divider.visible: false |
389 | + |
390 | + ListItemLayout { |
391 | + id: repeatListItem |
392 | + title.text: i18n.tr("Repeat") |
393 | + title.color: Theme.palette.selected.overlayText |
394 | + } |
395 | + } |
396 | + |
397 | + OptionSelector{ |
398 | + id: recurrenceOption |
399 | + visible: true |
400 | + |
401 | + anchors { |
402 | + left: parent.left |
403 | + right: parent.right |
404 | + margins: units.gu(2) |
405 | + } |
406 | + |
407 | + model: Defines.recurrenceLabel |
408 | + containerHeight: itemHeight * 4 |
409 | + onExpandedChanged: Qt.inputMethod.hide(); |
410 | + } |
411 | + |
412 | + ListItem { |
413 | + visible: recurrenceOption.selectedIndex == 5 |
414 | + divider.visible: false |
415 | + |
416 | + ListItemLayout { |
417 | + id: repeatsOnListItem |
418 | + title.text: i18n.tr("Repeats On:") |
419 | + title.color: Theme.palette.selected.overlayText |
420 | + } |
421 | + } |
422 | + |
423 | + Row { |
424 | + id: weeksRow |
425 | + |
426 | + anchors { |
427 | + left: parent.left |
428 | + right: parent.right |
429 | + margins: units.gu(2) |
430 | + } |
431 | + |
432 | + spacing: units.gu(1) |
433 | + visible: recurrenceOption.selectedIndex == 5 |
434 | + |
435 | + Repeater { |
436 | + model: Defines.weekLabel |
437 | + Column { |
438 | + id: weeksRowColumn |
439 | + spacing: units.gu(1) |
440 | + Label { |
441 | + id:lbl |
442 | + text:modelData |
443 | + anchors.horizontalCenter: parent.horizontalCenter |
444 | + } |
445 | + CheckBox { |
446 | + id: weekCheck |
447 | + onCheckedChanged: { |
448 | + //EDS consider 7 as Sunday index so if the index is 0 then we have to explicitly push Sunday. |
449 | + if(index === 0) |
450 | + (checked) ? weekDays.push(Qt.Sunday) : weekDays.splice(weekDays.indexOf(Qt.Sunday),1); |
451 | + else |
452 | + (checked) ? weekDays.push(index) : weekDays.splice(weekDays.indexOf(index),1); |
453 | + } |
454 | + checked:{ |
455 | + (weekDays.length === 0 && eventRoot.date && (index === eventRoot.date.getDay()) && !isEdit) ? true : false; |
456 | + } |
457 | + |
458 | + } |
459 | + } |
460 | + } |
461 | + } |
462 | + |
463 | + ListItem { |
464 | + visible: recurrenceOption.selectedIndex != 0 |
465 | + divider.visible: false |
466 | + height: recurringEventListItem.height |
467 | + |
468 | + ListItemLayout { |
469 | + id: recurringEventListItem |
470 | + title.text: i18n.tr("Recurring event ends") |
471 | + title.color: Theme.palette.selected.overlayText |
472 | + } |
473 | + } |
474 | + |
475 | + OptionSelector{ |
476 | + id: limitOptions |
477 | + visible: recurrenceOption.selectedIndex != 0 |
478 | + |
479 | + anchors { |
480 | + left: parent.left |
481 | + right: parent.right |
482 | + margins: units.gu(2) |
483 | + } |
484 | + |
485 | + model: limitLabels |
486 | + containerHeight: itemHeight * 4 |
487 | + onExpandedChanged: Qt.inputMethod.hide() |
488 | + } |
489 | + |
490 | + ListItem { |
491 | + visible: recurrenceOption.selectedIndex != 0 |
492 | + && limitOptions.selectedIndex == 1 |
493 | + divider.visible: false |
494 | + height: repeatsListItem.height |
495 | + |
496 | + ListItemLayout { |
497 | + id: repeatsListItem |
498 | + // TRANSLATORS: this refers to how often a recurrent event repeats |
499 | + // and it is shown as the header of the option selector to choose |
500 | + // its repetition |
501 | + title.text:i18n.tr("Repeats") |
502 | + title.color: Theme.palette.selected.overlayText |
503 | + } |
504 | + |
505 | + } |
506 | + |
507 | + TextField { |
508 | + id: limitCount |
509 | + objectName: "eventLimitCount" |
510 | + |
511 | + anchors { |
512 | + left: parent.left |
513 | + right: parent.right |
514 | + margins: units.gu(2) |
515 | + } |
516 | + |
517 | + visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex == 1 |
518 | + validator: IntValidator{ bottom: 1; } |
519 | + inputMethodHints: Qt.ImhDialableCharactersOnly |
520 | + |
521 | + onTextChanged: { |
522 | + backAction.enabled = !!text.trim() |
523 | + } |
524 | + } |
525 | + |
526 | + ListItem { |
527 | + visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex == 2 |
528 | + divider.visible: false |
529 | + height: dateListItem.height |
530 | + |
531 | + ListItemLayout { |
532 | + id: dateListItem |
533 | + title.text:i18n.tr("Date") |
534 | + title.color: Theme.palette.selected.overlayText |
535 | + } |
536 | + } |
537 | + |
538 | + DatePicker{ |
539 | + id:datePick; |
540 | + |
541 | + anchors { |
542 | + left: parent.left |
543 | + right: parent.right |
544 | + margins: units.gu(2) |
545 | + } |
546 | + |
547 | + visible: recurrenceOption.selectedIndex != 0 && limitOptions.selectedIndex===2 |
548 | + } |
549 | } |
550 | } |
551 | + |
552 | } |
553 | |
554 | === modified file 'NewEvent.qml' |
555 | --- NewEvent.qml 2016-03-14 20:25:50 +0000 |
556 | +++ NewEvent.qml 2016-03-15 21:24:54 +0000 |
557 | @@ -66,8 +66,7 @@ |
558 | } |
559 | } |
560 | |
561 | - function cancel() |
562 | - { |
563 | + function cancel() { |
564 | if (pageStack) |
565 | pageStack.pop(); |
566 | root.canceled() |
567 | @@ -254,6 +253,11 @@ |
568 | secondsBeforeStart: root.reminderValue |
569 | } |
570 | |
571 | + RemindersModel { |
572 | + id: reminderModel |
573 | + } |
574 | + |
575 | + |
576 | function getDaysOfWeek(){ |
577 | var daysOfWeek = []; |
578 | switch(recurrenceOption.selectedIndex){ |
579 | @@ -310,7 +314,6 @@ |
580 | scrollAnimation.start() |
581 | } |
582 | |
583 | - Keys.onEscapePressed: root.cancel() |
584 | onStartDateChanged: { |
585 | if (!startDate) |
586 | return |
587 | @@ -333,42 +336,47 @@ |
588 | |
589 | header: PageHeader { |
590 | id: pageHeader |
591 | - |
592 | - flickable: null |
593 | - title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event") |
594 | - leadingActionBar.actions: Action { |
595 | - id: backAction |
596 | - |
597 | - name: "cancel" |
598 | - text: i18n.tr("Cancel") |
599 | - iconName: isEdit ? "back" : "down" |
600 | - onTriggered: root.cancel() |
601 | - } |
602 | - |
603 | - trailingActionBar.actions: [ |
604 | - Action { |
605 | - text: i18n.tr("Delete"); |
606 | - objectName: "delete" |
607 | - iconName: "delete" |
608 | - visible : isEdit |
609 | - onTriggered: { |
610 | - var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event}); |
611 | - dialog.deleteEvent.connect( function(eventId){ |
612 | - model.removeItem(eventId); |
613 | - if (pageStack) |
614 | - pageStack.pop(); |
615 | - root.eventDeleted(eventId); |
616 | - }); |
617 | - } |
618 | - }, |
619 | - Action { |
620 | - iconName: "ok" |
621 | - objectName: "save" |
622 | + property Component delegate: Component { |
623 | + AbstractButton { |
624 | + id: button |
625 | + action: modelData |
626 | + width: label.width + units.gu(4) |
627 | + height: parent.height |
628 | + Rectangle { |
629 | + color: parent.pressed ? UbuntuColors.coolGrey : UbuntuColors.slate |
630 | + opacity: 0.1 |
631 | + anchors.fill: parent |
632 | + visible: button.pressed |
633 | + } |
634 | + Label { |
635 | + anchors.centerIn: parent |
636 | + id: label |
637 | + text: action.text |
638 | + font.weight: text === i18n.tr("Save") ? Font.Normal : Font.Light |
639 | + } |
640 | + } |
641 | + } |
642 | + leadingActionBar { |
643 | + anchors.leftMargin: 0 |
644 | + actions: Action { |
645 | + text: i18n.tr("Cancel") |
646 | + iconName: "close" |
647 | + shortcut: "Esc" |
648 | + onTriggered: root.cancel() |
649 | + } |
650 | + delegate: pageHeader.delegate |
651 | + } |
652 | + trailingActionBar { |
653 | + anchors.rightMargin: 0 |
654 | + actions: Action { |
655 | text: i18n.tr("Save") |
656 | + iconName: "tick" |
657 | + shortcut: "Ctrl+S" |
658 | enabled: !!titleEdit.text.trim() |
659 | - onTriggered: saveToQtPim(); |
660 | + onTriggered: saveToQtPim() |
661 | } |
662 | - ] |
663 | + delegate: pageHeader.delegate |
664 | + } |
665 | } |
666 | |
667 | Component{ |
668 | @@ -389,7 +397,6 @@ |
669 | |
670 | Flickable{ |
671 | id: flickable |
672 | - clip: true |
673 | |
674 | property var activeItem: null |
675 | |
676 | @@ -419,11 +426,11 @@ |
677 | flickable.returnToBounds() |
678 | } |
679 | |
680 | + clip: true |
681 | flickableDirection: Flickable.VerticalFlick |
682 | anchors{ |
683 | left: parent.left |
684 | - top: parent.top |
685 | - topMargin: pageHeader.height |
686 | + top: parent.header.bottom |
687 | right: parent.right |
688 | bottom: keyboardRectangle.top |
689 | } |
690 | @@ -437,7 +444,8 @@ |
691 | |
692 | NewEventTimePicker{ |
693 | id: startDateTimeInput |
694 | - header: i18n.tr("From") |
695 | + //TRANSLATORS: this referes to date. eg: From: Wendsday, 9 March 2016 |
696 | + headerText: i18n.tr("From") |
697 | showTimePicker: !allDayEventCheckbox.checked |
698 | anchors { |
699 | left: parent.left |
700 | @@ -450,7 +458,8 @@ |
701 | |
702 | NewEventTimePicker{ |
703 | id: endDateTimeInput |
704 | - header: i18n.tr("To") |
705 | + //TRANSLATORS: this referes to date. eg: To: Wendsday, 9 March 2016 |
706 | + headerText: i18n.tr("To") |
707 | showTimePicker: !allDayEventCheckbox.checked |
708 | anchors { |
709 | left: parent.left |
710 | @@ -461,184 +470,186 @@ |
711 | } |
712 | } |
713 | |
714 | - ListItems.Standard { |
715 | - anchors { |
716 | - left: parent.left |
717 | - right: parent.right |
718 | - } |
719 | - |
720 | - text: i18n.tr("All day event") |
721 | - showDivider: false |
722 | - control: CheckBox { |
723 | - objectName: "allDayEventCheckbox" |
724 | - id: allDayEventCheckbox |
725 | - checked: false |
726 | - } |
727 | - } |
728 | - |
729 | - ListItems.ThinDivider {} |
730 | - |
731 | - Column { |
732 | - width: parent.width |
733 | - spacing: units.gu(1) |
734 | - |
735 | - ListItems.Header{ |
736 | - text: i18n.tr("Event Details") |
737 | - } |
738 | - |
739 | - TextField { |
740 | - id: titleEdit |
741 | - objectName: "newEventName" |
742 | - |
743 | - anchors { |
744 | - left: parent.left |
745 | - right: parent.right |
746 | - margins: units.gu(2) |
747 | - } |
748 | - |
749 | - inputMethodHints: Qt.ImhNoPredictiveText |
750 | - placeholderText: i18n.tr("Event Name") |
751 | - onFocusChanged: { |
752 | - if(titleEdit.focus) { |
753 | - flickable.makeMeVisible(titleEdit); |
754 | - } |
755 | - } |
756 | - } |
757 | - |
758 | - TextArea{ |
759 | - id: messageEdit |
760 | - objectName: "eventDescriptionInput" |
761 | - |
762 | - anchors { |
763 | - left: parent.left |
764 | - right: parent.right |
765 | - margins: units.gu(2) |
766 | - } |
767 | - |
768 | - placeholderText: i18n.tr("Description") |
769 | - onFocusChanged: { |
770 | - if(messageEdit.focus) { |
771 | - flickable.makeMeVisible(messageEdit); |
772 | - } |
773 | - } |
774 | - } |
775 | - |
776 | - TextField { |
777 | - id: locationEdit |
778 | - objectName: "eventLocationInput" |
779 | - |
780 | - anchors { |
781 | - left: parent.left |
782 | - right: parent.right |
783 | - margins: units.gu(2) |
784 | - } |
785 | - |
786 | - inputMethodHints: Qt.ImhNoPredictiveText |
787 | - placeholderText: i18n.tr("Location") |
788 | - |
789 | - onFocusChanged: { |
790 | - if(locationEdit.focus) { |
791 | - flickable.makeMeVisible(locationEdit); |
792 | - } |
793 | - } |
794 | - } |
795 | - } |
796 | - |
797 | - Column { |
798 | - width: parent.width |
799 | - spacing: units.gu(1) |
800 | - |
801 | - ListItems.Header { |
802 | - text: i18n.tr("Calendar") |
803 | - } |
804 | - |
805 | - OptionSelector{ |
806 | - id: calendarsOption |
807 | - objectName: "calendarsOption" |
808 | - |
809 | - anchors { |
810 | - left: parent.left |
811 | - right: parent.right |
812 | - margins: units.gu(2) |
813 | - } |
814 | - |
815 | - containerHeight: itemHeight * 4 |
816 | - model: root.model.getWritableCollections(); |
817 | - |
818 | - delegate: OptionSelectorDelegate{ |
819 | - text: modelData.name |
820 | - |
821 | - UbuntuShape{ |
822 | - id: calColor |
823 | - width: height |
824 | - height: parent.height - units.gu(2) |
825 | - color: modelData.color |
826 | - anchors { |
827 | - right: parent.right |
828 | - rightMargin: units.gu(4) |
829 | - verticalCenter: parent.verticalCenter |
830 | - } |
831 | - } |
832 | - } |
833 | - onExpandedChanged: Qt.inputMethod.hide(); |
834 | - } |
835 | - } |
836 | - |
837 | - Column { |
838 | - width: parent.width |
839 | - spacing: units.gu(1) |
840 | - |
841 | - ListItems.Header { |
842 | - text: i18n.tr("Guests") |
843 | - } |
844 | - |
845 | - Button{ |
846 | - id: addGuestButton |
847 | - objectName: "addGuestButton" |
848 | - |
849 | - property var contactsPopup: null |
850 | - |
851 | - text: i18n.tr("Add Guest") |
852 | - anchors { |
853 | - left: parent.left |
854 | - right: parent.right |
855 | - margins: units.gu(2) |
856 | - } |
857 | - |
858 | - onClicked: { |
859 | - if (contactsPopup) |
860 | - return |
861 | - |
862 | - flickable.makeMeVisible(addGuestButton) |
863 | - contactsPopup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), addGuestButton); |
864 | - contactsPopup.contactSelected.connect( function(contact, emailAddress) { |
865 | - if(!internal.isContactAlreadyAdded(contact, emailAddress) ) { |
866 | - var t = internal.contactToAttendee(contact, emailAddress); |
867 | - contactModel.append({"contact": t}); |
868 | - } |
869 | - |
870 | - }); |
871 | - contactsPopup.Component.onDestruction.connect( function() { |
872 | - addGuestButton.contactsPopup = null |
873 | - }) |
874 | - } |
875 | - } |
876 | - |
877 | - UbuntuShape { |
878 | - anchors { |
879 | - left: parent.left |
880 | - right: parent.right |
881 | - margins: units.gu(2) |
882 | - } |
883 | - |
884 | - height: contactList.height |
885 | + // All day event ListItem with Switch |
886 | + ListItem { |
887 | + width: parent.width |
888 | + |
889 | + ListItemLayout { |
890 | + title.text: i18n.tr("All day event") |
891 | + Switch { |
892 | + id: allDayEventCheckbox |
893 | + checked: false |
894 | + SlotsLayout.position: SlotsLayout.Trailing; |
895 | + } |
896 | + } |
897 | + onClicked: { |
898 | + Haptics.play() |
899 | + allDayEventCheckbox.checked = !allDayEventCheckbox.checked |
900 | + } |
901 | + |
902 | + } |
903 | + |
904 | + // ListItem which holds "Event details" label + TextField + TextArea + TextField |
905 | + ListItem { |
906 | + height: eventDetailsColumn.height + (eventDetailsColumn.anchors.margins*2) |
907 | + |
908 | + Column { |
909 | + id: eventDetailsColumn |
910 | + spacing: units.gu(2) |
911 | + anchors { |
912 | + left: parent.left |
913 | + right: parent.right |
914 | + top: parent.top |
915 | + margins: units.gu(2) |
916 | + } |
917 | + |
918 | + Label { |
919 | + width: parent.width |
920 | + text: i18n.tr("Event details") |
921 | + elide: Text.ElideRight |
922 | + } |
923 | + |
924 | + TextField { |
925 | + id: titleEdit |
926 | + objectName: "newEventName" |
927 | + |
928 | + width: parent.width |
929 | + inputMethodHints: Qt.ImhNoPredictiveText |
930 | + placeholderText: i18n.tr("Event Name") |
931 | + |
932 | + onFocusChanged: { |
933 | + if(titleEdit.focus) { |
934 | + flickable.makeMeVisible(titleEdit); |
935 | + } |
936 | + } |
937 | + } |
938 | + |
939 | + TextArea{ |
940 | + id: messageEdit |
941 | + objectName: "eventDescriptionInput" |
942 | + |
943 | + width: parent.width |
944 | + placeholderText: i18n.tr("Description") |
945 | + |
946 | + onFocusChanged: { |
947 | + if(messageEdit.focus) { |
948 | + flickable.makeMeVisible(messageEdit); |
949 | + } |
950 | + } |
951 | + } |
952 | + |
953 | + TextField { |
954 | + id: locationEdit |
955 | + objectName: "eventLocationInput" |
956 | + |
957 | + width: parent.width |
958 | + inputMethodHints: Qt.ImhNoPredictiveText |
959 | + placeholderText: i18n.tr("Location") |
960 | + |
961 | + onFocusChanged: { |
962 | + if(locationEdit.focus) { |
963 | + flickable.makeMeVisible(locationEdit); |
964 | + } |
965 | + } |
966 | + } |
967 | + } |
968 | + } |
969 | + |
970 | + // ListItem to hold calendars selector |
971 | + ListItem { |
972 | + height: chooseCalendarColumn.height + (eventDetailsColumn.anchors.topMargin*2) |
973 | + |
974 | + Column { |
975 | + id: chooseCalendarColumn |
976 | + spacing: units.gu(2) |
977 | + anchors { |
978 | + left: parent.left |
979 | + right: parent.right |
980 | + top: parent.top |
981 | + topMargin: units.gu(2) |
982 | + } |
983 | + |
984 | + Label { |
985 | + width: parent.width |
986 | + anchors { |
987 | + left: parent.left |
988 | + leftMargin: units.gu(2) |
989 | + right: parent.right |
990 | + rightMargin: units.gu(2) |
991 | + } |
992 | + text: i18n.tr("Choose calendar") |
993 | + elide: Text.ElideRight |
994 | + } |
995 | + |
996 | + ListItems.ItemSelector { |
997 | + id: calendarsOption |
998 | + model: root.model.getWritableCollections(); |
999 | + delegate: OptionSelectorDelegate { text: modelData.name } |
1000 | + } |
1001 | + |
1002 | + } |
1003 | + } |
1004 | + |
1005 | + |
1006 | + ListItem { |
1007 | + height: guestsColumn.height + (guestsColumn.anchors.margins*2) |
1008 | + |
1009 | + Column { |
1010 | + id: guestsColumn |
1011 | + spacing: units.gu(2) |
1012 | + anchors { |
1013 | + left: parent.left |
1014 | + right: parent.right |
1015 | + top: parent.top |
1016 | + margins: units.gu(2) |
1017 | + } |
1018 | + |
1019 | + Label { |
1020 | + width: parent.width |
1021 | + text: i18n.tr("Guests") |
1022 | + elide: Text.ElideRight |
1023 | + } |
1024 | + |
1025 | + Button{ |
1026 | + id: addGuestButton |
1027 | + objectName: "addGuestButton" |
1028 | + |
1029 | + property var contactsPopup: null |
1030 | + |
1031 | + text: i18n.tr("Add Guest") |
1032 | + anchors { left: parent.left; right: parent.right } |
1033 | + |
1034 | + onClicked: { |
1035 | + if (contactsPopup) |
1036 | + return |
1037 | + |
1038 | + flickable.makeMeVisible(addGuestButton) |
1039 | + contactsPopup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), addGuestButton); |
1040 | + contactsPopup.contactSelected.connect( function(contact, emailAddress) { |
1041 | + if(!internal.isContactAlreadyAdded(contact, emailAddress) ) { |
1042 | + var t = internal.contactToAttendee(contact, emailAddress); |
1043 | + contactModel.append({"contact": t}); |
1044 | + } |
1045 | + |
1046 | + }); |
1047 | + contactsPopup.Component.onDestruction.connect( function() { |
1048 | + addGuestButton.contactsPopup = null |
1049 | + }) |
1050 | + } |
1051 | + } |
1052 | + |
1053 | |
1054 | Column{ |
1055 | id: contactList |
1056 | objectName: "guestList" |
1057 | |
1058 | - spacing: units.gu(1) |
1059 | - width: parent.width |
1060 | + anchors { |
1061 | + left: parent.left; |
1062 | + leftMargin: units.gu(-2); |
1063 | + right: parent.right; |
1064 | + rightMargin: units.gu(-2); |
1065 | + |
1066 | + } |
1067 | clip: true |
1068 | |
1069 | ListModel{ |
1070 | @@ -650,7 +661,11 @@ |
1071 | delegate: ListItem { |
1072 | objectName: "eventGuest%1".arg(index) |
1073 | |
1074 | + height: guestListItemLayout.height |
1075 | + divider.visible: false |
1076 | + |
1077 | ListItemLayout { |
1078 | + id: guestListItemLayout |
1079 | title.text: contact.name |
1080 | subtitle.text: contact.emailAddress |
1081 | } |
1082 | @@ -666,27 +681,28 @@ |
1083 | } |
1084 | } |
1085 | } |
1086 | - } |
1087 | - |
1088 | - ListItems.ThinDivider { |
1089 | - visible: (event != undefined) && (event.itemType === Type.Event) |
1090 | - } |
1091 | - |
1092 | + |
1093 | + //TODO// |
1094 | + ///////////////// |
1095 | + |
1096 | + } |
1097 | } |
1098 | |
1099 | - ListItems.Subtitled{ |
1100 | + |
1101 | + ListItem { |
1102 | id:thisHappens |
1103 | objectName :"thisHappens" |
1104 | |
1105 | - anchors { |
1106 | - left: parent.left |
1107 | + height: thisHappensLayout.height |
1108 | + |
1109 | + ListItemLayout { |
1110 | + id: thisHappensLayout |
1111 | + title.text: i18n.tr("Repeats") |
1112 | + summary.text: (event != undefined) && (event.itemType === Type.Event) ? rule === null ? i18n.tr(Defines.recurrenceLabel[0]) |
1113 | + : eventUtils.getRecurrenceString(rule) |
1114 | + : "" |
1115 | + ProgressionSlot {} |
1116 | } |
1117 | - |
1118 | - showDivider: false |
1119 | - progression: true |
1120 | - visible: (event != undefined) && (event.itemType === Type.Event) |
1121 | - text: i18n.tr("Repeats") |
1122 | - subText: (event != undefined) && (event.itemType === Type.Event) ? rule === null ? Defines.recurrenceLabel[0] : eventUtils.getRecurrenceString(rule) : "" |
1123 | onClicked: { |
1124 | var stack = pageStack |
1125 | if (!stack) |
1126 | @@ -696,41 +712,23 @@ |
1127 | } |
1128 | } |
1129 | |
1130 | - ListItems.ThinDivider { |
1131 | - visible: (event != undefined) && (event.itemType === Type.Event) |
1132 | - } |
1133 | |
1134 | - ListItems.Subtitled{ |
1135 | + ListItem { |
1136 | id:eventReminder |
1137 | objectName : "eventReminder" |
1138 | |
1139 | - anchors.left:parent.left |
1140 | - showDivider: false |
1141 | - progression: true |
1142 | - text: i18n.tr("Reminder") |
1143 | - |
1144 | - RemindersModel { |
1145 | - id: reminderModel |
1146 | - } |
1147 | - |
1148 | - subText:{ |
1149 | - if(visualReminder.secondsBeforeStart !== -1) { |
1150 | - for( var i=0; i<reminderModel.count; i++ ) { |
1151 | - if(visualReminder.secondsBeforeStart === reminderModel.get(i).value) { |
1152 | - return reminderModel.get(i).label |
1153 | - } |
1154 | - } |
1155 | - } else { |
1156 | - return reminderModel.get(0).label |
1157 | - } |
1158 | - |
1159 | - } |
1160 | - |
1161 | - onClicked:{ |
1162 | + height: eventReminderLayout.height |
1163 | + |
1164 | + ListItemLayout { |
1165 | + id: eventReminderLayout |
1166 | + title.text: i18n.tr("Reminder") |
1167 | + subtitle.text: i18n.tr("%1").arg(reminderModel.getSelectedReminder()) |
1168 | + ProgressionSlot {} |
1169 | + } |
1170 | + |
1171 | + onClicked: { |
1172 | var stack = pageStack |
1173 | - if (!stack) |
1174 | - stack = bottomEdgePageStack |
1175 | - |
1176 | + if (!stack) stack = bottomEdgePageStack |
1177 | stack.push(Qt.resolvedUrl("EventReminder.qml"), |
1178 | {"visualReminder": visualReminder, |
1179 | "audibleReminder": audibleReminder, |
1180 | @@ -739,8 +737,15 @@ |
1181 | } |
1182 | } |
1183 | |
1184 | - ListItems.ThinDivider {} |
1185 | } |
1186 | + |
1187 | + |
1188 | + } |
1189 | + |
1190 | + // Scrollbar |
1191 | + Scrollbar{ |
1192 | + flickableItem: flickable |
1193 | + align: Qt.AlignTrailing |
1194 | } |
1195 | |
1196 | // used to keep the field visible when the keyboard appear or dismiss |
1197 | |
1198 | === removed file 'NewEventEntryField.qml' |
1199 | --- NewEventEntryField.qml 2016-01-29 14:47:31 +0000 |
1200 | +++ NewEventEntryField.qml 1970-01-01 00:00:00 +0000 |
1201 | @@ -1,38 +0,0 @@ |
1202 | -/* |
1203 | - * Copyright (C) 2013-2014 Canonical Ltd |
1204 | - * |
1205 | - * This file is part of Ubuntu Calendar App |
1206 | - * |
1207 | - * Ubuntu Calendar App is free software: you can redistribute it and/or modify |
1208 | - * it under the terms of the GNU General Public License version 3 as |
1209 | - * published by the Free Software Foundation. |
1210 | - * |
1211 | - * Ubuntu Calendar App is distributed in the hope that it will be useful, |
1212 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1213 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1214 | - * GNU General Public License for more details. |
1215 | - * |
1216 | - * You should have received a copy of the GNU General Public License |
1217 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1218 | - */ |
1219 | - |
1220 | -import QtQuick 2.4 |
1221 | -import Ubuntu.Components 1.3 |
1222 | - |
1223 | -Label { |
1224 | - id: root |
1225 | - |
1226 | - property bool highlighted: false |
1227 | - |
1228 | - height: units.gu(6) |
1229 | - |
1230 | - verticalAlignment: Text.AlignVCenter |
1231 | - color: highlighted ? "#2C001E" : Theme.palette.normal.baseText |
1232 | - |
1233 | - Rectangle { |
1234 | - z: -1 |
1235 | - anchors.fill: parent |
1236 | - color: root.highlighted ? Theme.palette.selected.background |
1237 | - : "Transparent" |
1238 | - } |
1239 | -} |
1240 | |
1241 | === modified file 'NewEventTimePicker.qml' |
1242 | --- NewEventTimePicker.qml 2016-01-25 17:52:33 +0000 |
1243 | +++ NewEventTimePicker.qml 2016-03-15 21:24:54 +0000 |
1244 | @@ -1,75 +1,111 @@ |
1245 | import QtQuick 2.4 |
1246 | -import Ubuntu.Components.ListItems 1.0 as ListItem |
1247 | +import Ubuntu.Components 1.3 |
1248 | import Ubuntu.Components.Themes.Ambiance 1.0 |
1249 | -import Ubuntu.Components.Pickers 1.0 |
1250 | +import Ubuntu.Components.Pickers 1.3 |
1251 | +//import QtQuick.Layouts 1.1 |
1252 | |
1253 | -Column { |
1254 | +ListItem { |
1255 | id: dateTimeInput |
1256 | - property alias header: listHeader.text |
1257 | - |
1258 | - property date dateTime; |
1259 | - property bool showTimePicker; |
1260 | + |
1261 | + property string headerText //header label ("From" or "To") |
1262 | + property date dateTime //keep date from DatePicker |
1263 | + property bool showTimePicker //if true then user is able to set time on event |
1264 | + |
1265 | + // when new date set in DatePicker then this will be run. |
1266 | + onDateTimeChanged: { |
1267 | + layout.summary.text = dateTime.toLocaleDateString() // set date |
1268 | + secondLabel.text = Qt.formatTime(dateTime, "hh:mm AP").replace(/\./g, "") // set time |
1269 | + } |
1270 | |
1271 | function clearFocus() { |
1272 | - dateInput.focus = false; |
1273 | - timeInput.focus = false; |
1274 | + dateBG.focus = false; |
1275 | + timeBG.focus = false; |
1276 | } |
1277 | |
1278 | + // function to open date/time picker |
1279 | function openDatePicker (element, caller, callerProperty, mode) { |
1280 | element.highlighted = true; |
1281 | var picker = PickerPanel.openDatePicker(caller, callerProperty, mode); |
1282 | if (!picker) return; |
1283 | - picker.closed.connect(function () { |
1284 | - element.highlighted = false; |
1285 | - }); |
1286 | - } |
1287 | - |
1288 | - onDateTimeChanged: { |
1289 | - dateInput.text = dateTime.toLocaleDateString(); |
1290 | - timeInput.text = Qt.formatTime(dateTime); |
1291 | - } |
1292 | - |
1293 | - ListItem.Header { |
1294 | - id: listHeader |
1295 | - } |
1296 | - |
1297 | - Item { |
1298 | - anchors { |
1299 | - left: parent.left |
1300 | - right: parent.right |
1301 | - margins: units.gu(2) |
1302 | - } |
1303 | - |
1304 | - height: dateInput.height |
1305 | - |
1306 | - NewEventEntryField{ |
1307 | - id: dateInput |
1308 | - objectName: "dateInput" |
1309 | - |
1310 | - text: "" |
1311 | - anchors.left: parent.left |
1312 | - width: !showTimePicker ? parent.width : 4 * parent.width / 5 |
1313 | - |
1314 | - MouseArea{ |
1315 | - anchors.fill: parent |
1316 | - onClicked: openDatePicker(dateInput, dateTimeInput, "dateTime", "Years|Months|Days") |
1317 | - } |
1318 | - } |
1319 | - |
1320 | - NewEventEntryField{ |
1321 | - id: timeInput |
1322 | - objectName: "timeInput" |
1323 | - |
1324 | - text: "" |
1325 | - anchors.right: parent.right |
1326 | - width: parent.width / 5 |
1327 | + picker.closed.connect(function () { element.highlighted = false; }); |
1328 | + } |
1329 | + |
1330 | + height: layout.height + divider.height |
1331 | + |
1332 | + // backgroud color of full date fabel, to be shown when user click on date and DatePicker is visable |
1333 | + Rectangle { |
1334 | + id: dateBG |
1335 | + |
1336 | + property bool highlighted: false |
1337 | + |
1338 | + height: layout.summary.height + units.gu(3.5) |
1339 | + width: showTimePicker ? layout.title.width + units.gu(3) : layout.width |
1340 | + anchors.bottom: parent.bottom |
1341 | + color: highlighted ? UbuntuColors.lightGrey : "transparent" |
1342 | + |
1343 | + Behavior on color { ColorAnimation {} } |
1344 | + } |
1345 | + |
1346 | + // backgroud color of time label, to be shown when user click on date and DatePicker is visable |
1347 | + Rectangle { |
1348 | + id: timeBG |
1349 | + |
1350 | + property bool highlighted: false |
1351 | + |
1352 | + height: dateBG.height |
1353 | + width: slot.width + units.gu(4) |
1354 | + anchors.bottom: parent.bottom |
1355 | + anchors.right: parent.right |
1356 | + color: highlighted ? UbuntuColors.lightGrey : "transparent" |
1357 | + |
1358 | + Behavior on color { ColorAnimation {} } |
1359 | + } |
1360 | + |
1361 | + // ListItemLayout to keep full date label and time label |
1362 | + ListItemLayout { |
1363 | + id: layout |
1364 | + |
1365 | + title.text: headerText |
1366 | + title.color: Theme.palette.selected.overlayText |
1367 | + title.font.pixelSize: FontUtils.sizeToPixels("small") |
1368 | + subtitle.text: " " |
1369 | + summary.color: dateBG.highlighted ? "white" : Theme.palette.selected.fieldText |
1370 | + summary.font.pixelSize: FontUtils.sizeToPixels("medium") |
1371 | + |
1372 | + Behavior on summary.color { ColorAnimation {} } |
1373 | + |
1374 | + // Item to hold Trailing tile label item |
1375 | + Item { |
1376 | + id: slot |
1377 | + |
1378 | + width: secondLabel.width |
1379 | + height: parent.height |
1380 | visible: showTimePicker |
1381 | - horizontalAlignment: Text.AlignRight |
1382 | - |
1383 | - MouseArea{ |
1384 | - anchors.fill: parent |
1385 | - onClicked: openDatePicker(timeInput, dateTimeInput, "dateTime", "Hours|Minutes") |
1386 | + SlotsLayout.overrideVerticalPositioning: true |
1387 | + |
1388 | + // label to keep time [ 10:20 AM ] |
1389 | + Label { |
1390 | + id: secondLabel |
1391 | + |
1392 | + fontSize: "medium" |
1393 | + color: timeBG.highlighted ? "white" : Theme.palette.selected.fieldText |
1394 | + y: layout.mainSlot.y + layout.summary.y + layout.summary.baselineOffset - baselineOffset |
1395 | + Behavior on color { ColorAnimation {} } |
1396 | } |
1397 | } |
1398 | } |
1399 | + |
1400 | + // AbstractButton to be triggered when user click on full date |
1401 | + AbstractButton { |
1402 | + anchors.fill: dateBG |
1403 | + onClicked: { openDatePicker(dateBG, dateTimeInput, "dateTime", "Years|Months|Days")} |
1404 | + } |
1405 | + |
1406 | + // AbstractButton to be triggered when user click on time |
1407 | + AbstractButton { |
1408 | + anchors.fill: timeBG |
1409 | + visible: showTimePicker |
1410 | + onClicked: { openDatePicker(timeBG, dateTimeInput, "dateTime", "Hours|Minutes")} |
1411 | + } |
1412 | + |
1413 | } |
1414 | |
1415 | === modified file 'RemindersModel.qml' |
1416 | --- RemindersModel.qml 2016-03-14 14:30:16 +0000 |
1417 | +++ RemindersModel.qml 2016-03-15 21:24:54 +0000 |
1418 | @@ -40,5 +40,17 @@ |
1419 | reminderModel.append({ "label": i18n.tr("2 weeks"), "value": 1209600 }) |
1420 | reminderModel.loaded() |
1421 | } |
1422 | + |
1423 | + function getSelectedReminder() { |
1424 | + if(visualReminder.secondsBeforeStart !== -1) { |
1425 | + for( var i=0; i<reminderModel.count; i++ ) { |
1426 | + if(visualReminder.secondsBeforeStart === reminderModel.get(i).value) { |
1427 | + return reminderModel.get(i).label |
1428 | + } |
1429 | + } |
1430 | + } else { |
1431 | + return reminderModel.get(0).label |
1432 | + } |
1433 | + } |
1434 | } |
1435 | |
1436 | |
1437 | === modified file 'po/com.ubuntu.calendar.pot' |
1438 | --- po/com.ubuntu.calendar.pot 2016-03-03 22:32:56 +0000 |
1439 | +++ po/com.ubuntu.calendar.pot 2016-03-15 21:24:54 +0000 |
1440 | @@ -8,7 +8,7 @@ |
1441 | msgstr "" |
1442 | "Project-Id-Version: \n" |
1443 | "Report-Msgid-Bugs-To: \n" |
1444 | -"POT-Creation-Date: 2016-03-04 04:02+0530\n" |
1445 | +"POT-Creation-Date: 2016-03-15 12:32+0000\n" |
1446 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
1447 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1448 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1449 | @@ -18,7 +18,7 @@ |
1450 | "Content-Transfer-Encoding: 8bit\n" |
1451 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" |
1452 | |
1453 | -#: ../AgendaView.qml:50 ../calendar.qml:292 ../calendar.qml:518 |
1454 | +#: ../AgendaView.qml:50 ../calendar.qml:321 ../calendar.qml:547 |
1455 | msgid "Agenda" |
1456 | msgstr "" |
1457 | |
1458 | @@ -57,8 +57,10 @@ |
1459 | #. where it's shown has limited space |
1460 | #: ../AllDayEventComponent.qml:150 |
1461 | #, qt-format |
1462 | -msgid "%1 ev." |
1463 | -msgstr "" |
1464 | +msgid "%1 event" |
1465 | +msgid_plural "%1 events" |
1466 | +msgstr[0] "" |
1467 | +msgstr[1] "" |
1468 | |
1469 | #. TRANSLATORS: the argument refers to the number of all day events |
1470 | #: ../AllDayEventComponent.qml:154 |
1471 | @@ -68,7 +70,7 @@ |
1472 | msgstr[0] "" |
1473 | msgstr[1] "" |
1474 | |
1475 | -#: ../CalendarChoicePopup.qml:34 ../EventActions.qml:51 |
1476 | +#: ../CalendarChoicePopup.qml:34 ../EventActions.qml:52 |
1477 | msgid "Calendars" |
1478 | msgstr "" |
1479 | |
1480 | @@ -78,11 +80,11 @@ |
1481 | |
1482 | #. TRANSLATORS: Please translate this string to 15 characters only. |
1483 | #. Currently ,there is no way we can increase width of action menu currently. |
1484 | -#: ../CalendarChoicePopup.qml:48 ../EventActions.qml:36 |
1485 | +#: ../CalendarChoicePopup.qml:48 ../EventActions.qml:37 |
1486 | msgid "Sync" |
1487 | msgstr "" |
1488 | |
1489 | -#: ../CalendarChoicePopup.qml:48 ../EventActions.qml:36 |
1490 | +#: ../CalendarChoicePopup.qml:48 ../EventActions.qml:37 |
1491 | msgid "Syncing" |
1492 | msgstr "" |
1493 | |
1494 | @@ -95,7 +97,7 @@ |
1495 | msgstr "" |
1496 | |
1497 | #: ../ColorPickerDialog.qml:55 ../DeleteConfirmationDialog.qml:60 |
1498 | -#: ../EditEventConfirmationDialog.qml:53 ../NewEvent.qml:340 |
1499 | +#: ../EditEventConfirmationDialog.qml:53 ../NewEvent.qml:362 |
1500 | msgid "Cancel" |
1501 | msgstr "" |
1502 | |
1503 | @@ -107,23 +109,17 @@ |
1504 | msgid "Search contact" |
1505 | msgstr "" |
1506 | |
1507 | -#: ../DayView.qml:71 ../MonthView.qml:50 ../WeekView.qml:54 ../YearView.qml:57 |
1508 | +#: ../DayView.qml:72 ../MonthView.qml:50 ../WeekView.qml:55 ../YearView.qml:57 |
1509 | msgid "Today" |
1510 | msgstr "" |
1511 | |
1512 | #. TRANSLATORS: this is a time formatting string, |
1513 | #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions. |
1514 | #. It's used in the header of the month and week views |
1515 | -#: ../DayView.qml:115 ../DayView.qml:203 ../MonthView.qml:78 |
1516 | -#: ../WeekView.qml:137 ../WeekView.qml:256 |
1517 | +#: ../DayView.qml:122 ../MonthView.qml:78 ../WeekView.qml:144 |
1518 | msgid "MMMM yyyy" |
1519 | msgstr "" |
1520 | |
1521 | -#: ../DayView.qml:201 ../MonthView.qml:73 ../WeekView.qml:254 |
1522 | -#, qt-format |
1523 | -msgid "%1 %2" |
1524 | -msgstr "" |
1525 | - |
1526 | #: ../DeleteConfirmationDialog.qml:31 |
1527 | msgid "Delete Recurring Event" |
1528 | msgstr "" |
1529 | @@ -151,11 +147,11 @@ |
1530 | msgid "Delete this" |
1531 | msgstr "" |
1532 | |
1533 | -#: ../DeleteConfirmationDialog.qml:51 ../NewEvent.qml:347 |
1534 | +#: ../DeleteConfirmationDialog.qml:51 |
1535 | msgid "Delete" |
1536 | msgstr "" |
1537 | |
1538 | -#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:335 |
1539 | +#: ../EditEventConfirmationDialog.qml:29 |
1540 | msgid "Edit Event" |
1541 | msgstr "" |
1542 | |
1543 | @@ -173,25 +169,25 @@ |
1544 | msgid "Edit this" |
1545 | msgstr "" |
1546 | |
1547 | -#: ../EventActions.qml:63 ../Settings.qml:29 |
1548 | +#: ../EventActions.qml:64 ../Settings.qml:29 |
1549 | msgid "Settings" |
1550 | msgstr "" |
1551 | |
1552 | #. TRANSLATORS: the first argument (%1) refers to a start time for an event, |
1553 | #. while the second one (%2) refers to the end time |
1554 | -#: ../EventBubble.qml:97 |
1555 | +#: ../EventBubble.qml:104 |
1556 | #, qt-format |
1557 | msgid "%1 - %2" |
1558 | msgstr "" |
1559 | |
1560 | #. TRANSLATORS: the first argument (%1) refers to a time for an event, |
1561 | #. while the second one (%2) refers to title of event |
1562 | -#: ../EventBubble.qml:108 ../EventBubble.qml:113 |
1563 | +#: ../EventBubble.qml:115 ../EventBubble.qml:120 |
1564 | #, qt-format |
1565 | msgid "%1 <b>%2</b>" |
1566 | msgstr "" |
1567 | |
1568 | -#: ../EventDetails.qml:44 ../NewEvent.qml:483 |
1569 | +#: ../EventDetails.qml:44 |
1570 | msgid "Event Details" |
1571 | msgstr "" |
1572 | |
1573 | @@ -235,38 +231,34 @@ |
1574 | msgid "Edit" |
1575 | msgstr "" |
1576 | |
1577 | -#: ../EventDetails.qml:389 ../NewEvent.qml:589 |
1578 | +#: ../EventDetails.qml:389 ../NewEvent.qml:615 |
1579 | msgid "Guests" |
1580 | msgstr "" |
1581 | |
1582 | -#: ../EventDetails.qml:432 ../EventReminder.qml:35 ../NewEvent.qml:701 |
1583 | +#: ../EventDetails.qml:432 ../EventReminder.qml:35 ../NewEvent.qml:754 |
1584 | msgid "Reminder" |
1585 | msgstr "" |
1586 | |
1587 | -#. TRANSLATORS: this refers to how often a recurrent event repeats |
1588 | -#. and it is shown as the header of the page to choose repetition |
1589 | -#. and as the header of the list item that shows the repetition |
1590 | -#. summary in the page that displays the event details |
1591 | -#: ../EventRepetition.qml:40 ../EventRepetition.qml:155 |
1592 | +#: ../EventRepetition.qml:43 ../EventRepetition.qml:175 |
1593 | msgid "Repeat" |
1594 | msgstr "" |
1595 | |
1596 | -#: ../EventRepetition.qml:174 |
1597 | +#: ../EventRepetition.qml:202 |
1598 | msgid "Repeats On:" |
1599 | msgstr "" |
1600 | |
1601 | -#: ../EventRepetition.qml:219 |
1602 | +#: ../EventRepetition.qml:254 |
1603 | msgid "Recurring event ends" |
1604 | msgstr "" |
1605 | |
1606 | #. TRANSLATORS: this refers to how often a recurrent event repeats |
1607 | #. and it is shown as the header of the option selector to choose |
1608 | #. its repetition |
1609 | -#: ../EventRepetition.qml:242 ../NewEvent.qml:685 |
1610 | +#: ../EventRepetition.qml:285 ../NewEvent.qml:730 |
1611 | msgid "Repeats" |
1612 | msgstr "" |
1613 | |
1614 | -#: ../EventRepetition.qml:267 |
1615 | +#: ../EventRepetition.qml:317 |
1616 | msgid "Date" |
1617 | msgstr "" |
1618 | |
1619 | @@ -314,58 +306,74 @@ |
1620 | msgid "Wk" |
1621 | msgstr "" |
1622 | |
1623 | -#: ../NewEvent.qml:171 |
1624 | +#: ../MonthView.qml:73 ../WeekView.qml:131 |
1625 | +#, qt-format |
1626 | +msgid "%1 %2" |
1627 | +msgstr "" |
1628 | + |
1629 | +#: ../NewEvent.qml:173 |
1630 | msgid "End time can't be before start time" |
1631 | msgstr "" |
1632 | |
1633 | -#: ../NewEvent.qml:335 ../NewEventBottomEdge.qml:52 |
1634 | -msgid "New Event" |
1635 | -msgstr "" |
1636 | - |
1637 | -#: ../NewEvent.qml:364 |
1638 | +#: ../NewEvent.qml:355 ../NewEvent.qml:372 |
1639 | msgid "Save" |
1640 | msgstr "" |
1641 | |
1642 | -#: ../NewEvent.qml:375 |
1643 | +#: ../NewEvent.qml:387 |
1644 | msgid "Error" |
1645 | msgstr "" |
1646 | |
1647 | -#: ../NewEvent.qml:377 |
1648 | +#: ../NewEvent.qml:389 |
1649 | msgid "OK" |
1650 | msgstr "" |
1651 | |
1652 | -#: ../NewEvent.qml:437 |
1653 | +#. TRANSLATORS: this referes to date. eg: From: Wendsday, 9 March 2016 |
1654 | +#: ../NewEvent.qml:454 |
1655 | msgid "From" |
1656 | msgstr "" |
1657 | |
1658 | -#: ../NewEvent.qml:450 |
1659 | +#. TRANSLATORS: this referes to date. eg: To: Wendsday, 9 March 2016 |
1660 | +#: ../NewEvent.qml:468 |
1661 | msgid "To" |
1662 | msgstr "" |
1663 | |
1664 | -#: ../NewEvent.qml:467 |
1665 | +#: ../NewEvent.qml:484 |
1666 | msgid "All day event" |
1667 | msgstr "" |
1668 | |
1669 | -#: ../NewEvent.qml:497 |
1670 | +#: ../NewEvent.qml:514 |
1671 | +msgid "Event details" |
1672 | +msgstr "" |
1673 | + |
1674 | +#: ../NewEvent.qml:524 |
1675 | msgid "Event Name" |
1676 | msgstr "" |
1677 | |
1678 | -#: ../NewEvent.qml:515 |
1679 | +#: ../NewEvent.qml:538 |
1680 | msgid "Description" |
1681 | msgstr "" |
1682 | |
1683 | -#: ../NewEvent.qml:534 |
1684 | +#: ../NewEvent.qml:553 |
1685 | msgid "Location" |
1686 | msgstr "" |
1687 | |
1688 | -#: ../NewEvent.qml:549 com.ubuntu.calendar_calendar.desktop.in.in.h:1 |
1689 | -msgid "Calendar" |
1690 | +#: ../NewEvent.qml:586 |
1691 | +msgid "Choose calendar" |
1692 | msgstr "" |
1693 | |
1694 | -#: ../NewEvent.qml:598 |
1695 | +#: ../NewEvent.qml:645 |
1696 | msgid "Add Guest" |
1697 | msgstr "" |
1698 | |
1699 | +#: ../NewEvent.qml:755 |
1700 | +#, qt-format |
1701 | +msgid "%1" |
1702 | +msgstr "" |
1703 | + |
1704 | +#: ../NewEventBottomEdge.qml:52 |
1705 | +msgid "New Event" |
1706 | +msgstr "" |
1707 | + |
1708 | #: ../RecurrenceLabelDefines.qml:23 |
1709 | msgid "Once" |
1710 | msgstr "" |
1711 | @@ -467,7 +475,7 @@ |
1712 | msgid "All Day" |
1713 | msgstr "" |
1714 | |
1715 | -#: ../WeekView.qml:131 ../WeekView.qml:132 |
1716 | +#: ../WeekView.qml:138 ../WeekView.qml:139 |
1717 | msgid "MMM" |
1718 | msgstr "" |
1719 | |
1720 | @@ -476,29 +484,33 @@ |
1721 | msgid "Year %1" |
1722 | msgstr "" |
1723 | |
1724 | -#: ../calendar.qml:46 |
1725 | +#: ../calendar.qml:48 |
1726 | msgid "" |
1727 | "Calendar app accept four arguments: --starttime, --endtime, --newevent and --" |
1728 | "eventid. They will be managed by system. See the source for a full comment " |
1729 | "about them" |
1730 | msgstr "" |
1731 | |
1732 | -#: ../calendar.qml:260 ../calendar.qml:434 |
1733 | +#: ../calendar.qml:289 ../calendar.qml:463 |
1734 | msgid "Year" |
1735 | msgstr "" |
1736 | |
1737 | -#: ../calendar.qml:268 ../calendar.qml:455 |
1738 | +#: ../calendar.qml:297 ../calendar.qml:484 |
1739 | msgid "Month" |
1740 | msgstr "" |
1741 | |
1742 | -#: ../calendar.qml:276 ../calendar.qml:476 |
1743 | +#: ../calendar.qml:305 ../calendar.qml:505 |
1744 | msgid "Week" |
1745 | msgstr "" |
1746 | |
1747 | -#: ../calendar.qml:284 ../calendar.qml:497 |
1748 | +#: ../calendar.qml:313 ../calendar.qml:526 |
1749 | msgid "Day" |
1750 | msgstr "" |
1751 | |
1752 | +#: com.ubuntu.calendar_calendar.desktop.in.in.h:1 |
1753 | +msgid "Calendar" |
1754 | +msgstr "" |
1755 | + |
1756 | #: com.ubuntu.calendar_calendar.desktop.in.in.h:2 |
1757 | msgid "A calendar for Ubuntu which syncs with online accounts." |
1758 | msgstr "" |
FAILED: Continuous integration, rev:773 /code.launchpad .net/~majster- pl/ubuntu- calendar- app/new- event-page/ +merge/ 288637/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/ /core-apps- jenkins. ubuntu. com/job/ calendar- app-ci/ 788/ /core-apps- jenkins. ubuntu. com/job/ generic- update- mp/738/ console
Executed test runs:
None: https:/
Click here to trigger a rebuild: /core-apps- jenkins. ubuntu. com/job/ calendar- app-ci/ 788/rebuild
https:/