Merge lp:~tiagosh/messaging-app/fix-phone-label into lp:messaging-app

Proposed by Tiago Salem Herrmann
Status: Work in progress
Proposed branch: lp:~tiagosh/messaging-app/fix-phone-label
Merge into: lp:messaging-app
Diff against target: 54 lines (+21/-2)
1 file modified
src/qml/Messages.qml (+21/-2)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/fix-phone-label
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+212489@code.launchpad.net

Commit message

include phone label to the messaging thread view title.

Description of the change

include phone label to the messaging thread view title.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
86. By Tiago Salem Herrmann

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

86. By Tiago Salem Herrmann

merge trunk

85. By Tiago Salem Herrmann

add phone label to the view title

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/Messages.qml'
2--- src/qml/Messages.qml 2014-03-20 18:39:45 +0000
3+++ src/qml/Messages.qml 2014-03-25 12:50:42 +0000
4@@ -41,6 +41,7 @@
5 property int orientationAngle: Screen.angleBetween(Screen.primaryOrientation, Screen.orientation)
6 property bool landscape: orientationAngle == 90 || orientationAngle == 270
7 property bool pendingMessage: false
8+ property string phoneNumberSubTypeLabel: ""
9 flickable: null
10 title: {
11 if (landscape) {
12@@ -51,7 +52,7 @@
13 if (contactWatcher.isUnknown) {
14 firstRecipient = contactWatcher.phoneNumber
15 } else {
16- firstRecipient = contactWatcher.alias
17+ firstRecipient = contactWatcher.alias + phoneNumberSubTypeLabel
18 }
19 if (participants.length == 1) {
20 return firstRecipient
21@@ -68,6 +69,10 @@
22 threadId = getCurrentThreadId()
23 }
24
25+ function updateSubTypeLabel() {
26+ phoneNumberSubTypeLabel = contactWatcher.isUnknown ? "" : " - " + phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail)).label
27+ }
28+
29 function getCurrentThreadId() {
30 if (participants.length == 0)
31 return ""
32@@ -193,7 +198,21 @@
33 ContactWatcher {
34 id: contactWatcher
35 phoneNumber: participants.length > 0 ? participants[0] : ""
36- }
37+ onIsUnknownChanged: updateSubTypeLabel();
38+ }
39+
40+ PhoneNumber {
41+ id: phoneDetail
42+ contexts: contactWatcher.phoneNumberContexts
43+ subTypes: contactWatcher.phoneNumberSubTypes
44+ onSubTypesChanged: updateSubTypeLabel();
45+ onContextsChanged: updateSubTypeLabel();
46+ }
47+
48+ ContactDetailPhoneNumberTypeModel {
49+ id: phoneTypeModel
50+ }
51+
52
53 onParticipantsChanged: {
54 threadId = getCurrentThreadId()

Subscribers

People subscribed via source and target branches