Merge lp:~renatofilho/ubuntu-calendar-app/fix-add-guest-search-field into lp:ubuntu-calendar-app

Proposed by Renato Araujo Oliveira Filho
Status: Rejected
Rejected by: Renato Araujo Oliveira Filho
Proposed branch: lp:~renatofilho/ubuntu-calendar-app/fix-add-guest-search-field
Merge into: lp:ubuntu-calendar-app
Prerequisite: lp:~renatofilho/ubuntu-calendar-app/sdk-1-3
Diff against target: 343 lines (+117/-43)
3 files modified
ContactChoicePopup.qml (+51/-14)
KeyboardRectangle.qml (+1/-0)
NewEvent.qml (+65/-29)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-calendar-app/fix-add-guest-search-field
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Needs Fixing
Ubuntu Calendar Developers Pending
Review via email: mp+284121@code.launchpad.net

Commit message

Auto-focus search textfield when adding a guest.
Make sure that the popover stay visible when the keyboard appears.
Disabled auto-prediction for search field.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
749. By Renato Araujo Oliveira Filho

Use New ListItem API for guest list.

Update swipe actions to work using the ListItem.leadingActions

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
750. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/sdk-1-3

751. By Renato Araujo Oliveira Filho

Make sure that guest list still visible after the VKB appears.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
752. By Renato Araujo Oliveira Filho

Show a contact entry for each emailAddress in contact selection.
Does not allow select contacts with empty e-mail.

753. By Renato Araujo Oliveira Filho

Merged: ~renatofilho/ubuntu-calendar-app/sdk-1-3

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
754. By Renato Araujo Oliveira Filho

Trunk merged.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

it was merged in another MR.

Unmerged revisions

754. By Renato Araujo Oliveira Filho

