[Merge] lp:~boiko/dialer-app/use_history_contact_info into lp:dialer-app

Gustavo Pichorim Boiko gustavo.boiko at canonical.com
Fri Sep 12 21:09:53 UTC 2014



Diff comments:

> === modified file 'src/qml/DialerPage/KeypadEntry.qml'
> --- src/qml/DialerPage/KeypadEntry.qml	2014-07-31 14:59:34 +0000
> +++ src/qml/DialerPage/KeypadEntry.qml	2014-09-11 20:57:52 +0000
> @@ -68,7 +68,7 @@
>          font.pixelSize: maximumFontSize
>          font.family: "Ubuntu"
>          color: UbuntuColors.darkGrey
> -        focus: true
> +        focus: false
>          cursorVisible: true
>          clip: true
>          defaultRegion: PhoneUtils.defaultRegion
> 
> === modified file 'src/qml/HistoryPage/HistoryDelegate.qml'
> --- src/qml/HistoryPage/HistoryDelegate.qml	2014-08-20 18:53:45 +0000
> +++ src/qml/HistoryPage/HistoryDelegate.qml	2014-09-11 20:57:52 +0000
> @@ -29,11 +29,15 @@
>  ListItemWithActions {
>      id: historyDelegate
>  
> +    readonly property var participant: model.participants && model.participants[0] ? model.participants[0] : {}
>      readonly property bool incoming: model.senderId !== "self"
> -    readonly property bool unknownContact: contactWatcher.contactId === ""
> -    readonly property alias phoneNumber: contactWatcher.phoneNumber
> -    readonly property alias contactId: contactWatcher.contactId
> -    readonly property alias interactive: contactWatcher.interactive
> +    readonly property bool unknownContact: contactId === ""
> +    readonly property string phoneNumber: participant.phoneNumber ? participant.phoneNumber : ""
> +    readonly property string contactId: participant.contactId ? participant.contactId : ""
> +    readonly property bool interactive: participant.phoneNumber &&
> +                                        participant.phoneNumber !== "" &&
> +                                        participant.phoneNumber !== "x-ofono-private" &&
> +                                        participant.phoneNumber !== "x-ofono-unknown"
>  
>      property string phoneNumberSubTypeLabel: ""
>      property bool isFirst: false
> @@ -42,14 +46,14 @@
>  
>      function activate() {
>          // ignore private and unknown numbers
> -        if (model.participants[0] == "x-ofono-private" || model.participants[0] == "x-ofono-unknown") {
> +        if (!interactive) {
>              return;
>          }
>  
>          if (fullView && mainView.account) {
> -            mainView.call(model.participants[0], mainView.account.accountId);
> +            mainView.call(participant.phoneNumber, mainView.account.accountId);
>          } else {
> -            mainView.populateDialpad(model.participants[0], mainView.account ? mainView.account.accountId : "");
> +            mainView.populateDialpad(participant.phoneNumber, mainView.account ? mainView.account.accountId : "");
>          }
>      }
>  
> @@ -94,8 +98,8 @@
>          id: helper
>  
>          function updateSubTypeLabel() {
> -            var subLabel = contactWatcher.isUnknown
> -            if (model.participants && model.participants[0]) {
> +            var subLabel = "";
> +            if (participant && participant.phoneNumber) {

Fixed.

>                  var typeInfo = phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail))
>                  if (typeInfo) {
>                      subLabel = typeInfo.label
> @@ -106,19 +110,10 @@
>  
>          Component.onCompleted: updateSubTypeLabel()
>  
> -        ContactWatcher {
> -            id: contactWatcher
> -            // FIXME: handle conf calls
> -            phoneNumber: model.participants[0]
> -            onPhoneNumberContextsChanged: helper.updateSubTypeLabel()
> -            onPhoneNumberSubTypesChanged: helper.updateSubTypeLabel()
> -            onIsUnknownChanged: helper.updateSubTypeLabel()
> -        }
> -
>          PhoneNumber {
>              id: phoneDetail
> -            contexts: contactWatcher.phoneNumberContexts
> -            subTypes: contactWatcher.phoneNumberSubTypes
> +            contexts: participant.phoneContexts ? participant.phoneContexts : []
> +            subTypes: participant.phoneSubTypes ? participant.phoneSubTypes : []
>          }
>  
>          ContactDetailPhoneNumberTypeModel {
> @@ -150,8 +145,8 @@
>              bottom: parent.bottom
>          }
>          width: height
> -        fallbackAvatarUrl: contactWatcher.avatar === "" ? "image://theme/stock_contact" : contactWatcher.avatar
> -        fallbackDisplayName: contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber
> +        fallbackAvatarUrl: (participant.avatar  && participant.avatar !== "") ? participant.avatar : "image://theme/stock_contact"
> +        fallbackDisplayName: (participant.alias && participant.alias !== "") ? participant.alias : phoneNumber
>          showAvatarPicture: (fallbackAvatarUrl != "image://theme/stock_contact") || (initials.length === 0)
>      }
>  
> @@ -169,14 +164,14 @@
>          verticalAlignment: Text.AlignTop
>          fontSize: "medium"
>          text: {
> -            if (contactWatcher.phoneNumber == "x-ofono-private") {
> +            if (participant.phoneNumber == "x-ofono-private") {
>                  return i18n.tr("Private number")
> -            } else if (contactWatcher.phoneNumber == "x-ofono-unknown") {
> +            } else if (participant.phoneNumber == "x-ofono-unknown") {
>                  return i18n.tr("Unknown number")
> -            } else if (contactWatcher.alias != "") {
> -                return contactWatcher.alias
> +            } else if (participant.alias && participant.alias !== "") {
> +                return participant.alias
>              }
> -            return PhoneUtils.PhoneUtils.format(contactWatcher.phoneNumber)
> +            return PhoneUtils.PhoneUtils.format(participant.phoneNumber)
>          }
>          elide: Text.ElideRight
>          color: UbuntuColors.lightAubergine
> @@ -220,7 +215,7 @@
>          fontSize: "small"
>          // FIXME: handle conference call
>          text: phoneNumberSubTypeLabel
> -        visible: interactive && !contactWatcher.isUnknown // non-interactive entries are calls from unknown or private numbers
> +        visible: interactive && !unknownContact
>      }
>  
>      // time and duration on the right side of the delegate
> 
> === modified file 'src/qml/HistoryPage/HistoryPage.qml'
> --- src/qml/HistoryPage/HistoryPage.qml	2014-08-27 20:07:54 +0000
> +++ src/qml/HistoryPage/HistoryPage.qml	2014-09-11 20:57:52 +0000
> @@ -103,7 +103,7 @@
>          visible: false
>          property variant model: Item {
>              property string senderId: "dummy"
> -            property variant participants: ["dummy"]
> +            property variant participants: [ {phoneNumber:"dummy"} ]
>          }
>      }
>  
> @@ -152,6 +152,7 @@
>              sortOrder: HistorySort.DescendingOrder
>          }
>          filter: emptyFilter
> +        matchContacts: true
>      }
>  
>      MultipleSelectionListView {
> @@ -322,7 +323,7 @@
>                          text: i18n.tr("Details")
>                          onTriggered: {
>                              pageStack.push(Qt.resolvedUrl("HistoryDetailsPage.qml"),
> -                                                          { phoneNumber: participants[0],
> +                                                          { phoneNumber: participants[0].phoneNumber,
>                                                              events: model.events,
>                                                              eventModel: historyEventModel})
>                          }
> 


-- 
https://code.launchpad.net/~boiko/dialer-app/use_history_contact_info/+merge/233861
Your team Ubuntu Phablet Team is subscribed to branch lp:dialer-app.



More information about the Ubuntu-reviews mailing list