Trunk merged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ContactChoicePopup.qml'
--- ContactChoicePopup.qml 2016-01-29 14:35:14 +0000
+++ ContactChoicePopup.qml 2016-02-10 13:30:08 +0000
@@ -29,7 +29,7 @@
29 id: root29 id: root
30 objectName: "contactPopover"30 objectName: "contactPopover"
3131
32 signal contactSelected(var contact);32 signal contactSelected(var contact, string emailAddress);
3333
34 Label {34 Label {
35 id: noContact35 id: noContact
@@ -40,24 +40,27 @@
4040
41 UnionFilter {41 UnionFilter {
42 id: filter42 id: filter
43
44 property string searchString: ""
45
43 filters: [46 filters: [
44 DetailFilter{47 DetailFilter{
45 detail: ContactDetail.Name48 detail: ContactDetail.Name
46 field: Name.FirstName49 field: Name.FirstName
47 matchFlags: Filter.MatchContains50 matchFlags: Filter.MatchContains
48 value: searchBox.text51 value: filter.searchString
49 },52 },
50 DetailFilter{53 DetailFilter{
51 detail: ContactDetail.Name54 detail: ContactDetail.Name
52 field: Name.LastName55 field: Name.LastName
53 matchFlags: Filter.MatchContains56 matchFlags: Filter.MatchContains
54 value: searchBox.text57 value: filter.searchString
55 },58 },
56 DetailFilter{59 DetailFilter{
57 detail: ContactDetail.DisplayLabel60 detail: ContactDetail.DisplayLabel
58 field: DisplayLabel.Label61 field: DisplayLabel.Label
59 matchFlags: Filter.MatchContains62 matchFlags: Filter.MatchContains
60 value: searchBox.text63 value: filter.searchString
61 }64 }
62 ]65 ]
63 }66 }
@@ -69,6 +72,16 @@
69 autoUpdate: true72 autoUpdate: true
70 }73 }
7174
75 Timer {
76 id: idleSearch
77
78 interval: 500
79 repeat: false
80 onTriggered: {
81 filter.searchString = searchBox.text
82 }
83 }
84
72 Column {85 Column {
73 anchors.top: parent.top86 anchors.top: parent.top
74 anchors.left: parent.left87 anchors.left: parent.left
@@ -81,12 +94,16 @@
81 focus: true94 focus: true
82 width: parent.width95 width: parent.width
83 placeholderText: i18n.tr("Search contact")96 placeholderText: i18n.tr("Search contact")
97 inputMethodHints: Qt.ImhNoPredictiveText
84 primaryItem: Icon {98 primaryItem: Icon {
85 height: parent.height*0.599 height: parent.height*0.5
86 width: parent.height*0.5100 width: parent.height*0.5
87 anchors.verticalCenter: parent.verticalCenter101 anchors.verticalCenter: parent.verticalCenter
88 name:"find"102 name:"find"
89 }103 }
104 onTextChanged: {
105 idleSearch.restart()
106 }
90 }107 }
91108
92 ListView {109 ListView {
@@ -96,17 +113,37 @@
96 model: contactModel113 model: contactModel
97 height: units.gu(15)114 height: units.gu(15)
98 clip: true115 clip: true
99 delegate: Standard{116 delegate: Column {
100 objectName: "contactPopoverList%1".arg(index)117 width: contactList.width
101 property var item: contactModel.contacts[index]118 Repeater {
102 height: units.gu(4)119 anchors {
103 text: item ? item.displayLabel.label : ""120 left: parent.left
104121 right: parent.right
105 onClicked: {122 }
106 root.contactSelected(item);123 height: childrenRect.height
107 onClicked: PopupUtils.close(root)124
125 model: Math.max(1, contact.emails.length)
126 delegate: ListItem {
127 property string emailAddress: contact.emails.length > index ? contact.emails[index].emailAddress : ""
128
129 opacity: emailAddress.length > 0 ? 1.0 : 0.3
130 width: contactList.width
131 objectName: "contactPopoverList%1".arg(index)
132 ListItemLayout {
133 title.text: contact.displayLabel.label
134 subtitle.text: emailAddress
135 }
136 onClicked: {
137 if (emailAddress.length > 0) {
138 root.contactSelected(contact, emailAddress);
139 onClicked: PopupUtils.close(root)
140 }
141 }
142 }
108 }143 }
109 }144 }
110 }145 }
111 }146 }
147
148 Component.onCompleted: searchBox.forceActiveFocus()
112}149}
113150
=== modified file 'KeyboardRectangle.qml'
--- KeyboardRectangle.qml 2016-01-25 13:20:32 +0000
+++ KeyboardRectangle.qml 2016-02-10 13:30:08 +0000
@@ -20,6 +20,7 @@
2020
21Item {21Item {
22 id: keyboardRect22 id: keyboardRect
23
23 anchors.left: parent.left24 anchors.left: parent.left
24 anchors.right: parent.right25 anchors.right: parent.right
25 anchors.bottom: parent.bottom26 anchors.bottom: parent.bottom
2627
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-02-02 22:54:03 +0000
+++ NewEvent.qml 2016-02-10 13:30:08 +0000
@@ -20,7 +20,7 @@
20import QtOrganizer 5.020import QtOrganizer 5.0
21import Ubuntu.Components 1.321import Ubuntu.Components 1.3
22import Ubuntu.Components.Popups 1.022import Ubuntu.Components.Popups 1.0
23import Ubuntu.Components.ListItems 1.0 as ListItem23import Ubuntu.Components.ListItems 1.0 as ListItems
24import Ubuntu.Components.Themes.Ambiance 1.024import Ubuntu.Components.Themes.Ambiance 1.0
25import Ubuntu.Components.Pickers 1.025import Ubuntu.Components.Pickers 1.0
26import QtOrganizer 5.026import QtOrganizer 5.0
@@ -411,7 +411,7 @@
411 }411 }
412 }412 }
413413
414 ListItem.Standard {414 ListItems.Standard {
415 anchors {415 anchors {
416 left: parent.left416 left: parent.left
417 right: parent.right417 right: parent.right
@@ -426,13 +426,13 @@
426 }426 }
427 }427 }
428428
429 ListItem.ThinDivider {}429 ListItems.ThinDivider {}
430430
431 Column {431 Column {
432 width: parent.width432 width: parent.width
433 spacing: units.gu(1)433 spacing: units.gu(1)
434434
435 ListItem.Header{435 ListItems.Header{
436 text: i18n.tr("Event Details")436 text: i18n.tr("Event Details")
437 }437 }
438438
@@ -496,7 +496,7 @@
496 width: parent.width496 width: parent.width
497 spacing: units.gu(1)497 spacing: units.gu(1)
498498
499 ListItem.Header {499 ListItems.Header {
500 text: i18n.tr("Calendar")500 text: i18n.tr("Calendar")
501 }501 }
502502
@@ -534,29 +534,51 @@
534 width: parent.width534 width: parent.width
535 spacing: units.gu(1)535 spacing: units.gu(1)
536536
537 ListItem.Header {537 ListItems.Header {
538 text: i18n.tr("Guests")538 text: i18n.tr("Guests")
539 }539 }
540540
541 Button{541 Button{
542 id: addGuestButton
543 objectName: "addGuestButton"
544
545 property var contactsPopup: null
546
542 text: i18n.tr("Add Guest")547 text: i18n.tr("Add Guest")
543 objectName: "addGuestButton"
544
545 anchors {548 anchors {
546 left: parent.left549 left: parent.left
547 right: parent.right550 right: parent.right
548 margins: units.gu(2)551 margins: units.gu(2)
549 }552 }
550553
554 // WORKAROUND: causes the popover to follow the buttom position when keyboard appears
555 Connections {
556 target: keyboard
557 onHeightChanged: {
558 if (addGuestButton.contactsPopup) {
559 addGuestButton.contactsPopup.caller = null
560 addGuestButton.contactsPopup.caller = addGuestButton
561 }
562 }
563 }
564
551 onClicked: {565 onClicked: {
552 var popup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), contactList);566 if (contactsPopup)
553 popup.contactSelected.connect( function(contact) {567 return
554 var t = internal.contactToAttendee(contact);568
555 if( !internal.isContactAlreadyAdded(contact) ) {569 flickable.makeMeVisible(addGuestButton)
570 contactsPopup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), addGuestButton);
571 contactsPopup.contactSelected.connect( function(contact, emailAddress) {
572 if(!internal.isContactAlreadyAdded(contact, emailAddress) ) {
573 var t = internal.contactToAttendee(contact, emailAddress);
556 contactModel.append(t);574 contactModel.append(t);
557 contactList.array.push(t);575 contactList.array.push(t);
558 }576 }
577
559 });578 });
579 contactsPopup.Component.onDestruction.connect( function() {
580 addGuestButton.contactsPopup = null
581 })
560 }582 }
561 }583 }
562584
@@ -585,27 +607,35 @@
585607
586 Repeater{608 Repeater{
587 model: contactModel609 model: contactModel
588 delegate: ListItem.Standard {610 delegate: ListItem {
589 objectName: "eventGuest%1".arg(index)611 objectName: "eventGuest%1".arg(index)
590 height: units.gu(4)612
591 text: name613 ListItemLayout {
592 removable: true614 title.text: name
593 onItemRemoved: {615 subtitle.text: emailAddress
594 contactList.array.splice(index, 1)616 }
595 contactModel.remove(index)617
618 leadingActions: ListItemActions {
619 actions: Action {
620 iconName: "delete"
621 onTriggered: {
622 contactList.array.splice(index, 1)
623 contactModel.remove(index)
624 }
625 }
596 }626 }
597 }627 }
598 }628 }
599 }629 }
600 }630 }
601631
602 ListItem.ThinDivider {632 ListItems.ThinDivider {
603 visible: event.itemType === Type.Event633 visible: event.itemType === Type.Event
604 }634 }
605635
606 }636 }
607637
608 ListItem.Subtitled{638 ListItems.Subtitled{
609 id:thisHappens639 id:thisHappens
610 objectName :"thisHappens"640 objectName :"thisHappens"
611641
@@ -621,11 +651,11 @@
621 onClicked: pageStack.push(Qt.resolvedUrl("EventRepetition.qml"),{"eventRoot": root,"isEdit":isEdit});651 onClicked: pageStack.push(Qt.resolvedUrl("EventRepetition.qml"),{"eventRoot": root,"isEdit":isEdit});
622 }652 }
623653
624 ListItem.ThinDivider {654 ListItems.ThinDivider {
625 visible: event.itemType === Type.Event655 visible: event.itemType === Type.Event
626 }656 }
627657
628 ListItem.Subtitled{658 ListItems.Subtitled{
629 id:eventReminder659 id:eventReminder
630 objectName : "eventReminder"660 objectName : "eventReminder"
631661
@@ -658,7 +688,7 @@
658 "eventTitle": titleEdit.text})688 "eventTitle": titleEdit.text})
659 }689 }
660690
661 ListItem.ThinDivider {}691 ListItems.ThinDivider {}
662 }692 }
663 }693 }
664 // used to keep the field visible when the keyboard appear or dismiss694 // used to keep the field visible when the keyboard appear or dismiss
@@ -685,20 +715,26 @@
685 messageEdit.focus = false715 messageEdit.focus = false
686 }716 }
687717
688 function isContactAlreadyAdded(contact) {718 function isContactAlreadyAdded(contact, emailAddress) {
689 for(var i=0; i < contactList.array.length ; ++i) {719 for(var i=0; i < contactList.array.length ; ++i) {
690 var attendee = contactList.array[i];720 var attendee = contactList.array[i];
691 if( attendee.attendeeId === contact.contactId) {721 if (emailAddress.length > 0) {
692 return true;722 if (attendee.emailAddress === emailAddress) {
723 return true;
724 }
725 } else {
726 if (attendee.attendeeId === contact.contactId) {
727 return true
728 }
693 }729 }
694 }730 }
695 return false;731 return false;
696 }732 }
697733
698 function contactToAttendee(contact) {734 function contactToAttendee(contact, emailAddress) {
699 var attendee = Qt.createQmlObject("import QtOrganizer 5.0; EventAttendee{}", event, "NewEvent.qml");735 var attendee = Qt.createQmlObject("import QtOrganizer 5.0; EventAttendee{}", event, "NewEvent.qml");
700 attendee.name = contact.displayLabel.label736 attendee.name = contact.displayLabel.label
701 attendee.emailAddress = contact.email.emailAddress;737 attendee.emailAddress = emailAddress;
702 attendee.attendeeId = contact.contactId;738 attendee.attendeeId = contact.contactId;
703 return attendee;739 return attendee;
704 }740 }

Subscribers

People subscribed via source and target branches

to status/vote changes: